docs.rs iosevka term font

change the default fonts on rust docs sites

Från och med 2024-03-14. Se den senaste versionen.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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";
    });

})();