change the default fonts on rust docs sites
当前为
// ==UserScript==
// @name docs.rs iosevka term font
// @namespace http://tampermonkey.net/
// @version 2024-03-14
// @description change the default fonts on rust docs sites
// @author You
// @match docs.rs/*, doc.rust-lang.org/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=docs.rs
// @grant none
// @license MIT
// ==/UserScript==
(function() {
'use strict';
// Select all elements with a class containing "font" (common for code blocks)
const codeElements = document.querySelectorAll("div, a, ol, li, ul, p, pre, code, .font");
// Loop through each element
codeElements.forEach(element => {
// Set the font family to Iosevka Term
element.style.fontFamily = "Iosevka Term, monospace";
});
})();