text/plain Style Dark Centered

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

当前为 2017-09-11 提交的版本,查看 最新版本

  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. // @version 1.0.0
  7. // @match *://*/*
  8. // @grant none
  9. // @run-at document-end
  10. // @contributionURL https://etherchain.org/account/0x962644db6d8735446c1af84a2c1f16143f780184
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. if (document.contentType !== 'text/plain') return;
  15. const styleNode = document.createElement('style');
  16. styleNode.textContent =
  17. `body {
  18. display: flex;
  19. align-items: center;
  20. flex-direction: column;
  21. background-color: #111;
  22. color: rgb(212, 212, 212);
  23. font-size: 15px;
  24. }`;
  25. document.head.appendChild(styleNode);
  26. }());