mataamad / Google Play Books Web Reader Dark Mode

// ==UserScript==
// @name         Google Play Books Web Reader Dark Mode
// @description  Dark mode for the web version of google play books.  Hacked together fairly quickly so let me know if you have any issues.  Works well for me though.   If you have issues with all the images being inverted let me know and I'll add a toggle to enable/disable that feature.
// @namespace    mataamad
// @version      0.1.1
// @author       mataamad
// @match        **books.googleusercontent.com/books/reader/display*
// @match        https://play.google.com/books/reader*
// @license      MIT
// @esversion 6
// ==/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('* { color: #eee; background-color: #222 !important; } .gb-statusbar { background: #222; } .gb-topbar { background: #222; } .gb-pagecontrol-input { border: none; } .gb-slider-segment { background: #444 !important; } .gb-slider-indicator { background: #666 !important; border-radius: 16px; } .material-icons { color: #555; } .gb-sidebar-popup { box-shadow: none; background: #222; } .gb-slider-tooltip-body { box-shadow: none; background: #222; } .gb-statusbar:hover .gb-slider-segment { background: #777; } .gb-pagecontrol-input { color: #777;} .gb-pagecontrol span { color: #777; } .gb-title-box-title { color: #777 } .gb-topbar-link-cell a{ color: #777; }body .gb-page-overlay-highlight { background: #07f !important; } .gb-tab { color: #eee } .gb-reader-settings-button * { background-color: #000; } .gb-reader-shadow { box-shadow: 0 1px 8px 1px #000; }');

// addGlobalStyle('img { filter: invert(0.865); }); // inverts images.  Todo make togglable