Dark theme for all "Read The Docs" websites.
当前为
// ==UserScript==
// @name Dark Read The Docs
// @namespace Dark Read The Docs
// @include *
// @version 1
// @grant none
// @description Dark theme for all "Read The Docs" websites.
// ==/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);
}
var nodes = document.querySelectorAll(".rst-current-version");
if (nodes.length == 0) {
return;
}
addGlobalStyle('html,body,.wy-nav-content,.highlight,.reference,.subnav,.n,.k,.ow\
{background:none#000!important;color:#bbb!important;text-shadow:none!important;}\
dt{background:none#222!important;color:#bbb!important;text-shadow:none!important;}\
input,code{background:none#222!important;color:#ddd!important;text-shadow:none!important;}\
input { border:1px solid #00f!important;}{visibility: hidden}');