Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge my improvements #20

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
58 changes: 35 additions & 23 deletions fonts.user.styl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@supportURL https://github.com/vednoc/custom-fonts/issues
@updateURL https://userstyles.world/api/style/85.user.css
@preprocessor stylus
@version 0.6.0
@version 0.7.0
@license MIT

@var text base 'Set your favorite Base font' 'null'
Expand All @@ -29,6 +29,7 @@
'800 ': '800',
'900 ': '900',
}
@var text baseFontFeatures 'Set your font\'s font features' 'null'

@var text mono 'Set your favorite Mono font' 'null'
@var select monoStyle 'Mono font style' {
Expand All @@ -49,6 +50,7 @@
'800 ': '800',
'900 ': '900',
}
@var text monoFontFeatures 'Set your mono font\'s font features' 'null'

@var checkbox letterSpacing 'Reset letter-spacing to 0px' 0

Expand All @@ -62,26 +64,30 @@ composer = ()
bold = ()

// Exclude default code areas.
append(code, 'code', 'pre', '.pre')
append(code, 'code', '.code', 'pre', '.pre')

// Exclude icon fonts.
append(icons, '.i', '.icon', '[class*=icon]')
append(icons, 'i', 'icon')
append(icons, '.i', '.icon', '[class*=icon]', '[icon]')
append(icons, '[class*=symbol]')
append(icons, '.fa', '.fab', '.fad', '.fal', '.far', '.fas')
append(icons, '.fa-solid', '.fa-regular', '.fa-light', '.fa-duotone', '.fa-thin', '.fa-sharp', '.fa-brands')
append(icons, '[class*=octicon-]') // github
append(icons, '.glyphicon') // searx
append(icons, '[aria-hidden=true]') // google meet
append(icons, '[class*=material-icons]') // material icons
// append(icons, '[aria-hidden=true]') // google meet
append(icons, '[class*=icofont]') // icofont icons
append(icons, '[class*=selector__glyph][data-bind]') // fontello icons

// Exclude icons on DuckDuckGo.
append(icons, 'input[id^=search][type=submit][value=S]') // search bar
append(icons, '[class*=js-side-menu-]') // navbar menu
append(icons, '.ddgsi', '.btn--icon') // misc icons
append(icons, '.ddgsi')

// Exclude code areas on GitHub.
append(code, '[class^=blob-]', '.react-code-text', '#read-only-cursor-text-area', '.code-navigation-cursor')
append(code, '.react-code-lines div.react-code-text', '#read-only-cursor-text-area', '.code-navigation-cursor', '.react-code-text')
append(code, '[class^=blob-]:not([data-rich-type="markup"]):not(:has([data-rich-type="markup"]))')

// Github gist
append(code, '.CodeMirror')

// Exclude code areas on GitLab.
append(code, '.diff-line-num')
Expand All @@ -91,16 +97,21 @@ append(code, '.diff-viewer') // commit diff
append(code, '.ace_editor') // #2
append(code, '.CodeMirror', '.cm-editor .cm-scroller')
append(code, '.monaco-editor')
append(code, '.d2h-code-wrapper')
append(code, "#commandWindowWrapper")

append(composer, '#squire') // protonmail

// Gmail composer and font menu. #3
append(icon, 'div[jsaction][jslog]', '[id][style*=font-family]')
append(icons, 'div[jsaction][jslog]', '[id][style*=font-family]')

// Exclude utility classes for fonts.
append(code, '.monospace', '.text-mono', '.font-mono', '[class*=monospace]')

// mathjax
append(icons, 'mjx-math')
append(icons, 'mjx-math', 'mjx-math *', '.mathjax', '.mathjax *')
append(icons, '[id^=MathJax]')
append(icons, '[class*=MathJax]', '[class*=MathJax] *')

// Lightbox. #12
append(icons, '.fancybox-button')
Expand All @@ -117,7 +128,7 @@ append(composer, 'textarea')
append(composer, '[data-slate-editor=true]', '[class*=channelTextArea-]')

// Gmail #3
append(composer, '[contenteditable=true]', '[g_editable]')
append(composer, '[g_editable]') // '[contenteditable=true]'

// inputs, but not of button type #6
append(composer, 'input:not([name=subjectbox]):not([type=button]):not([type=submit]):not([type=reset])')
Expand All @@ -127,9 +138,16 @@ append(composer, '.QueryBuilder-StyledInputContainer')

// don't change the weight of headers and bold text
append(bold, 'strong', 'b', '[class*=bold]', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6')
append(bold, '[data-markup*="bold"]')

// LanguageTool overlay, not an Icon but the best alternative
append(icons, 'lt-div', 'lt-div *')

// Telegram
append(icons, ".tgico")

// Add children elements.
append(icons, i + ' *') for i in icons
//append(icons, i + ' *') for i in icons
append(code, i + ' *') for i in code
append(composer, i + ' *') for i in composer
append(bold, i + ' *') for i in bold
Expand All @@ -140,15 +158,15 @@ $icons = join(', ', icons)
$composer = join(', ', composer)

@-moz-document regexp('(file|https?|(chrome|moz)-extension)://.+') {

// make sure to include all selectors that get different fonts int the :not
:not({ join(', ', $icons, $code, $composer, 'body > div') }) {
font-family: base !important if base
font-style: baseStyle !important if baseStyle
letter-spacing: 0px !important if letterSpacing
font-feature-settings baseFontFeatures if baseFontFeatures
}

:not({ $bold }) {
:not({ join(', ', $bold, $icons) }) {
font-weight: baseWeight if baseWeight
}

Expand All @@ -157,6 +175,7 @@ $composer = join(', ', composer)
font-style: monoStyle !important if monoStyle
font-weight: monoWeight if monoWeight
letter-spacing: 0px !important if letterSpacing
font-feature-settings monoFontFeatures ? monoFontFeatures : unset
}

{ $composer } {
Expand All @@ -165,20 +184,13 @@ $composer = join(', ', composer)
font-style: monoStyle !important if monoStyle
font-weight: monoWeight if monoWeight
letter-spacing: 0px !important if letterSpacing
font-feature-settings monoFontFeatures ? monoFontFeatures : unset
} else {
font-family: base !important if base
font-style: baseStyle !important if baseStyle
font-weight: baseWeight if baseWeight
letter-spacing: 0px !important if letterSpacing
font-feature-settings baseFontFeatures if baseFontFeatures
}
}
}

@-moz-document regexp('https?://(www\.)?github.com/.*') {
{ 'body > div' } {
font-family: mono !important if mono
font-style: monoStyle !important if monoStyle
font-weight: monoWeight if monoWeight
letter-spacing: 0px !important if letterSpacing
}
}