Skip to content

Instantly share code, notes, and snippets.

@Dispader
Created November 29, 2013 19:57
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 Dispader/7711117 to your computer and use it in GitHub Desktop.
Save Dispader/7711117 to your computer and use it in GitHub Desktop.
a quick bookmarklet to modify main page styles for readability
javascript: (function () {
var newSS, styles = '* { background: black ! important; color: white !important } :link, :link * { color: #AAAAFF !important } :visited, :visited * { color: #9191FF !important }';
if (document.createStyleSheet) {
document.createStyleSheet("javascript:'" + styles + "'");
} else {
newSS = document.createElement('link');
newSS.rel = 'stylesheet';
newSS.href = 'data:text/css,' + escape(styles);
document.getElementsByTagName("head")[0].appendChild(newSS);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment