Dark Read The Docs

Dark theme for all "Read The Docs" websites.

当前为 2015-11-08 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Dark Read The Docs
  3. // @namespace Dark Read The Docs
  4. // @include *
  5. // @version 1
  6. // @grant none
  7. // @description Dark theme for all "Read The Docs" websites.
  8. // ==/UserScript==
  9. function addGlobalStyle(css) {
  10. var head,
  11. style;
  12. head = document.getElementsByTagName('head')[0];
  13. if (!head) {
  14. return;
  15. }
  16. style = document.createElement('style');
  17. style.type = 'text/css';
  18. style.innerHTML = css;
  19. head.appendChild(style);
  20. }
  21.  
  22. var nodes = document.querySelectorAll(".rst-current-version");
  23. if (nodes.length == 0) {
  24. return;
  25. }
  26. addGlobalStyle('html,body,.wy-nav-content,.highlight,.reference,.subnav,.n,.k,.ow\
  27. {background:none#000!important;color:#bbb!important;text-shadow:none!important;}\
  28. dt{background:none#222!important;color:#bbb!important;text-shadow:none!important;}\
  29. input,code{background:none#222!important;color:#ddd!important;text-shadow:none!important;}\
  30. input { border:1px solid #00f!important;}{visibility: hidden}');