Code Fonts Better

Change the fonts of code

  1. // ==UserScript==
  2. // @name Code Fonts Better
  3. // @namespace http://tampermonkey.net/
  4. // @namespace https://www.cnblogs.com/xiaozhu0602
  5. // @version 1.0
  6. // @description Change the fonts of code
  7. // @author typerxiaozhu
  8. // @match *://*/*
  9. // @icon https://s2.loli.net/2024/09/07/PL67zbYskErtT3q.png
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function () {
  15. 'use strict';
  16. let codeBlockStyle = document.createElement('style');
  17. codeBlockStyle.innerText = `code{
  18. font-family: 'Consolas' !important;
  19. }`;
  20. document.body.appendChild(codeBlockStyle);
  21. })();