forked from ankitects/anki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_vars.scss
473 lines (467 loc) · 14.1 KB
/
_vars.scss
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
/* Copyright: Ankitects Pty Ltd and contributors
* License: GNU AGPL, version 3 or later, http://www.gnu.org/licenses/agpl.html */
@use "sass:map";
@use "sass:color";
@use "functions" as *;
@use "color-palette" as *;
@function palette($key, $shade) {
$color: map.get($color-palette, $key);
@return map.get($color, $shade);
}
$vars: (
props: (
font: (
size: (
default: 15px,
),
),
border-radius: (
default: (
"Used to round corners of various UI elements",
(
default: 5px,
),
),
medium: (
"Used for container corners",
(
default: 12px,
),
),
large: (
"Used for pill-shaped buttons",
(
default: 15px,
),
),
),
transition: (
default: (
"Default duration of transitions in milliseconds",
(
default: 180ms,
),
),
medium: (
"Slightly longer transition duration in milliseconds",
(
default: 500ms,
),
),
slow: (
"Long transition duration in milliseconds",
(
default: 1000ms,
),
),
),
blur: (
default: (
"Default background blur value",
(
default: 20px,
)
)
)
),
colors: (
fg: (
default: (
"Default text/icon color",
(
light: palette(darkgray, 9),
dark: palette(lightgray, 0),
),
),
subtle: (
"Placeholder text, icons in idle state",
(
light: palette(darkgray, 0),
dark: palette(lightgray, 9),
),
),
disabled: (
"Foreground color of disabled UI elements",
(
light: palette(lightgray, 9),
dark: palette(darkgray, 0),
),
),
faint: (
"Foreground color that barely stands out against canvas",
(
light: palette(lightgray, 7),
dark: palette(darkgray, 2),
),
),
link: (
"Hyperlink foreground color",
(
light: palette(blue, 7),
dark: palette(blue, 2),
),
),
),
canvas: (
default: (
"Window background",
(
light: palette(lightgray, 2),
dark: palette(darkgray, 5),
),
),
elevated: (
"Background of containers",
(
light: white,
dark: palette(darkgray, 4),
),
),
inset: (
"Background of inputs inside containers",
(
light: white,
dark: palette(darkgray, 5),
),
),
overlay: (
"Background of floating elements (menus, tooltips)",
(
light: palette(lightgray, 0),
dark: palette(darkgray, 5),
),
),
code: (
"Background of code editors",
(
light: white,
dark: palette(darkgray, 6),
),
),
glass: (
"Transparent background for surfaces containing text",
(
light: color.scale(white, $alpha: -60%),
dark: color.scale(palette(darkgray, 4), $alpha: -60%),
),
),
),
border: (
default: (
"Border color with medium contrast against window background",
(
light: palette(lightgray, 6),
dark: palette(darkgray, 7),
),
),
subtle: (
"Border color with low contrast against window background",
(
light: palette(lightgray, 4),
dark: palette(darkgray, 6),
),
),
strong: (
"Border color with high contrast against window background",
(
light: palette(lightgray, 9),
dark: palette(darkgray, 9),
),
),
focus: (
"Border color of focused input elements",
(
light: palette(blue, 5),
dark: palette(blue, 5),
),
),
),
button: (
bg: (
"Background color of buttons",
(
light: palette(lightgray, 0),
dark: color.scale(palette(darkgray, 4), $lightness: 5%),
),
),
gradient: (
start: (
"Start value of default button gradient",
(
light: white,
dark: color.scale(palette(darkgray, 4), $lightness: 10%),
),
),
end: (
"End value of default button gradient",
(
light: palette(lightgray, 0),
dark: color.scale(palette(darkgray, 4), $lightness: 5%),
),
),
),
hover: (
border: (
"Border color of default button in hover state",
(
light: palette(lightgray, 8),
dark: palette(darkgray, 8),
),
),
),
disabled: (
"Background color of disabled button",
(
light: color.scale(palette(lightgray, 5), $alpha: -50%),
dark: color.scale(palette(darkgray, 3), $alpha: -50%),
),
),
primary: (
bg: (
"Background color of primary button",
(
light: color.scale(palette(blue, 6), $lightness: 5%),
dark: color.scale(palette(blue, 7), $saturation: -10%),
),
),
gradient: (
start: (
"Start value of primary button gradient",
(
light: palette(blue, 5),
dark: color.scale(palette(blue, 6), $saturation: -10%),
),
),
end: (
"End value of primary button gradient",
(
light: color.scale(palette(blue, 6), $lightness: 5%),
dark: color.scale(palette(blue, 7), $saturation: -10%),
),
),
),
disabled: (
"Background color of primary button in disabled state",
(
light: palette(blue, 3),
dark: color.scale(palette(blue, 5), $saturation: -10%),
),
),
),
),
scrollbar: (
bg: (
default: (
"Background of scrollbar in idle state (Win/Lin only)",
(
light: palette(lightgray, 5),
dark: palette(darkgray, 3),
),
),
hover: (
"Background of scrollbar in hover state (Win/Lin only)",
(
light: palette(lightgray, 6),
dark: palette(darkgray, 2),
),
),
active: (
"Background of scrollbar in pressed state (Win/Lin only)",
(
light: palette(lightgray, 7),
dark: palette(darkgray, 1),
),
),
),
),
shadow: (
default: (
"Default box-shadow color",
(
light: palette(lightgray, 6),
dark: palette(darkgray, 8),
),
),
inset: (
"Inset box-shadow color",
(
light: palette(darkgray, 3),
dark: palette(darkgray, 7),
),
),
subtle: (
"Box-shadow color with lower contrast against window background",
(
light: palette(darkgray, 0),
dark: palette(darkgray, 4),
),
),
focus: (
"Box-shadow color for elements in focused state",
(
default: palette(indigo, 5),
),
),
),
accent: (
card: (
"Accent color for cards",
(
light: palette(blue, 4),
dark: palette(blue, 3),
),
),
note: (
"Accent color for notes",
(
light: palette(green, 5),
dark: palette(green, 4),
),
),
danger: (
"Saturated accent color to grab attention",
(
light: palette(red, 5),
dark: palette(red, 4),
),
),
),
flag: (
1: (
"Flag 1 (red)",
(
light: palette(red, 5),
dark: palette(red, 4),
),
),
2: (
"Flag 2 (orange)",
(
light: palette(orange, 4),
dark: palette(orange, 3),
),
),
3: (
"Flag 3 (green)",
(
light: palette(green, 4),
dark: palette(green, 3),
),
),
4: (
"Flag 4 (blue)",
(
light: palette(blue, 5),
dark: palette(blue, 4),
),
),
5: (
"Flag 5 (pink)",
(
light: palette(fuchsia, 4),
dark: palette(fuchsia, 3),
),
),
6: (
"Flag 6 (turquoise)",
(
light: palette(teal, 4),
dark: palette(teal, 3),
),
),
7: (
"Flag 7 (purple)",
(
light: palette(purple, 5),
dark: palette(purple, 4),
),
),
),
state: (
new: (
"Accent color for new cards",
(
light: palette(blue, 5),
dark: palette(blue, 3),
),
),
learn: (
"Accent color for cards in learning state",
(
light: palette(red, 6),
dark: palette(red, 4),
),
),
review: (
"Accent color for cards in review state",
(
light: palette(green, 6),
dark: palette(green, 5),
),
),
buried: (
"Accent color for buried cards",
(
light: palette(amber, 5),
dark: palette(amber, 8),
),
),
suspended: (
"Accent color for suspended cards",
(
light: palette(yellow, 4),
dark: palette(yellow, 1),
),
),
marked: (
"Accent color for marked cards",
(
light: palette(indigo, 5),
dark: palette(purple, 5),
),
),
),
highlight: (
bg: (
"Background color of highlighted items",
(
light: color.scale(palette(blue, 6), $alpha: -50%),
dark: color.scale(palette(blue, 3), $alpha: -50%),
),
),
fg: (
"Foreground color of highlighted items",
(
light: black,
dark: white,
),
),
),
selected: (
bg: (
"Background color of selected text",
(
light: color.scale(palette(lightgray, 5), $alpha: -50%),
dark: color.scale(palette(blue, 3), $alpha: -50%),
),
),
fg: (
"Foreground color of selected text",
(
light: black,
dark: white,
),
),
),
),
);
@function prop($keyword) {
@return var(--#{$keyword});
}
@function color($keyword) {
@return var(--#{$keyword});
}
@function palette-of($keyword, $theme: default) {
$colors: map.get($vars, colors);
@return get-value-from-map($colors, $keyword, $theme);
}