-
Notifications
You must be signed in to change notification settings - Fork 1
/
fonts.user.styl
184 lines (152 loc) · 5.69 KB
/
fonts.user.styl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
/* ==UserStyle==
@name Custom fonts
@namespace github.com/vednoc/custom-fonts
@description Apply your favorite custom fonts with ease.
@author vednoc <[email protected]> (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.6.0
@license MIT
@var text base 'Set your favorite Base font' 'null'
@var select baseStyle 'Base font style' {
'Default*': 'null',
'Normal ': 'normal',
'Italic ': 'italic',
'Oblique ': 'oblique',
}
@var select baseWeight 'Base font weight' {
'Default *': 'null',
'100 ': '100',
'200 ': '200',
'300 ': '300',
'400 (Normal) ': '400',
'500 ': '500',
'600 ': '600',
'700 (Bold) ': '700',
'800 ': '800',
'900 ': '900',
}
@var text mono 'Set your favorite Mono font' 'null'
@var select monoStyle 'Mono font style' {
'Default*': 'null',
'Normal ': 'normal',
'Italic ': 'italic',
'Oblique ': 'oblique',
}
@var select monoWeight 'Mono font weight' {
'Default *': 'null',
'100 ': '100',
'200 ': '200',
'300 ': '300',
'400 (Normal) ': '400',
'500 ': '500',
'600 ': '600',
'700 (Bold) ': '700',
'800 ': '800',
'900 ': '900',
}
@var checkbox letterSpacing 'Reset letter-spacing to 0px' 0
@var checkbox inputs 'Use Mono font in input areas' 0
==/UserStyle== */
icons = ()
code = ()
composer = ()
bold = ()
// Exclude default code areas.
append(code, 'code', 'pre', '.pre')
// Exclude icon fonts.
append(icons, '.i', '.icon', '[class*=icon]')
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, '[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
// Exclude code areas on GitHub.
append(code, '[class^=blob-]', '.react-code-text', '#read-only-cursor-text-area', '.code-navigation-cursor')
// Exclude code areas on GitLab.
append(code, '.diff-line-num')
append(code, '.diff-viewer') // commit diff
// Exclude various text editors.
append(code, '.ace_editor') // #2
append(code, '.CodeMirror', '.cm-editor .cm-scroller')
append(code, '.monaco-editor')
append(composer, '#squire') // protonmail
// Gmail composer and font menu. #3
append(icon, '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')
// Lightbox. #12
append(icons, '.fancybox-button')
// Microsoft icons. #12
append(icons, '[data-icon-name]')
// Telegram Web
append(icons, '[class*=tgico-]')
append(composer, 'textarea')
// Discord
append(composer, '[data-slate-editor=true]', '[class*=channelTextArea-]')
// Gmail #3
append(composer, '[contenteditable=true]', '[g_editable]')
// inputs, but not of button type #6
append(composer, 'input:not([name=subjectbox]):not([type=button]):not([type=submit]):not([type=reset])')
// Github search
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')
// Add children elements.
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
$bold = join(', ', bold)
$code = join(', ', code)
$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
}
:not({ $bold }) {
font-weight: baseWeight if baseWeight
}
{ $code } {
font-family: mono !important if mono
font-style: monoStyle !important if monoStyle
font-weight: monoWeight if monoWeight
letter-spacing: 0px !important if letterSpacing
}
{ $composer } {
if inputs {
font-family: mono !important if mono
font-style: monoStyle !important if monoStyle
font-weight: monoWeight if monoWeight
letter-spacing: 0px !important if letterSpacing
} else {
font-family: base !important if base
font-style: baseStyle !important if baseStyle
font-weight: baseWeight if baseWeight
letter-spacing: 0px !important if letterSpacing
}
}
}
@-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
}
}