// ==UserScript== // @name hackaday-css // @version 2021-01-20 // @namespace http://xi6.com/ // @description Black-on-grey theme for Hackaday // @include http://hackaday.com/* // @include https://hackaday.com/* // @icon https://hackaday.com/wp-content/themes/hackaday-2/favicon.ico // -- run at document-start keeps the page from flashing black sometimes on reload // -- but it doesn't always load for some reason // //@run-at document-start // @run-at document-body // @grant none // ==/UserScript== // Stop Hackaday from killing my eyes! // Custom CSS for hackaday.com, black on grey instead of white (or green!) on black // // Primary objective: get rid of the "night mode" and replace it with black-on-gray. // A few other things need to be tweaked too, such as link colors. function css(css) { var head = document.getElementsByTagName('head')[0]; if (head) { var style = document.createElement('style'); style.type = 'text/css'; style.innerHTML = css; head.appendChild(style); } } /* eslint-disable no-multi-spaces */ // wtf don't complain about multi-spaces before '//' comments css('body,' +'blockquote {' +' background: #E0E0E0 !important;' // light gray +' padding: 0px 5px !important;' // make sure it has at least some padding // +' font-size: initial !important;' // seriously everybody, stop fucking with my font prefs +'}'); css('footer[id="colophon"] {' +' background: #C0C0C0 !important;' // light gray +'}'); css('.error404 .site-main .search-form .search-field:focus {' +' color: #000000 !important;' // black text +' background: #E0E0E0 !important;' // on light gray +'}'); css('.subscribe-form .subscribe-field {' +' color: #000000 !important;' +' background: #E0E0E0 !important;' +'}'); css('.widget_categories select {' +' color: #000000 !important;' +' background: #E0E0E0 !important;' +'}'); css('#secondary .widget_search .search-field {' +' background: #E0E0E0 !important;' +'}'); css('a {' +' color: #4444FF !important;' // blue links +'}'); css('a:visited {' +' color: #804080 !important;' // purplish visited links +'}'); css('article {' +' background-color: #E0E0E0 !important;' // light gray +'}'); css('body, button, input, select, textarea {' +' color: #202020 !important;' // dark gray for reply area +'}'); // headline text css('h1, h1>a, h2, h2>a, h1>a:visited {' +' color: #000000 !important;' // black text +' text-transform: none !important;' // don't make it all-caps... +' font-variant: small-caps !important;' // ...make it small caps! +'}'); css('pre {' +' background: #FFFFFF !important;' +'}'); // nagivation menu text color css('.main-navigation a {' +' color: #000000 !important;' // black +'}'); // navigation menu text hover color css('.main-navigation a:hover {' +' color: #DDCE00 !important;' // orange-ish color +'}'); // navigation menu hilight for current page css('.main-navigation .current_page_item > a,' +'.main-navigation .current-menu-item > a,' +'.main-navigation .current_page_ancestor > a {' +' color: #DDCE00 !important;' // orange-ish color +'}'); // search box css('.main-navigation .search-field {' +' color: #202020 !important;' // dark gray +' background: #E0E0E0 !important;' // on light gray +'}'); // tables css('#hackadayTable td {' +' border-color: #808080 !important;' // medium gray borders +' background-color: #C0C0C0 !important;' // a little darker than the page +'}'); // captions css('figcaption {' +' color: #44CC44 !important;' +' background: #303030 !important;' +'}'); // https://hackaday.com/2018/11/30/packing-decimal-numbers-easily/ css('li > code, p > code, p > a > code, postform {' +' background-color: #C0C0C0 !important;' +'}'); // https://hackaday.com/2021/01/01/number-bases-stretch-the-mind/ css('h3 > code {' +' background-color: #C0C0C0 !important;' +'}'); // https://hackaday.com/2019/01/08/preserving-floppy-disks-via-logic-analyser/ css('.one-series {' +' color:#448844 !important;' +'}');