text/plain Style Dark Centered

Light on dark centered content style for text/plain documents.

  1. // ==UserScript==
  2. // @id TextPlainStyleDarkCentered
  3. // @name text/plain Style Dark Centered
  4. // @description Light on dark centered content style for text/plain documents.
  5. // @namespace https://github.com/glebm
  6. // @author Gleb Mazovetskiy <glex.spb@gmail.com>
  7. // @version 1.0.1
  8. // @match *://*/*
  9. // @grant none
  10. // @run-at document-end
  11. // @homepageUrl https://gist.github.com/c6a76841160d80650c518c9a2d59265d
  12. // @contributionURL https://etherchain.org/account/0x962644db6d8735446c1af84a2c1f16143f780184
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. if (document.contentType !== 'text/plain') return;
  17. const styleNode = document.createElement('style');
  18. styleNode.textContent =
  19. `body {
  20. display: flex;
  21. align-items: center;
  22. flex-direction: column;
  23. background-color: #111;
  24. color: rgb(212, 212, 212);
  25. font-size: 15px;
  26. }`;
  27. document.head.appendChild(styleNode);
  28. }());