Stack Overflow: Dark theme fixes

Includes some temporary fixes for some bugs in the beta Stack Overflow dark theme (found in https://stackoverflow.com/users/preferences/), before they get fixed. Suggest new fixes if you find them; I might add them.

  1. // ==UserScript==
  2. // @name Stack Overflow: Dark theme fixes
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Includes some temporary fixes for some bugs in the beta Stack Overflow dark theme (found in https://stackoverflow.com/users/preferences/), before they get fixed. Suggest new fixes if you find them; I might add them.
  6. // @author SUM1
  7. // @match https://*.stackoverflow.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. // Edit answer pages
  14. if (/^https?:\/\/stackoverflow.com\/posts\/\d+\/edit/.test(document.URL)) {
  15. // Background colour of top help banner
  16. document.querySelector("#mainbar .s-notice").style.backgroundColor = 'var(--yellow-100)';
  17. // Question title colour
  18. document.querySelector(".post-editor > style").innerHTML = '\n .question-hyperlink {\n color: var(--black-800) !important;\n }\n ';
  19. }
  20. // Question pages
  21. if (/^https?:\/\/stackoverflow.com\/questions\/\d+\/.+/.test(document.URL)) {
  22. // Comment help background colour
  23. document.styleSheets[2].insertRule('.comment-help {background-color: var(--yellow-100); border-color: var(--yellow-200); }');
  24. // Comment help text colour
  25. document.styleSheets[2].insertRule('.comment-help > p {color: var(--black-800);}');
  26. // Comment help code colour
  27. document.styleSheets[2].insertRule('.comment-help > p > code {color: var(--black-800);}');
  28. }
  29. })();