Skip to content

Instantly share code, notes, and snippets.

@Thomashighbaugh
Last active September 12, 2024 14:31
Show Gist options
  • Save Thomashighbaugh/093087d02521bdcc087e953bb5677a2e to your computer and use it in GitHub Desktop.
Save Thomashighbaugh/093087d02521bdcc087e953bb5677a2e to your computer and use it in GitHub Desktop.
Dark mode for NixOS related websites (nixos.org, nixos.wiki, etc) so I can search for packages and read wiki pages, necessities when using this extremely obtuse OS I cannot escape, without burning my eyes.
// ==UserScript==
// @name Dark NixOS Package, Wiki and Main Site
// @namespace http://userstyles.org
// @description Darkened NixOS Websites, includes Wiki and Package Search
// @author Thomas Leon Highbaugh
// @homepage https://userstyles.org/styles/163453
// @match http://nixos.org/*
// @match https://nixos.org/*
// @match http://*.nixos.org/*
// @match https://*.nixos.org/*
// @match https://*.nixos.wiki/*
// @match https://nixos.wiki/*
// @match https://*.nixos.*
// @run-at document-start
// @version 0.20180819014604
// ==/UserScript==
(function() {var css = [
"body {",
" color: #d5d5d5 !important; ",
" background-color: #1a1a1a !important;",
"}",
"code {",
"background: #2c2c2c !important;",
"color:#666 !important;",
"border: 2px solid #666 !important;",
"outline: none !important;",
"border-radius: 3px !important;",
"}",
".mw-highlight, .mw-content-ltr{",
"background: #181818 !important;",
"color:#666 !important;",
"}",
".result-item-show-more {",
"background: #2c2c2c !important;",
"color:#888 !important;",
"border: 2px solid #888 !important;",
"outline: none !important;",
"border-radius: 3px !important;",
"}",
".search-sidebar a {",
"color:#888 !important;",
"}",
".search-sidebar a:hover {",
"color:#222 !important;",
"}",
".badge {",
"background: #3c3c3c !important;",
"}",
".btn{",
"background: #282828 !important;",
"color: #d5d5d5 !important; ",
"border: 1px solid #333333aa !important;",
"border-radius: 8px !important;",
"}",
".btn .active{",
"background: #555 !important;",
"color: #d5d5d5 !important; ",
"border: 5px solid #d5d5d5ff !important;",
"border-radius: 8px !important;",
"}",
".navbar-inner {",
" background-image: linear-gradient(to bottom, #2f2f2f, #212121) !important;",
" background-repeat: repeat-x !important;",
" border: 1px solid #1d1d1d !important;",
"}",
".navbar .brand {",
" color: #b7b7b7 !important;",
" text-shadow: 0 1px 0 #141414 !important;",
"}",
".navbar .brand > a:hover {",
" color: #e1e1e1 !important;",
"}",
".navbar .nav > li > a {",
" color: #b7b7b7 !important;",
" text-shadow: 0 1px 0 #141414 !important;",
"}",
".navbar .nav > li > a:hover {",
" color: #e1e1e1 !important;",
" text-shadow: 0 1px 0 #141414 !important;",
"}",
"textarea,",
"input[type=\"text\"],",
"input[type=\"password\"],",
"input[type=\"datetime\"],",
"input[type=\"datetime-local\"],",
"input[type=\"date\"],",
"input[type=\"month\"],",
"input[type=\"time\"],",
"input[type=\"week\"],",
"input[type=\"number\"],",
"input[type=\"email\"],",
"input[type=\"url\"],",
"input[type=\"search\"],",
"input[type=\"tel\"],",
"input[type=\"color\"],",
".uneditable-input {",
" background-color: #212121 !important;",
" border: 1px solid #333 !important;",
" color: white !important;",
"}",
"ul.nixos-blogs > li:nth-child(2n+1) {",
" background-color: rgb(39, 39, 39) !important;",
"}",
"ul.nixos-blogs > li {",
" border-top: 1px solid rgb(66, 66, 66) !important;",
"}",
"ul.nixos-commits > li:nth-child(2n+1) {",
" background-color: rgb(39, 39, 39) !important;",
"}",
"ul.nixos-commits > li {",
" border-top: 1px solid rgb(66, 66, 66) !important;",
"}",
"pre {",
" background-color: #111 !important;",
" box-shadow: 0.1em 0.1em 0.5em #0c0c0c !important;",
"}",
"code,",
"pre {",
" color: #999 !important;",
"}",
"table#search-results tr.odd > td {",
" background-color: #292929 !important;",
"}",
"table#search-results tr.even:hover > td {",
" background-color: #292929 !important;",
"}",
".table th,",
".table td {",
" border-top: 1px solid #3c3c3c !important;",
"}",
".pager li > a,",
".pager li > span {",
" background-color: #2d2d2d !important;",
" border: 1px solid #3c3c3c !important;",
"}",
".pager:hover li > a:hover,",
".pager li > span {",
" background-color: #5f5f5f !important;",
" border: 1px solid #3c3c3c !important;",
"}",
".pager .disabled > a,",
".pager .disabled > a:hover,",
".pager .disabled > a:focus,",
".pager .disabled > span {",
" background-color: #2d2d2d !important;",
"}",
".alert {",
" text-shadow: 0 1px 0 rgba(66, 66, 66, 0.5) !important;",
" background-color: #3b382d !important;",
" border: 1px solid #44403b !important;",
"}",
".hljs {",
" color: #0051bd !important;",
"}",
".alert-info {",
" color: #3a87ad !important;",
" background-color: #1b2930 !important !important;",
" border-color: #273336 !important !important;",
"}",
".table-striped tbody > tr:nth-child(2n+1) > td,",
".table-striped tbody > tr:nth-child(2n+1) > th {",
" background-color: #232323 !important;",
"}",
".dropdown-menu {",
" background-color: #272727 !important;",
"}",
".dropdown-menu > li > a {",
" color: #909090 !important;",
"}",
".dropdown-menu .divider {",
" *width: 100% !important;",
" height: 1px !important;",
" margin: 9px 1px !important;",
" *margin: -5px 0 5px !important;",
" overflow: hidden !important;",
" background-color: #606060 !important;",
" border-bottom: 1px solid #606060 !important;",
"}",
".news-short {",
" color: #fcfcfc !important;",
"}",
"hr {",
" border-top: 1px solid #656565 !important;",
" border-bottom: 1px solid #656565 !important;",
"}",
"",
".hljs {",
" background: #0e0e0e !important;",
"}"
].join("\n");
if (typeof GM_addStyle != "undefined") {
GM_addStyle(css);
} else if (typeof PRO_addStyle != "undefined") {
PRO_addStyle(css);
} else if (typeof addStyle != "undefined") {
addStyle(css);
} else {
var node = document.createElement("style");
node.type = "text/css";
node.appendChild(document.createTextNode(css));
var heads = document.getElementsByTagName("head");
if (heads.length > 0) {
heads[0].appendChild(node);
} else {
// no head yet, stick it whereever
document.documentElement.appendChild(node);
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment