Skip to content

Instantly share code, notes, and snippets.

@P1xt
Last active August 29, 2015 14:06
Show Gist options
  • Save P1xt/6bf30ae96746a92b9ad5 to your computer and use it in GitHub Desktop.
Save P1xt/6bf30ae96746a92b9ad5 to your computer and use it in GitHub Desktop.
Saylor's Chemistry textbook is like three kinds of blue-green on blue-green and damn near illegible, this fixes it
// ==UserScript==
// @name saylor resources
// @namespace P1xt
// @description fix the ghastly styling of the chemistry textbook
// @include http://resources.saylor.org/*
// @version 1.003
// @grant none
// ==/UserScript==
function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}
addGlobalStyle('* {background: #fff ! important; }');
addGlobalStyle('.huge, .big { color: #000 ! important; font-size: 2em; line-height: 120%; } ');
addGlobalStyle('.NavBarBox, .NavBarBox *, .navbartop, #navbar { display: none ! important; } ');
addGlobalStyle('.noprint { margin-top: 30px ! important; } ');
addGlobalStyle('.newsection { margin-left: 0px ! important; } ');
addGlobalStyle('h3 { margin-left: 0px ! important; } ');
addGlobalStyle('p { line-height: 120% ! important; } ');
addGlobalStyle('.footer, .footer *, #footer, #footer *, #Footer, #Footer * { border: none ! important; background-color: #777 ! important; color: #fff ! important} ');
addGlobalStyle('.header, .hbox { border: none ! important;} ');
addGlobalStyle('.pageFrame { border: none ! important;} ');
addGlobalStyle('#ThisPageMenu li a:hover, .SubHeadText { color: #222 ! important;} ');
addGlobalStyle('.exdent2 {margin-left: 0px ! important; margin-right: -25% !important} ');
addGlobalStyle('.exdent3 {margin-left: 0px ! important;} ');
addGlobalStyle('#outerColumnContainer {border: none ! important;} ');
@P1xt
Copy link
Author

P1xt commented Sep 9, 2014

updated to remove the border around pageFrame

@P1xt
Copy link
Author

P1xt commented Sep 9, 2014

And then ... I updated to remove the nav bar because it links to the textbook site, not the saylor resources ... it's misleading so I removed it so I wouldn't accidentally click on it and end back up in blue-green hell.

@P1xt
Copy link
Author

P1xt commented Sep 9, 2014

And then ... I updated the hover state on the page menu links to compensate for everything now being on a white background

@P1xt
Copy link
Author

P1xt commented Sep 9, 2014

And then ... I added a bunch more styles because apparently they didn't even use the same stylesheet across all the pages. FFS they identify the footer by .footer, #footer, or #Footer depending on which page you're on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment