Skip to content

Instantly share code, notes, and snippets.

@mmodrow
Created June 3, 2019 09:20
Show Gist options
  • Select an option

  • Save mmodrow/4f5b0941ad9f3cf4e22c5281d76b7492 to your computer and use it in GitHub Desktop.

Select an option

Save mmodrow/4f5b0941ad9f3cf4e22c5281d76b7492 to your computer and use it in GitHub Desktop.
Template for adding a style tag to the head of sites - e.g. for custom colour blind modes
// ==UserScript==
// @name CSS adder
// @namespace http://css.com/
// @version 0.1
// @description Adds styles to a site
// @author Marc A. Modrow
// @match http*://*css.com*/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var colourblindCss = document.createElement("style");
colourblindCss.innerHTML = '.greenStuff {\n color: lime;\n}\n';
document.querySelector("head").appendChild(colourblindCss);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment