W3C-Noto

W3C site, using Noto Sans

  1. // ==UserScript==
  2. // @name W3C-Noto
  3. // @description W3C site, using Noto Sans
  4. // @namespace https://tripu.info/
  5. // @version 0.3.1
  6. // @include http://w3.org/*
  7. // @include http://*.w3.org/*
  8. // @include https://w3.org/*
  9. // @include https://*.w3.org/*
  10. // @license MIT
  11. // @supportURL https://tripu.info/
  12. // @author tripu
  13. // ==/UserScript==
  14.  
  15. console.debug('[W3C-Noto] Start');
  16.  
  17. (() => {
  18. 'use strict';
  19. if (document && document.getElementsByTagName && document.createElement) {
  20. var head = document.getElementsByTagName('head');
  21. if (head && 1 === head.length) {
  22. const link = document.createElement('link'),
  23. style = document.createElement('style');
  24. head = head[0];
  25. link.setAttribute('href', '//www.w3.org/People/Antonio/noto/noto-tmp.css');
  26. link.setAttribute('rel', 'stylesheet');
  27. style.innerText = `
  28. :not(pre):not(ol):not(ul) {
  29. line-height: 1.5;
  30. }
  31. pre, pre *, ol, ol *, ul, ul * {
  32. line-height: 1.25;
  33. }
  34. :not(code):not(pre) {
  35. font-family: 'Noto Sans', sans-serif;
  36. }
  37. code, code *, pre, pre * {
  38. font-family: 'Inconsolata', monospace !important;
  39. }
  40. `;
  41. head.appendChild(link);
  42. head.appendChild(style);
  43. console.debug('[W3C-Noto] Done');
  44. } else
  45. console.debug('[W3C-Noto] No head');
  46. } else
  47. console.debug('[W3C-Noto] No document');
  48. })();
  49.  
  50. console.debug('[W3C-Noto] End');