-
Notifications
You must be signed in to change notification settings - Fork 2
/
tweaks.user.styl
188 lines (162 loc) · 5.47 KB
/
tweaks.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
185
186
187
188
/* ==UserStyle==
@name UserStyles.world Tweaks
@namespace userstyles.world
@description Various tweaks for UserStyles.world that might end up being upstreamed.
@author vednoc <[email protected]> (https://github.com/vednoc)
@homepageURL https://github.com/userstyles-world/tweaks
@supportURL https://github.com/userstyles-world/tweaks/issues
@updateURL https://github.com/userstyles-world/tweaks/raw/main/tweaks.user.styl
@preprocessor stylus
@version 1.4.2
@license MIT
@var checkbox colors 'Force dark mode' 0
@var checkbox oldDark 'Old dark mode colors' 0
@var checkbox navbar 'Enable sticky navbar' 1
@var checkbox blurry 'Enable blurry navbar style' 0
@var checkbox stylus 'Enable "Get Stylus" button' 1
@var checkbox newBars 'Enable new styles for nav/footer bars' 0
@var checkbox version 'Show userstyle version in the footer' 1
@var checkbox monitor 'Enable tweaks for Monitor page' 1
==/UserStyle== */
// This userstyle uses Stylus-lang preprocessor.
// Complete preprocessor documentation at: https://stylus-lang.com
// Writing UserCSS: https://github.com/openstyles/stylus/wiki/Writing-UserCSS
@-moz-document domain("userstyles.world") {
// Stylus-lang helper variables.
i = !important
// Dark mode color variables.
darkModeColors = @block {
--bg-1: (oldDark) ? #101010 : #1a1a1a
--bg-2: (oldDark) ? #1d1d1d : #272727
--bg-3: (oldDark) ? #2a2a2a : #343434
--bg-4: (oldDark) ? #363636 : #404040
--bg-5: (oldDark) ? #434343 : #4d4d4d
--fg-1: (oldDark) ? #dddddd : #dddddd
--fg-2: (oldDark) ? #bebebe : #bebebe
--fg-3: (oldDark) ? #a0a0a0 : #a0a0a0
--fg-4: (oldDark) ? #818181 : #919191
--fg-5: (oldDark) ? #636363 : #636363
--ac-1: (oldDark) ? #679cd0 : #679cd0
--ac-2: (oldDark) ? #3673af : #3673af
--ac-3: (oldDark) ? #2d5f90 : #2d5f90
--ac-4: (oldDark) ? #234a71 : #234a71
--ac-5: (oldDark) ? #193652 : #193652
}
// Embed userstyle version.
:root {
--version: 'UserStyles.world Tweaks v1.4.1'
// Feat -> Force dark mode.
if colors {
{ darkModeColors }
}
// Feat -> Old dark mode colors.
if oldDark {
@media (prefers-color-scheme: dark) {
{ darkModeColors }
}
}
}
// Feat -> Sticky navbar.
if navbar {
nav {
position: sticky
z-index: 9
top: 0
}
}
// Feat -> Blurry navbar.
if blurry {
@supports (backdrop-filter: blur()) or (-webkit-backdrop-filter: blur()) {
// Setting class conditionally. Interop new- and old-bar styles.
class = (newBars) ? '> div[class]' : ()
check = (colors == 1 && oldDark == 1)
forceDark = (check) ? i : ()
// Generate it.
nav { class } {
$c = (check) ? #1d1d1d : #272727
background-color: transparentify($c, $c, 0.8) forceDark
backdrop-filter: blur(4px) saturate(150%)
-webkit-backdrop-filter: blur(4px) saturate(150%)
@media (prefers-color-scheme: light) {
$c = #dadada
background-color: transparentify($c, $c, 0.8)
}
}
}
}
// Feat -> Stylus button.
if !stylus {
#stylus { display: none }
}
// Feat -> New nav/footer styles.
if newBars {
r = var(--br-2) // helper
nav {
border: none
background: none
> div {
padding-top: 0 i
padding-bottom: 0px i
border-radius: 0 0 r r
background-color: var(--bg-2)
box-shadow: 0 0 0 1px var(--bg-1)
> * { padding: 1rem 0 }
}
}
}
// Feat -> Show userstyle version in footer.
if version {
.Footer .about {
margin-top: 2rem
&::before {
margin-top: -2rem
position: absolute
width: max-content
content: var(--version)
}
}
}
}
@-moz-document url-prefix("https://userstyles.world/monitor") {
// Feat -> Tweaks for Monitor page.
if monitor {
// Change styles.
body > .wrapper {
padding: 30px 8px
.row {
padding-top: 20px
align-items: flex-start
border-top: 1px solid #eee
}
}
// Responsive mode.
@media (max-width: 640px) {
h2 { width: 100% }
.row {
flex-direction: column i
align-items: center i
text-align: center i
// Fix 'memory usage' text.
.column:first-child { width: unset }
}
}
// Dark mode tweaks.
@media (prefers-color-scheme: dark) {
// Always apply dark mode colors.
:root {
{ darkModeColors }
scrollbar-color: var(--bg-5) var(--bg-2)
}
body {
color: var(--fg-1)
background-color: var(--bg-1)
.wrapper {
.row { border-color: var(--bg-3) }
.metric { color: var(--fg-5) }
}
// Invert colors for graphs.
canvas { filter: invert() hue-rotate(180deg) }
}
}
}
}