-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswitcher.user.styl
838 lines (796 loc) · 25.3 KB
/
switcher.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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
/* ==UserStyle==
@name Dark-Switcher
@namespace gitlab.com/vednoc/dark-switcher
@description Settings companion for my userstyles.
@author vednoc <vednoc@pm.me> (https://gitlab.com/vednoc)
@homepageURL https://gitlab.com/vednoc/dark-switcher
@supportURL https://gitlab.com/vednoc/dark-switcher/issues
@updateURL https://gitlab.com/vednoc/dark-switcher/raw/master/switcher.user.styl
@preprocessor stylus
@version 2.0.0
@license MIT
@var checkbox overwrite 'Use `!important` to overwrite colors' 1
@var checkbox deepdark 'Overwrite colors for DeepDark themes' 1
@var checkbox whatsapp 'Overwrite Dark-WhatsApp bubbles ' 1
@var checkbox wa_msg_c 'WhatsApp: Brighter message bubbles ' 1
@var checkbox wa_intro 'WhatsApp: Custom intro image colors ' 1
@var checkbox ow_acvar 'Explicitly overwrite accent variable' 0
@var color ow_ac 'Overwrite: Accent variable color ' #ff3f0f
@var checkbox ow_bbvar 'Explicitly overwrite bb variable ' 0
@var color ow_bb 'Overwrite: Custom background color ' #00000015
@var checkbox ow_whvar 'Explicitly overwrite white variable ' 0
@var color ow_wh 'Overwrite: Custom white color k ' #ffffff
@var checkbox ow_shvar 'Explicitly overwrite shadow variable' 0
@var color ow_sh 'Overwrite: Custom shadow color ' #00000030
@var checkbox cg_debug 'Enable color generator debug ' 0
@var select cg_main 'Primary (bg/fg/accent) colors ' {
'Gruvbox Dark Medium *': 'gruvbox-dark-medium ',
'Gruvbox Dark Hard ': 'gruvbox-dark-hard ',
'Gruvbox Dark Soft ': 'gruvbox-dark-soft ',
'Gruvbox Light Medium ': 'gruvbox-light-medium ',
'Gruvbox Light Hard ': 'gruvbox-light-hard ',
'Gruvbox Light Soft ': 'gruvbox-light-soft ',
'DeepDark ': 'deep-dark ',
'Solarized Dark ': 'solarized-dark ',
'Solarized Light ': 'solarized-light ',
'BreezeDark ': 'breeze-dark ',
'Pitch Black ': 'pitch-black ',
'Inspired Dark ': 'inspired-dark ',
'Adapta Nokto ': 'adapta-nokto ',
'Dracula ': 'dracula ',
'Nord Polar Night ': 'nord-dark ',
'Nord Snow Storm ': 'nord-light ',
'Arc Dark ': 'arc-dark ',
'HavocOS ': 'havoc-os ',
'Nier ': 'nier ',
'GitHub-Dark ': 'github-dark ',
'Github-Moonlight ': 'moonlight ',
'Monokai ': 'monokai ',
'Horizon ': 'horizon ',
'Doom One ': 'doom-one ',
'Brave Dark ': 'brave-dark ',
'Custom colors ': 'custom ',
}
@var select cg_syntax 'Secondary (syntax) colors ' {
'Gruvbox Neutral *': 'gruvbox-neutral ',
'Gruvbox Bright ': 'gruvbox-bright ',
'Gruvbox Faded ': 'gruvbox-faded ',
'DeepDark ': 'deep-dark ',
'Solarized ': 'solarized ',
'Dracula ': 'dracula ',
'Nord ': 'nord ',
'GitHub-Dark ': 'github-dark ',
'GitHub-Moonlight ': 'moonlight ',
'Monokai ': 'monokai ',
'Horizon ': 'horizon ',
'Doom One ': 'doom-one ',
'Custom colors ': 'custom ',
}
@var range cg_bg_a 'Adjust bg color tones ' [0, -25, 25, 0.1, '%']
@var range cg_fg_a 'Adjust fg color tones ' [0, -25, 25, 0.1, '%']
@var range cg_ac_a 'Adjust accent color tones ' [0, 0, 25, 1, '%']
@var range cg_sc_a 'Adjust syntax color tones ' [0, 0, 25, 1, '%']
@var color _bg 'Base background color ' #212121
@var color _fg 'Base foreground color ' #cccccc
@var color _ac 'Base accent color ' #0f8f7f
@var color _red 'Base red color ' #f07178
@var color _orange 'Base orange color ' #f78c6c
@var color _yellow 'Base yellow color ' #ffcb6b
@var color _green 'Base green color ' #c3e88d
@var color _cyan 'Base cyan color ' #89ddff
@var color _blue 'Base blue color ' #82aaff
@var color _magenta 'Base magenta color ' #c792ea
@var color _violet 'Base violet color ' #9a91ea
@var color _white 'White color ' #ffffff
@var color sh 'Shadow color ' #00000065
@var color bb 'Old alt background color ' #1a1a1a
@var color hl 'Old highlight bg color ' #2b2b2b
@var color bd 'Old secondary bg color ' #3e3e3e
@var color cm 'Old secondary fg color ' #9d9d9d
==/UserStyle== */
// Whether to use `!important` or not.
if (overwrite) { i = !important }
// Mixin -> Convert HEX to RGB.
to_rgb(input) {
unquote(slice(s('%s', rgba(input, 0)), 5, -3))
}
// Mixin -> Convert to SVG-friendly colors.
to_svg(input) {
s('\%23%s', unquote(substr(s('%s', input), 1, 6)))
}
// Used with `define` to expose generated variables.
g = global
// Primary colors.
Primary = {
'gruvbox-dark-medium': {
_bb: #232323
_bg: #282828
_hl: #32302f
_bd: #3c3836
_fg: #fbf1c7
_cm: #d5c4a1
_ac: #d65d0e
_sh: #00000018
},
'gruvbox-dark-hard': {
_bb: #181b1c
_bg: #1d2021
_hl: #282828
_bd: #3c3836
_fg: #fbf1c7
_cm: #d5c4a1
_ac: #d65d0e
_sh: #00000018
},
'gruvbox-dark-soft': {
_bb: #2e2c2b
_bg: #32302f
_hl: #363433
_bd: #44403d
_fg: #fbf1c7
_cm: #d5c4a1
_ac: #d65d0e
_sh: #00000018
},
'gruvbox-light-medium': {
_bb: #faeebb
_bg: #fbf1c7
_hl: #ebdbb2
_bd: #d5c4a1
_fg: #3c3836
_cm: #665c54
_ac: #d65d0e
_sh: #00000006
},
'gruvbox-light-hard': {
_bb: #f7f1c7
_bg: #f9f5d7
_hl: #f2e5bc
_bd: #d5c4a1
_fg: #3c3836
_cm: #665c54
_ac: #d65d0e
_sh: #00000006
},
'gruvbox-light-soft': {
_bb: #f0e1b1
_bg: #f2e5bc
_hl: #ebdbb2
_bd: #d5c4a1
_fg: #3c3836
_cm: #665c54
_ac: #d65d0e
_sh: #00000008
},
'deep-dark': {
_bb: #0d0d0d
_bg: #111111
_hl: #181818
_bd: #232323
_fg: #eff0f1
_cm: #cccccc
_ac: #00adee
_sh: #00000040
},
'breeze-dark': {
_bb: #1f2225
_bg: #232629
_hl: #2a2e32
_bd: #383e43
_fg: #eff0f1
_cm: #bdc3c7
_ac: #3daee9
_sh: #00000021
},
'solarized-dark': {
_bb: #032c37
_bg: #03303c
_hl: #073642
_bd: #094453
_fg: #93a1a1
_cm: #839496
_ac: #268bd2
_sh: #00000018
},
'solarized-light': {
_bb: #fcf3da
_bg: #fdf6e3
_hl: #eee8d5
_bd: #e2d8b8
_fg: #073642
_cm: #586e75
_ac: #00adee
_sh: #00000009
},
'pitch-black': {
_bb: #0a0a0a
_bg: #000000
_hl: #141414
_bd: #212121
_fg: #cccccc
_cm: #a0a0a0
_ac: #00adee
_sh: #ffffff08
},
'inspired-dark': {
_bb: #272a2d
_bg: #232629
_hl: #1e2124
_bd: #414244
_fg: #eeeeee
_cm: #cccccc
_ac: #5e8acc
_sh: #00000023
},
'adapta-nokto': {
_bb: #202a2f
_bg: #222d32
_hl: #263238
_bd: #324047
_fg: #d5d5d5
_cm: #9b9b9b
_ac: #1abc9c
_sh: #00000016
},
'dracula': {
_bb: #252732
_bg: #282a36
_hl: #34374a
_bd: #46495d
_fg: #f8f8f2
_cm: #c8c8c2
_ac: #50fa7b
_sh: #00000023
},
'nord-dark': {
_bb: #2b313c
_bg: #2e3440
_hl: #3b4252
_bd: #434c5e
_fg: #eceff4
_cm: #c8ced9
_ac: #5e81ac
_sh: #00000021
},
'nord-light': {
_bb: #e7ebf1
_bg: #eceff4
_hl: #dfe4ec
_bd: #c2c9d5
_fg: #2e3440
_cm: #535c6e
_ac: #bf616a
_sh: #00000009
},
'arc-dark': {
_bb: #2e333d
_bg: #343944
_hl: #3c414e
_bd: #475162
_fg: #c1c8d1
_cm: #b3bac5
_ac: #5294e2
_sh: #00000032
},
'havoc-os': {
_bb: #0f1112
_bg: #141618
_hl: #1c1e20
_bd: #2a2f33
_fg: #eeeeee
_cm: #b9baba
_ac: #0794d4
_sh: #00000050
},
'nier': {
_bb: #2d2b25
_bg: #33302a
_hl: #48453c
_bd: #71655b
_fg: #e3decc
_cm: #c5c1b0
_ac: #fe8019
_sh: #00000035
},
'github-dark': {
_bb: #1c1c1c
_bg: #181818
_hl: #222222
_bd: #404040
_fg: #e6e6e6
_cm: #bfbfbf
_ac: #4f8cc9
_sh: #00000040
},
'moonlight': {
_bb: #191b28
_bg: #1e2030
_hl: #212237
_bd: #131421
_fg: #c8d3f5
_cm: #828bb8
_ac: #82aaff
_sh: #00000030
},
'monokai': {
_bb: #242520
_bg: #272822
_hl: #2d2e27
_bd: #49483E
_fg: #e8e8e3
_cm: #c5b49a
_ac: #fd9720
_sh: #00000035
},
'horizon': {
_bb: #1a1c23
_bg: #1c1e26
_hl: #252732
_bd: #323543
_fg: #fdf0ed
_cm: #9fa3a6
_ac: #f09383
_sh: #00000035
},
'doom-one': {
_bb: #23272e
_bg: #21242b
_hl: #282c34
_bd: #3c414e
_fg: #bbc2cf
_cm: #808890
_ac: #51afef
_sh: #00000035
},
'brave-dark': {
_bb: #1d1d1d
_bg: #222222
_hl: #282828
_bd: #393939
_fg: #ededed
_cm: #909192
_ac: #f96234
_sh: #00000045
},
'custom': {
_bb: bb
_bg: _bg
_hl: hl
_bd: bd
_fg: _fg
_cm: cm
_ac: _ac
_sh: sh
},
}
// Secondary colors.
Secondary = {
'gruvbox-neutral': {
_red: #cc241d
_orange: #d64d0e
_yellow: #d79921
_green: #98971a
_cyan: #689d6a
_blue: #458588
_magenta: #c16286
_violet: #a14286
},
'gruvbox-bright': {
_red: #fb4934
_orange: #fe8019
_yellow: #fabd2f
_green: #b8bb26
_cyan: #8ec07c
_blue: #83a598
_magenta: #d3859b
_violet: #b3659b
_white: #333333
},
'gruvbox-faded': {
_red: #9d0006
_orange: #af3a03
_yellow: #b57614
_green: #79740e
_cyan: #427b58
_blue: #076678
_magenta: #8f3f71
_violet: #6f1f71
},
'deep-dark': {
_red: #da4453
_orange: #f79a63
_yellow: #fdbc4b
_green: #27ae60
_cyan: #1abc9c
_blue: #2980b9
_magenta: #fe9ead
_violet: #60459f
},
'solarized': {
_red: #dc322f
_orange: #cb4b16
_yellow: #b58900
_green: #859900
_cyan: #2aa198
_blue: #268bd2
_magenta: #d33682
_violet: #6c71c4
},
'dracula': {
_red: #ff5555
_orange: #ffb86c
_yellow: #f1fa8c
_green: #50fa7b
_cyan: #59f7d2
_blue: #8be9fd
_magenta: #ff79c6
_violet: #bd93f9
_white: #333333
},
'nord': {
_red: #bd616a
_orange: #d08770
_yellow: #ebcb8b
_green: #a3be8c
_cyan: #8fbcbb
_blue: #88c0d0
_magenta: #b48ead
_violet: #81a1c1
_white: #333333
},
'github-dark': {
_red: #ff4444
_orange: #fe9600
_yellow: #ffcc33
_green: #008833
_cyan: #4d5eff
_blue: #4f8cc9
_magenta: #8368aa
_violet: #6e5494
},
'moonlight': {
_red: #ff5370
_orange: #ff995e
_yellow: #ffc777
_green: #c3e88d
_cyan: #86e1fc
_blue: #82aaff
_magenta: #fca7ea
_violet: #c597f9
_white: #333333
},
'monokai': {
_red: #e73c50
_orange: #fd9720
_yellow: #e6db74
_green: #a6e22d
_cyan: #66d9ef
_blue: #7aa6da
_magenta: #f92772
_violet: #ae81ff
_white: #333333
},
'horizon': {
_red: #e95678
_orange: #f09383
_yellow: #fab795
_green: #09f7a0
_cyan: #59e3e3
_blue: #21bfc2
_magenta: #db77cc
_violet: #b877db
_white: #333333
},
'doom-one': {
_red: #ff6c6b
_orange: #da8548
_yellow: #ecbe7b
_green: #98be65
_cyan: #46d9ff
_blue: #51afef
_magenta: #c678dd
_violet: #a9a1e1
_white: #222222
},
'custom': {
_red: _red
_orange: _orange
_yellow: _yellow
_green: _green
_cyan: _cyan
_blue: _blue
_magenta: _magenta
_violet: _violet
_white: white
}
}
// Generate primary color variables for color generator.
for name, colors in Primary {
if (name == cg_main) {
if (cg_debug) {
selected = name + ' = '
for k, v in colors { selected += s('%ss ', v) }
}
/// Generate Stylus-lang variables.
define(key, val, g) for key, val in colors
}
}
// Generate secondary colro variables for color generator.
for name, colors in Secondary {
if (name == cg_syntax) {
if (cg_debug) {
selected2 = name + ' = '
for k, v in colors { selected2 += s('%ss ', v) }
}
/// Generate Stylus-lang variables.
define(key, val, g) for key, val in colors
}
}
// Color generator.
/// NOTE: Scope the variables to avoid potential conflicts.
/{
BA = cg_bg_a
FA = cg_fg_a
AA = cg_ac_a
SA = cg_sc_a
BG = _bg
FG = _fg
AC = (ow_acvar) ? ow_ac : _ac
/// Color generator rules.
if (dark(BG)) {
a1 = (AA + 15); a2 = (AA + 30); a3 = (AA + 45); a4 = (AA + 65); a5 = (AA + 75)
s1 = (SA + 15); s2 = (SA + 30); s3 = (SA + 45); s4 = (SA + 65); s5 = (SA + 75)
b1 = (BA + 10); b2 = (BA - 05); b3 = (BA - 10); b4 = (BA - 15); b5 = (BA - 20)
f1 = (FA - 10); f2 = (FA + 10); f3 = (FA + 20); f4 = (FA + 30); f5 = (FA + 40)
} else {
a1 = (AA + 15); a2 = (AA + 30); a3 = (AA + 45); a4 = (AA + 65); a5 = (AA + 75)
s1 = (SA + 15); s2 = (SA + 30); s3 = (SA + 45); s4 = (SA + 65); s5 = (SA + 75)
b1 = (BA - 10); b2 = (BA + 08); b3 = (BA + 16); b4 = (BA + 24); b5 = (BA + 32)
f1 = (FA - 05); f2 = (FA - 10); f3 = (FA - 15); f4 = (FA - 20); f5 = (FA - 30)
}
/// Generate tones for base colors.
C = {
bg: {
'0': darken(BG, b1),
'1': darken(BG, 0%),
'2': darken(BG, b2),
'3': darken(BG, b3),
'4': darken(BG, b4),
'5': darken(BG, b5),
},
fg: {
'0': darken(FG, f1),
'1': darken(FG, 0%),
'2': darken(FG, f2),
'3': darken(FG, f3),
'4': darken(FG, f4),
'5': darken(FG, f5),
},
ac: {
'0': AC,
'1': mix(darken(BG, 40%), AC, a1),
'2': mix(darken(BG, 40%), AC, a2),
'3': mix(darken(BG, 40%), AC, a3),
'4': mix(darken(BG, 40%), AC, a4),
'5': mix(darken(BG, 40%), AC, a5),
},
b1: {
'0': spin(_red, 0deg - 0%)
'1': spin(_red, 15deg - s1)
'2': spin(_red, 30deg - s2)
'3': mix(darken(BG, 20%), _red, s3)
'4': mix(darken(BG, 40%), _red, s4)
'5': mix(darken(BG, 40%), _red, s5)
},
b2: {
'0': spin(_orange, 0deg - 0%)
'1': spin(_orange, 15deg - s1)
'2': spin(_orange, 30deg - s2)
'3': mix(darken(BG, 20%), _orange, s3)
'4': mix(darken(BG, 40%), _orange, s4)
'5': mix(darken(BG, 40%), _orange, s5)
},
b3: {
'0': spin(_yellow, 0deg - 0%)
'1': spin(_yellow, 15deg - s1)
'2': spin(_yellow, 30deg - s2)
'3': mix(darken(BG, 20%), _yellow, s3)
'4': mix(darken(BG, 40%), _yellow, s4)
'5': mix(darken(BG, 40%), _yellow, s5)
},
b4: {
'0': spin(_green, 0deg - 0%)
'1': spin(_green, 15deg - s1)
'2': spin(_green, 30deg - s2)
'3': mix(darken(BG, 20%), _green, s3)
'4': mix(darken(BG, 40%), _green, s4)
'5': mix(darken(BG, 40%), _green, s5)
},
b5: {
'0': spin(_cyan, 0deg - 0%)
'1': spin(_cyan, 15deg - s1)
'2': spin(_cyan, 30deg - s2)
'3': mix(darken(BG, 20%), _cyan, s3)
'4': mix(darken(BG, 40%), _cyan, s4)
'5': mix(darken(BG, 40%), _cyan, s5)
},
b6: {
'0': spin(_blue, 0deg - 0%)
'1': spin(_blue, 15deg - s1)
'2': spin(_blue, 30deg - s2)
'3': mix(darken(BG, 20%), _blue, s3)
'4': mix(darken(BG, 40%), _blue, s4)
'5': mix(darken(BG, 40%), _blue, s5)
},
b7: {
'0': spin(_magenta, 0deg - 0%)
'1': spin(_magenta, 15deg - s1)
'2': spin(_magenta, 30deg - s2)
'3': mix(darken(BG, 20%), _magenta, s3)
'4': mix(darken(BG, 40%), _magenta, s4)
'5': mix(darken(BG, 40%), _magenta, s5)
},
b8: {
'0': spin(_violet, 0deg - 0%)
'1': spin(_violet, 15deg - s1)
'2': spin(_violet, 30deg - s2)
'3': mix(darken(BG, 20%), _violet, s3)
'4': mix(darken(BG, 40%), _violet, s4)
'5': mix(darken(BG, 40%), _violet, s5)
}
}
/// Generate primary variables.
for name, colors in Primary {
if (name == cg_main) {
/// Generate Stylus-lang variables.
define('bg-' + key, val, g) for key, val in C.bg
define('fg-' + key, val, g) for key, val in C.fg
define('ac-' + key, val, g) for key, val in C.ac
/// Generate Stylus-lang helpers for CSS variables.
define('bg' + key, s('var(--bg-%s)', unquote(key)), g) for key, val in C.bg
define('fg' + key, s('var(--fg-%s)', unquote(key)), g) for key, val in C.fg
define('ac' + key, s('var(--ac-%s)', unquote(key)), g) for key, val in C.ac
}
}
/// Generate secondary variables.
for name, colors in Secondary {
if (name == cg_syntax) {
/// Generate Stylus-lang variables.
define('b1-' + key, val, g) for key, val in C.b1
define('b2-' + key, val, g) for key, val in C.b2
define('b3-' + key, val, g) for key, val in C.b3
define('b4-' + key, val, g) for key, val in C.b4
define('b5-' + key, val, g) for key, val in C.b5
define('b6-' + key, val, g) for key, val in C.b6
define('b7-' + key, val, g) for key, val in C.b7
define('b8-' + key, val, g) for key, val in C.b8
/// Generate Stylus-lang helpers for CSS variables.
define('b1' + key, s('var(--b1-%s)', unquote(key)), g) for key, val in C.b1
define('b2' + key, s('var(--b2-%s)', unquote(key)), g) for key, val in C.b2
define('b3' + key, s('var(--b3-%s)', unquote(key)), g) for key, val in C.b3
define('b4' + key, s('var(--b4-%s)', unquote(key)), g) for key, val in C.b4
define('b5' + key, s('var(--b5-%s)', unquote(key)), g) for key, val in C.b5
define('b6' + key, s('var(--b6-%s)', unquote(key)), g) for key, val in C.b6
define('b7' + key, s('var(--b7-%s)', unquote(key)), g) for key, val in C.b7
define('b8' + key, s('var(--b8-%s)', unquote(key)), g) for key, val in C.b8
}
}
}
@-moz-document regexp('(https?|file|(moz|chrome)-extension)://.*') {
:root:not(#x):not(#y), .dark:not(#x):not(#y) {
/// Color generator debug.
if (cg_debug) {
primary: ' -> ' + selected
secondary: ' -> ' + selected2
p-styl-var: ' -> ' + bg-1
p-css-var: ' -> ' + bg1
s-styl-var: ' -> ' + b1-1
p-css-var: ' -> ' + b10
}
/// Generate color variables.
for _v in (bg fg ac b1 b2 b3 b4 b5 b6 b7 b8) {
for _i in 0..5 {
key = s('--%s-%s', _v, _i)
/// Escape `\` for `*-0` vars.
val = _v + \- + _i
/// Generate CSS variables.
{ key }: val i
{ key + '-rgb' }: to_rgb(val)
}
}
/// Shim for v2 variables.
--bb: _bb i
--bg: _bg i
--hl: _hl i
--bd: _bd i
--fg: _fg i
--cm: _cm i
/// Explicitly overwrite accent variable.
_ac = (ow_acvar) ? ow_ac : _ac
--ac: _ac i
/// Explicitly overwrite alt background variable.
_bb = (ow_bbvar) ? ow_bb : _bb
--bb: _bb i
/// Explicitly overwrite white variable.
_wh = (ow_whvar) ? ow_wh : _white
/// Explicitly overwrite shadow variable.
_sh = (ow_shvar) ? ow_sh : _sh
--sh: _sh i
/// Shim for v1 variables.
--dark: _bg i
--darken: _hl i
--darker: _bd i
--light: _fg i
--lighter: _cm i
--accent: _ac i
--shadow: _sh i
--red: b10 i
--orange: b20 i
--yellow: b30 i
--green: b40 i
--cyan: b50 i
--blue: b60 i
--magenta: b70 i
--violet: b80 i
--white: _wh i
/// RGB variables.
/// Shim for Dark-Instagram.
--bb-rgb: to_rgb(_bb) i
--dark-rgb: to_rgb(_bg) i
--darken-rgb: to_rgb(_hl) i
--darker-rgb: to_rgb(_bd) i
--light-rgb: to_rgb(_fg) i
--lighter-rgb: to_rgb(_cm) i
--accent-rgb: to_rgb(_ac) i
--shadow-rgb: to_rgb(_sh) i
--white-rgb: to_rgb(_wh) i
/// Shim for @RaitaroH's DeepDark variables.
if (deepdark) {
--main-color: _ac i
--main-background: _bg i
--hover-background: _bd i
--second-background: _hl i
--main-text: _fg i
--dimmer-text: _cm i
}
/// Shim for Dark-WhatsApp's intro image.
sac = (ow_acvar) ? to_svg(ow_ac) : to_svg(ac-0)
sbg = to_svg(bg-2)
_1 = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' "
_1 += "height='256' width='256'><g stroke='"
_2 = "'><path d='M128.4901 30.8659a95.4375 95.4375 0 00-95.4375 95.4375"
_2 += " 95.4375 95.4375 0 0014.168 50.0332L35.6698 221.276l44.7989-12.49"
_2 += "8a95.4375 95.4375 0 0048.0214 12.9629 95.4375 95.4375 0 0095.4375"
_2 += "-95.4375 95.4375 95.4375 0 00-95.4375-95.4375z' fill='"
_3 = "' fill-rule='evenodd' stroke-width='18' stroke-linecap='square'/>"
_3 += "<path d='M97.8104 79.8463c-4.9671.0406-13.5028 2.0796-17.7812 14."
_3 += "8946-6.8318 20.4631 12.5737 43.3028 27.2438 57.4735 14.7975 14.29"
_3 += "38 43.1559 26.507 58.0098 21.08 20.5566-8.9065 15.2475-22.9479 15"
_3 += ".2475-22.9479l-22.9727-11.0878s-2.062-1.206-3.4146.5737c-1.0042 1"
_3 += ".3213-9.4409 11.3755-9.4409 11.3755s-1.449 1.668-3.827.7402c-5.75"
_3 += "74-2.2462-14.2018-7.4856-18.5314-10.7795-6.8875-5.2399-12.957-13."
_3 += "0846-16.9473-19.668-1.2556-2.5597.6953-4.709.6953-4.709s6.0303-8."
_3 += "2629 7.0176-9.5566c1.0068-1.3194.2539-3.3633.2539-3.3633l-10.539-"
_3 += "23.2285s-2.0334-.8212-5.0138-.7969z' fill='"
_4 = "' stroke-linejoin='round'/></g></svg>"
img = s('url("%s%s%s%s%s%s%s")', unquote(_1), sac, unquote(_2), sbg,
unquote(_3), sac, unquote(_4))
/// Shim for Dark-WhatsApp's message bubbles.
if (whatsapp) {
r = to_rgb
l = lighten
--msg-in-0: (wa_msg_c) ? l(_bd, 4%) : _bd
--msg-in-0-rgb: (wa_msg_c) ? r(l(_bd, 4%)) : r(_bd)
--msg-in-1: (wa_msg_c) ? l(_bd, 9%) : l(_bd, 4%)
--msg-in-1-rgb: (wa_msg_c) ? r(l(_bd, 9%)) : r(l(_bd, 4%))
--msg-out-0: (wa_msg_c) ? l(_hl, 4%) : _hl
--msg-out-0-rgb: (wa_msg_c) ? r(l(_hl, 4%)) : r(_hl)
--msg-out-1: (wa_msg_c) ? l(_hl, 9%) : l(_hl, 4%)
--msg-out-1-rgb: (wa_msg_c) ? r(l(_hl, 9%)) : r(l(_hl, 4%))
}
/// Shim for Dark-WhatsApp's intro image.
if (wa_intro) {
--intro-image: img i
}
}
}