-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
762 lines (694 loc) · 22.1 KB
/
style.css
File metadata and controls
762 lines (694 loc) · 22.1 KB
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
/*
For optimized output that includes only what your code uses, use the Vite plugin
or Gro generator instead of importing this file directly:
import 'virtual:fuz.css'; // Vite plugin - recommended
import './fuz.css'; // Gro generator
Direct import is for utility-only mode (with theme.css) or non-bundled usage.
See: https://css.fuz.dev/docs/classes
---
Notes:
- acts as a CSS reset and also sets minimal defaults for elements with themable variables
- uses `:where` on all selectors with more specificity than a single tag/class
to lower specificity so utility classes override them -
this also means the fuz_css stylesheet is is less likely to
interfere with the page's styles regardless of where it's imported
- `.unstyled` class opts out of opinionated styling (colors, borders, decorative properties)
while keeping normalizations (font inheritance, border-collapse) -
applied to interactive elements (links, buttons, inputs, summary) and decorative containers,
but not structural elements where styling aids usability (tables) or is semantic (small)
- needs more variables
*/
*,
::before,
::after,
::backdrop {
box-sizing: border-box;
border: 0 solid;
margin: 0;
padding: 0;
}
:root,
:host {
color-scheme: light dark; /* overridden by `:root.dark` and `:root.light` added in the `head` */
background-color: var(--shade_00);
color: var(--text_color);
accent-color: var(--color_a_50);
line-height: var(--line_height_md);
font-size: 62.5%; /* see `body.font-size`, using `rem` font size units with a base 16px */
/* @source https://kilianvalkhof.com/2022/css-html/your-css-reset-needs-text-size-adjust-probably/ */
-moz-text-size-adjust: none;
-webkit-text-size-adjust: none;
text-size-adjust: none;
-webkit-tap-highlight-color: transparent;
}
:root.dark {
color-scheme: dark;
}
:root.light {
color-scheme: light;
}
body {
min-height: 100vh;
font-size: 1.6rem; /* matched to `font-size: 62.5%` and same value as the default `--font_size_md`, but this one shouldn't vary */
font-family: var(--font_family_sans);
tab-size: 2; /* TODO var */
}
::selection {
background-color: hsl(var(--hue_a) 90% 80% / 40%);
}
::placeholder {
opacity: 1;
color: color-mix(in oklab, currentcolor 50%, transparent);
}
::file-selector-button {
font: inherit;
cursor: pointer;
}
/*
Keep hidden behavior when `display` is set.
The `!important` makes this `hidden` behavior much higher specificity.
Respects `hidden="until-found"` for find-in-page support.
@source https://github.com/jensimmons/cssremedy
*/
[hidden]:where(:not([hidden='until-found'])) {
display: none !important;
}
@media (prefers-reduced-motion) {
:root {
/* setting to `initial` disables animations but allows for fallbacks (see PendingAnimation) */
--duration_6: initial;
--duration_5: initial;
--duration_4: initial;
--duration_3: initial;
--duration_2: initial;
--duration_1: initial;
}
}
:where(a:not(.unstyled)) {
cursor: pointer;
/* TODO should the generic be --link_color or --color? */
--text_color: var(--link_color);
color: var(--text_color);
font-weight: 700;
text-decoration: var(--text_decoration);
border-radius: var(--border_radius, var(--border_radius_xs3));
outline: var(--outline_width) var(--outline_style) var(--outline_color);
}
/* TODO should these be customizable with utility classes? */
:where(a:not(.unstyled):hover) {
text-decoration: var(--text_decoration_hover);
}
:where(a:not(.unstyled):focus) {
--outline_width: var(--outline_width_focus);
}
:where(a:not(.unstyled):active) {
--outline_width: var(--outline_width_active);
}
:where(a:not(.unstyled).selected) {
--text_color: var(--link_color_selected);
--outline_color: var(--border_color);
text-decoration: var(--text_decoration_selected);
}
:where(a:not(.unstyled).selected:active) {
--outline_color: var(--border_color);
}
:where(:is(ul, ol, menu):not(.unstyled)) {
padding-left: var(--space_xl4);
}
:where(.unstyled:is(ul, ol, menu)) {
list-style: none;
}
:where(:is(h1, h2, h3, h4, h5, h6, .heading):not(.unstyled)) {
font-family: var(--font_family_serif);
font-size: var(--font_size, inherit);
line-height: var(--line_height_sm);
text-wrap: balance; /* @see https://developer.mozilla.org/en-US/docs/Web/CSS/text-wrap#balance */
/* TODO use this pattern elsewhere? provides API to components like `MdnLogo` */
overflow-wrap: break-word; /* TODO @many is this best? `anywhere` instead? what about adding elsewhere? */
}
/* heading margins use calc multipliers on --flow_margin so they scale proportionally
with .sm while preserving hierarchy. multipliers are derived from the space
scale (sqrt(GR) ≈ 1.272 per step). margin-top is 2 steps above margin-bottom. */
:where(h1:not(.unstyled)) {
--font_size: var(--font_size_xl3);
font-weight: 300;
margin-bottom: calc(var(--flow_margin, var(--space_lg)) * 3.23);
/* somewhat strange to omit only this one, but generally seems to be the desired behavior */
/* margin-top: calc(var(--flow_margin, var(--space_lg)) * 5.28); */
}
:where(h2:not(.unstyled)) {
--font_size: var(--font_size_xl2);
font-weight: 400;
margin-bottom: calc(var(--flow_margin, var(--space_lg)) * 2.54);
margin-top: calc(var(--flow_margin, var(--space_lg)) * 4.15);
}
:where(h3:not(.unstyled)) {
--font_size: var(--font_size_xl);
font-weight: 500;
margin-bottom: calc(var(--flow_margin, var(--space_lg)) * 2);
margin-top: calc(var(--flow_margin, var(--space_lg)) * 3.23);
}
:where(h4:not(.unstyled)) {
--font_size: var(--font_size_lg);
font-weight: 700;
margin-bottom: calc(var(--flow_margin, var(--space_lg)) * 1.62);
margin-top: calc(var(--flow_margin, var(--space_lg)) * 2.54);
}
:where(h5:not(.unstyled)) {
--font_size: var(--font_size_md);
font-weight: 900;
margin-bottom: calc(var(--flow_margin, var(--space_lg)) * 1.23);
margin-top: calc(var(--flow_margin, var(--space_lg)) * 2);
}
:where(h6:not(.unstyled)) {
--font_size: var(--font_size_sm);
font-weight: 600;
margin-bottom: var(--flow_margin, var(--space_lg));
margin-top: calc(var(--flow_margin, var(--space_lg)) * 1.62);
text-transform: uppercase;
}
:where(p) {
overflow-wrap: break-word; /* TODO @many is this best? `anywhere` instead? what about adding elsewhere? */
}
/*
TODO remove the :last-child here and elsewhere when margin-trim is fully supported,
currently can break based on DOM structure - https://developer.mozilla.org/en-US/docs/Web/CSS/margin-trim
*/
/* TODO other elements */
/* checkboxes and radios are expected to be nested inside a `label`, thus no bottom margin */
:where(
:is(
p,
ul,
ol,
menu,
form,
fieldset,
table,
details,
textarea,
select,
label,
pre,
blockquote,
aside,
nav,
legend
):not(:last-child):not(.unstyled)
) {
margin-bottom: var(--flow_margin, var(--space_lg));
}
:where(section:not(:last-child)) {
margin-bottom: var(--space_xl7);
}
/* Horizontal flex layout containers reset flow margins on direct children; use `.gap_*`. */
:where(.row > *) {
margin: 0;
}
:where(aside:not(.unstyled)) {
border-left-color: var(--border_color);
border-left-style: var(--border_style);
border-left-width: var(--border_width_3);
border-radius: var(--border_radius, var(--border_radius_xs));
padding: var(--space_md);
color: var(--text_color);
background-color: var(--fg_10);
}
:where(blockquote:not(.unstyled)) {
border-left-color: var(--border_color);
border-left-style: var(--border_style);
border-left-width: var(--border_width_8);
padding: var(--space_md);
color: var(--text_color);
}
:where(code:not(.unstyled)) {
white-space: pre-wrap;
font-family: var(--font_family_mono);
-webkit-hyphens: none;
hyphens: none;
color: var(--text_color);
background-color: var(--fg_05);
padding: 0 var(--space_xs2);
border-radius: var(--border_radius, var(--border_radius_xs));
}
:where(code.inline, p code) {
display: inline-block;
vertical-align: baseline;
}
:where(pre:not(.unstyled)) {
font-family: var(--font_family_mono);
color: var(--text_color);
white-space: pre;
overflow: auto;
max-width: 100%;
}
:where(hr:not(.unstyled)) {
border-top: 1px solid var(--border_color_30);
border-bottom: 2px solid var(--border_color_30);
border-left: none;
border-right: none;
width: 100%;
height: 5px;
margin: var(--space_xl7) 0;
}
:where(fieldset:not(.unstyled)) {
display: flex;
flex-direction: column;
}
:where(fieldset) {
/* TODO consider a global border reset */
border: 0;
}
:where(legend:not(.unstyled)) {
font-size: var(--font_size_lg);
}
/* normalization - keep font inheritance even for unstyled */
:where(input, textarea, select) {
font: inherit;
}
:where(:is(input, textarea, select):not(.unstyled)) {
appearance: none;
line-height: normal;
display: block;
color: var(--text_color);
background-color: var(--input_fill);
border-color: var(--border_color);
border-style: var(--border_style);
border-width: var(--border_width);
border-radius: var(--border_radius, var(--border_radius_sm));
/* TODO --outline_color should default to --hue when available, but can't be set above */
outline: var(--outline_width) var(--outline_style) var(--outline_color);
padding: var(--input_padding_y) var(--input_padding_x);
width: 100%;
min-width: var(--input_width_min);
min-height: var(--input_height);
}
:where(textarea:not(.unstyled)) {
--input_padding_y: var(--space_sm);
height: 100px;
resize: vertical;
}
:where(:is(select, option, input[type='color']):not(:disabled)) {
cursor: pointer;
}
:where(option:not(.unstyled)) {
color: var(--text_color);
background-color: var(--shade_00);
}
:where(:is(input, textarea, select):not(.unstyled):hover) {
--border_color: var(--border_color_20);
}
/* these have no active states because they feel buggy in the browsers,
because the active state only applies when the thumb is clicked directly,
but not for the identical user action of clicking the track,
so for consistent visuals we opt to include no active state */
:where(input[type='checkbox']:not(.unstyled)) {
cursor: pointer;
width: var(--input_height_sm);
height: var(--input_height_sm);
min-width: var(--input_height_sm);
min-height: var(--input_height_sm);
border-radius: var(--border_radius, var(--border_radius_xs));
--input_padding_x: 0;
--checkbox_content: var(--checkbox_content_empty, '');
}
:where(input[type='checkbox']:not(.unstyled):checked) {
--checkbox_content: var(--checkbox_content_checked, '✓'); /* ✔✓ ✗ ✘ */
}
:where(input[type='checkbox']:not(.unstyled))::before {
content: var(--checkbox_content);
position: relative;
left: var(--left);
top: var(--top);
width: 100%;
height: 100%;
text-align: center;
line-height: normal;
display: flex;
align-items: center;
justify-content: center;
overflow: var(--overflow, visible);
font-size: var(--font_size, var(--font_size_xl3));
color: var(--text_color);
}
:where(input[type='radio']:not(.unstyled)) {
cursor: pointer;
width: var(--input_height_sm);
height: var(--input_height_sm);
border-radius: 50%;
min-width: var(--input_height_sm);
min-height: var(--input_height_sm);
--input_padding_x: 0;
}
:where(input[type='radio']:not(.unstyled):checked)::before {
content: '';
display: block;
position: relative;
top: 25%;
left: 25%;
width: 50%;
height: 50%;
background-color: var(--text_color);
border-radius: 50%;
}
/* TODO @many figure these variables out so they're easily customized (similar pattern in a lot of places) */
:where(input[type='range']:not(.unstyled)) {
--thumb_size: var(--space_xl);
--thumb_background_color: var(--text_70);
cursor: pointer;
}
:where(input[type='range']:not(.unstyled):hover:not(:disabled)) {
--thumb_background_color: var(--color_a_50);
}
:where(input[type='range']:not(.unstyled):disabled:active) {
--thumb_background_color: var(--color_c_50);
}
:where(input[type='range']:not(.unstyled))::-webkit-slider-thumb {
appearance: none;
height: var(--thumb_size);
width: var(--thumb_size);
border-radius: 50%;
background-color: var(--thumb_background_color);
border: 0;
/*
this is the only line that differs between the `moz` one
CSS stops parsing if it hits an unknown selector like `::-moz-range-thumb` in Webkit/Blink,
so we need both declarations anyway, and the declarations can't be combined with plain CSS,
one of the few times I've wanted to reach for PostCSS
*/
margin-top: calc(var(--thumb_size) / -2);
}
:where(input[type='range']:not(.unstyled))::-moz-range-thumb {
appearance: none;
height: var(--thumb_size);
width: var(--thumb_size);
border-radius: 50%;
background-color: var(--thumb_background_color);
border: 0;
}
:where(input[type='range']:not(.unstyled))::-webkit-slider-runnable-track {
width: 100%;
height: var(--border_width);
background-color: var(--thumb_background_color);
}
:where(input[type='range']:not(.unstyled))::-moz-range-track {
width: 100%;
height: var(--border_width);
background-color: var(--thumb_background_color);
}
/* TODO :has selector? `button:has(input[type='checkbox']:checked)`
see https://caniuse.com/css-has
*/
:where(input:not(.unstyled):checked:not(:disabled)) {
--text_color: var(--color_a_50);
--border_color: var(--color_a_50);
}
:where(input[type='radio']:not(.unstyled):checked) {
cursor: default;
}
:where(
:is(input, textarea, select):not(.unstyled).inline,
p :is(input, textarea, select):not(.unstyled)
) {
display: inline-block;
margin-left: var(--space_lg);
/* TODO ideally `width` here would be set to a minimum and have an API to increase size --
buttons can grow automatically, but how can inputs? only with js?
*/
width: var(--input_width_min);
}
:where(:is(input, textarea, select):not(.unstyled):disabled) {
/* TODO ideally these would just set `fill`, but they'd have to go after the button variants, and then duplicate selectors? */
--input_fill: transparent;
--border_style: solid dashed;
opacity: var(--disabled_opacity);
outline: none;
}
:where([contenteditable]:not(.unstyled):focus-visible) {
--outline_width: var(--outline_width_focus);
outline: var(--outline_width) var(--outline_style) var(--outline_color);
}
:where(:is(input, textarea, select, [contenteditable]):not(.unstyled):active) {
--outline_width: var(--outline_width_active);
}
/* TODO could improve this with the coming `:has` selector
for disabled colors without needing a wrapper .disabled class */
:where(label:not(.unstyled)) {
display: block;
color: var(--text_color);
cursor: pointer;
}
:where(:is(label:not(.unstyled) .title)) {
font-weight: 600;
margin-bottom: var(--space_xs2);
}
:where(label.selected:not(.unstyled)) {
cursor: default;
--text_color: var(--color_a_50);
}
:where(label.disabled:not(.unstyled)) {
cursor: default;
--text_color: var(--text_disabled);
}
:where(label.row:not(.unstyled)) {
justify-content: flex-start;
}
:where(label.row:not(.unstyled) :is(input[type='checkbox'], input[type='radio']):not(.unstyled)) {
margin-right: var(--space_md);
}
/*
TODO think through these patterns to get somewhere consistent
- declaring variables with variants like `_hover` enables simpler theming, so you don't have to write complex selectors and can just change a variable
- should the variants therefore be changed to style variables or inlined here?
- inlining them here avoids the overhead of variables, but is that optimizable anyway? are there added costs in theory that aren't avoidable?
- but these need to be resolved locally to get overrides, couldn't set `fill` for example - can you use a variable still though, just also locally declare it?
*/
:where(button:not(.unstyled)) {
--min_height: var(--input_height);
--text_color: var(--text_70);
--button_text_color: var(--text_color);
--button_fill: color-mix(in hsl, var(--fill, var(--shade_50)) 8%, transparent);
--button_fill_hover: color-mix(in hsl, var(--fill, var(--shade_50)) 16%, transparent);
--button_fill_active: color-mix(in hsl, var(--fill, var(--shade_50)) 24%, transparent);
--button_border_color: var(--border_color);
/* TODO give real values, 90%? */
--button_border_color_hover: color-mix(in hsl, var(--border_color) 90%, var(--shade_max));
--button_border_color_active: color-mix(in hsl, var(--border_color) 80%, var(--shade_max));
color: var(--button_text_color);
background-color: var(--button_fill);
cursor: pointer;
appearance: none;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
font: inherit;
font-size: var(--font_size, inherit);
font-weight: 700;
line-height: normal;
min-height: var(--min_height);
padding: 0 var(--input_padding_x);
box-shadow: var(--shadow, var(--button_shadow));
border-width: var(--border_width);
border-style: var(--border_style);
border-color: var(--button_border_color);
border-radius: var(--border_radius, var(--border_radius_sm));
outline: var(--outline_width) var(--outline_style) var(--outline_color);
}
:where(:is(button, input, textarea, select):not(.unstyled):focus) {
--border_color: var(--color_a_50);
--outline_width: var(--outline_width_focus);
}
/* TODO maybe gradients? or at least use a text_color */
/* TODO hover variants with brighter borders? maybe use a colorless border for that? */
:where(button:not(.unstyled).color_a) {
--text_color: var(--color_a_50);
--fill: var(--color_a_40);
--border_color: var(--color_a_50);
--outline_color: var(--color_a_50);
}
:where(button:not(.unstyled).color_b) {
--text_color: var(--color_b_50);
--fill: var(--color_b_40);
--border_color: var(--color_b_50);
--outline_color: var(--color_b_50);
}
:where(button:not(.unstyled).color_c) {
--text_color: var(--color_c_50);
--fill: var(--color_c_40);
--border_color: var(--color_c_50);
--outline_color: var(--color_c_50);
}
:where(button:not(.unstyled).color_d) {
--text_color: var(--color_d_50);
--fill: var(--color_d_40);
--border_color: var(--color_d_50);
--outline_color: var(--color_d_50);
}
:where(button:not(.unstyled).color_e) {
--text_color: var(--color_e_50);
--fill: var(--color_e_40);
--border_color: var(--color_e_50);
--outline_color: var(--color_e_50);
}
:where(button:not(.unstyled).color_f) {
--text_color: var(--color_f_50);
--fill: var(--color_f_40);
--border_color: var(--color_f_50);
--outline_color: var(--color_f_50);
}
:where(button:not(.unstyled).color_g) {
--text_color: var(--color_g_50);
--fill: var(--color_g_40);
--border_color: var(--color_g_50);
--outline_color: var(--color_g_50);
}
:where(button:not(.unstyled).color_h) {
--text_color: var(--color_h_50);
--fill: var(--color_h_40);
--border_color: var(--color_h_50);
--outline_color: var(--color_h_50);
}
:where(button:not(.unstyled).color_i) {
--text_color: var(--color_i_50);
--fill: var(--color_i_40);
--border_color: var(--color_i_50);
--outline_color: var(--color_i_50);
}
:where(button:not(.unstyled).color_j) {
--text_color: var(--color_j_50);
--fill: var(--color_j_40);
--border_color: var(--color_j_50);
--outline_color: var(--color_j_50);
}
/* TODO try to rearrange some of this to go after the colored variants */
:where(button:not(.unstyled):disabled) {
/* TODO ideally these would just set `fill`, but they'd have to go after the button variants, and then duplicate selectors? */
--button_fill: transparent;
--border_style: solid dashed;
cursor: default;
box-shadow: none;
opacity: var(--disabled_opacity);
outline: none;
}
:where(button:not(.unstyled).selected) {
--button_text_color: var(--text_05);
--button_fill: var(--fill, var(--shade_50));
--button_fill_hover: var(--fill, var(--shade_50));
--button_fill_active: var(--fill, var(--shade_50));
--button_border_color: var(--border_color);
}
:where(button:not(.unstyled).selected:not(.deselectable)) {
--button_border_color_hover: var(--border_color);
--button_border_color_active: var(--border_color);
cursor: default;
box-shadow: none;
}
:where(button:not(.unstyled):not(:disabled):hover, button:not(.unstyled):focus) {
--button_fill: var(--button_fill_hover);
--button_border_color: var(--button_border_color_hover);
--shadow: var(--button_shadow_hover);
}
:where(button:not(.unstyled):not(.selected):not(:disabled):hover) {
/* TODO or set a hover var? make consistent with fill */
--button_border_color: var(--button_border_color_hover);
--button_text_color: color-mix(in hsl, var(--text_color) 90%, var(--shade_max));
}
:where(button:not(.unstyled).selected.deselectable:not(:disabled):hover) {
--button_text_color: var(--shade_min);
}
:where(button:not(.unstyled):not(:disabled):active) {
--button_fill: var(--button_fill_active);
--button_border_color: var(--button_border_color_active);
--outline_width: var(--outline_width_active);
--shadow: var(--button_shadow_active);
}
:where(
:is(input, textarea, select, button):not(.unstyled):disabled:active,
label:not(.unstyled).disabled:active
) {
--text_color: var(--color_c_50);
--border_color: var(--color_c_50);
}
/* TODO is there a cleaner way to override these through vars? */
:where(button:not(.unstyled).selected:disabled:active) {
--text_color: var(--text_10);
--fill: var(--color_c_40);
}
:where(button:not(.unstyled):not(.selected):disabled:active) {
--fill: transparent;
}
:where(button:not(.unstyled).selected:not(.deselectable):active) {
--outline_width: var(--outline_width_focus);
}
:where(button:not(.unstyled).inline, p button:not(.unstyled)) {
display: inline-block;
--min_height: var(--input_height_sm); /* TODO this increases paragraph line spacing */
}
:where(small) {
font-size: var(--font_size_sm);
}
:where(img, picture, canvas, svg, video) {
display: block;
max-width: 100%; /* shrink to fit */
height: auto; /* preserve aspect ratio */
}
:where(audio) {
width: 100%;
}
:where(summary:not(.unstyled)) {
cursor: pointer;
padding: var(--space_md);
border-radius: var(--border_radius, var(--border_radius_xs));
}
:where(summary:hover:not(.unstyled)) {
background-color: var(--fg_10);
}
:where(summary:active:not(.unstyled)) {
background-color: var(--fg_20);
}
:where(details[open] summary:not(.unstyled)) {
margin-bottom: var(--space_sm);
}
:where(table) {
border-collapse: collapse;
}
:where(thead) {
text-align: left;
}
:where(th) {
font-weight: bold;
}
:where(th, td) {
padding: var(--space_xs3) var(--space_sm);
}
:where(tr) {
border-bottom: 1px solid var(--border_color_10);
}
:where(tr:hover) {
background-color: var(--fg_10);
}
:where(abbr[title]) {
text-decoration: underline dotted;
}
:where(b, strong) {
font-weight: bolder;
}
:where(kbd, samp) {
font-family: var(--font_family_mono);
}
:where(sub, sup) {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
:where(sub) {
bottom: -0.25em;
}
:where(sup) {
top: -0.5em;
}
:where(progress) {
vertical-align: baseline;
}