Custom fonts by vednoc
Imported from https://raw.githubusercontent.com/vednoc/custom-fonts/main/fonts.user.styl

Details
Authorvednoc
LicenseMIT
Created atApril 26, 2021 15:56
Updated atMay 6, 2021 21:59
Applies toglobal
Statistics
Learn how we calculate statistics in the FAQ.
Total views800
Total installs2531
Weekly installs91
Description
Apply custom base font globally.
Notes
Inspired by openstyles/stylus/#1236. If you find bugs and/or have suggestions, feel free to open an issue on GitHub.
History
Daily snapshots of style statistics.
Source code
/* ==UserStyle==
@name Custom fonts
@namespace github.com/vednoc/custom-fonts
@description Apply custom base font globally.
@author vednoc <vednoc@pm.me> (https://github.com/vednoc)
@homepageURL https://github.com/vednoc/custom-fonts
@supportURL https://github.com/vednoc/custom-fonts/issues
@updateURL https://userstyles.world/api/style/85.user.css
@preprocessor stylus
@version 0.3.0
@license MIT
@var text base 'Base font' '"your favorite base font"'
@var text mono 'Mono font' '"your favorite mono font"'
@var checkbox inputs 'Use monospace font in input areas' 0
==/UserStyle== */
@-moz-document regexp("https?://.*") {
i = !important
// Exclude default code areas.
n ?= ':not(code):not(pre):not(pre > span):not(code > span)'
// Exclude icon fonts.
n += ':not(.i):not(.icon)'
n += ':not(.fa):not(.fab):not(.fad):not(.fal):not(.far):not(.fas)'
n += ':not([class*="octicon-"])' // github
n += ':not(.glyphicon)' // searx
n += ':not([aria-hidden=true])' // google meet
n += ':not([class*=material-icons])' // material icons
n += ':not([class*=icofont])' // icofont icons
n += ':not([class*=selector__glyph][data-bind])' // fontello icons
// Exclude icons on DuckDuckGo.
n += ':not(input[id^="search"][type=submit][value=S])' // search bar
n += ':not([class*="js-side-menu-"])' // navbar menu
n += ':not(.ddgsi):not(.btn--icon)' // misc icons
// Exclude code areas on GitHub.
n += ':not([class^="blob-"]):not([class^="blob-"] > span)'
// Exclude code areas on GitLab.
n += ':not(.diff-line-num):not(pre > code > span span)'
n += ':not(.diff-viewer *)' // commit diff
// Editors.
n += ':not(.ace_editor):not(.ace_editor *)' // #2
n += ':not(.CodeMirror):not(.CodeMirror *)'
n += ':not(.monaco-editor *)'
n += ':not(#squire *)' // protonmail
// Use monospace input font on Discord.
if inputs {
n += ':not([data-slate-editor=true] *)'
}
// Exclude Gmail composer and font menu.
n += ':not(div[jsaction][jslog] *)'
n += ':not([id][style*="font-family"]):not([id][style*="font-family"] *)'
// Exclude utility classes for fonts.
n += ':not(.monospace):not(.text-mono)'
// Feat -> Change base fonts in input areas.
if inputs {
n += ':not(input):not(textarea)'
// Gmail elements.
$d ?= ':not([g_editable])'
$i ?= ':not([name="subjectbox"])'
// Workaround for specificity issues.
:not(#z) {
[contenteditable="true"]{ $d } *,
input{ $i },
textarea {
font-family: mono, monospace i
}
}
}
// Generate.
{ n } {
font-family: base, serif i
}
}