Skip to content

Instantly share code, notes, and snippets.

@AndiH
Created February 10, 2016 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndiH/a78a5d37fb80568340a3 to your computer and use it in GitHub Desktop.
Save AndiH/a78a5d37fb80568340a3 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Beautify danluu.com
// @namespace http://danluu.com/
// @description Beautifies Dan Luu's website, because it's plain text
// @version 0.1
// @include http://danluu.com/*
// @grant doCSS
// ==/UserScript==
var doCSS = function (){
var css = 'body {font-family: "PT Serif", Georgia, Baskerville;max-width: 800px;margin: 0 auto;font-size: 1.1em;}h1, h2, h3, h4, h5 {font-family: "PT Sans";}blockquote {border-left: 2px dashed #D6D5D5;padding-left: 5px;}'
if (typeof GM_addStyle != "undefined") {
GM_addStyle(css);
} else if (typeof addStyle != "undefined") {
addStyle(css);
} else {
var heads = document.getElementsByTagName("head");
if (heads.length > 0) {
var node = document.createElement("style");
//node.type = "text/css";
node.innerText = css;
heads[0].appendChild(node);
}
}
}
doCSS();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment