contain-css-svelte 1.4.1 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Card.svelte +25 -0
- package/dist/controls/Button.svelte +43 -18
- package/dist/controls/ButtonLink.svelte +31 -92
- package/dist/controls/Checkbox.svelte +34 -4
- package/dist/controls/CircleButton.svelte +36 -95
- package/dist/controls/Input.svelte +25 -0
- package/dist/controls/RadioButton.svelte +27 -2
- package/dist/controls/Select.svelte +25 -0
- package/dist/controls/Slider.svelte +25 -0
- package/dist/controls/TabItem.svelte +25 -0
- package/dist/controls/Toggle.svelte +27 -2
- package/dist/dropdowns/DropdownMenu.svelte +60 -6
- package/dist/layout/Accordion.svelte +28 -3
- package/dist/layout/Bar.svelte +25 -0
- package/dist/layout/ColumnContainer.svelte +25 -0
- package/dist/layout/Columns.svelte +25 -0
- package/dist/layout/Container.svelte +25 -0
- package/dist/layout/DataList.svelte +25 -0
- package/dist/layout/DataListItem.svelte +28 -3
- package/dist/layout/Fieldset.svelte +25 -0
- package/dist/layout/Form.svelte +25 -0
- package/dist/layout/FormItem.svelte +25 -0
- package/dist/layout/GridLayout.svelte +25 -0
- package/dist/layout/Hero.svelte +35 -0
- package/dist/layout/Inline.svelte +25 -0
- package/dist/layout/MenuList.svelte +36 -11
- package/dist/layout/Page.svelte +25 -0
- package/dist/layout/RowContainer.svelte +25 -0
- package/dist/layout/Sidebar.svelte +31 -6
- package/dist/layout/SidebarContainer.svelte +25 -0
- package/dist/layout/SplitPane.svelte +25 -0
- package/dist/layout/Stack.svelte +25 -0
- package/dist/layout/TabBar.svelte +25 -0
- package/dist/layout/Table.svelte +75 -10
- package/dist/layout/Tile.svelte +28 -3
- package/dist/misc/CodeInner.svelte +49 -22
- package/dist/misc/Progress.svelte +25 -0
- package/dist/misc/Tag.svelte +25 -0
- package/dist/overlays/Dialog.svelte +58 -0
- package/dist/overlays/Tooltip.svelte +57 -1
- package/dist/sass/_affordances.scss +10 -4
- package/dist/sass/_typography.scss +53 -0
- package/dist/typography/TextLayout.svelte +25 -0
- package/dist/vars/affordances.css +9 -4
- package/dist/vars/code.css +12 -0
- package/dist/vars/colors.css +39 -18
- package/dist/vars/defaults.css +60 -22
- package/dist/vars/themes/dark.css +3 -3
- package/dist/vars/themes/light.css +34 -31
- package/package.json +1 -1
package/dist/Card.svelte
CHANGED
|
@@ -67,6 +67,31 @@ let hasFooter = $derived(Boolean(footer));
|
|
|
67
67
|
text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
|
|
68
68
|
has to happen where the real element is, in the global consumer rule; only
|
|
69
69
|
the VALUES move to context vars here. */
|
|
70
|
+
/* Text reset for an overlay's root element: a tooltip, popover menu or dialog
|
|
71
|
+
that sits in the DOM wherever its trigger was placed.
|
|
72
|
+
|
|
73
|
+
The top layer changes how an element paints and where it is positioned, not
|
|
74
|
+
what it inherits. A popover declared inside a `white-space: nowrap` table
|
|
75
|
+
cell is nowrap too, and one inside a bold, uppercase, centred header is
|
|
76
|
+
bold, uppercase and centred -- styles that belong to the trigger's context,
|
|
77
|
+
not to the overlay. typography-props() doesn't stop that: its chains end in
|
|
78
|
+
`unset`, which for an inherited property means "take the parent's value".
|
|
79
|
+
|
|
80
|
+
So this re-declares every inherited text property with a real default at
|
|
81
|
+
the end of the same variable chain. The vars still win (--tooltip-*, then
|
|
82
|
+
the category, then the global), and custom properties still inherit --
|
|
83
|
+
that is how theming reaches an overlay -- but when nothing is set, the
|
|
84
|
+
overlay gets its own defaults instead of its host's.
|
|
85
|
+
|
|
86
|
+
INCLUDE IT AFTER typography-props() / typography-container-props() in the
|
|
87
|
+
same rule: it has to beat their `unset` fallbacks by source order.
|
|
88
|
+
|
|
89
|
+
Deliberately left inheriting:
|
|
90
|
+
- direction, writing-mode: the document's script direction is the
|
|
91
|
+
overlay's too.
|
|
92
|
+
- visibility: a hidden subtree should not be able to show an overlay.
|
|
93
|
+
- font-family: every theme defines --font-family at :root, and there is no
|
|
94
|
+
neutral value to fall back to that would beat "the page's font". */
|
|
70
95
|
/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
|
|
71
96
|
one value (both sides equal) or two (start end), so there is no separate
|
|
72
97
|
"which side" prop to remember and no 4-value shorthand order to get wrong.
|
|
@@ -62,6 +62,31 @@ const el = $derived(elementProps(restProps, "button", [
|
|
|
62
62
|
text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
|
|
63
63
|
has to happen where the real element is, in the global consumer rule; only
|
|
64
64
|
the VALUES move to context vars here. */
|
|
65
|
+
/* Text reset for an overlay's root element: a tooltip, popover menu or dialog
|
|
66
|
+
that sits in the DOM wherever its trigger was placed.
|
|
67
|
+
|
|
68
|
+
The top layer changes how an element paints and where it is positioned, not
|
|
69
|
+
what it inherits. A popover declared inside a `white-space: nowrap` table
|
|
70
|
+
cell is nowrap too, and one inside a bold, uppercase, centred header is
|
|
71
|
+
bold, uppercase and centred -- styles that belong to the trigger's context,
|
|
72
|
+
not to the overlay. typography-props() doesn't stop that: its chains end in
|
|
73
|
+
`unset`, which for an inherited property means "take the parent's value".
|
|
74
|
+
|
|
75
|
+
So this re-declares every inherited text property with a real default at
|
|
76
|
+
the end of the same variable chain. The vars still win (--tooltip-*, then
|
|
77
|
+
the category, then the global), and custom properties still inherit --
|
|
78
|
+
that is how theming reaches an overlay -- but when nothing is set, the
|
|
79
|
+
overlay gets its own defaults instead of its host's.
|
|
80
|
+
|
|
81
|
+
INCLUDE IT AFTER typography-props() / typography-container-props() in the
|
|
82
|
+
same rule: it has to beat their `unset` fallbacks by source order.
|
|
83
|
+
|
|
84
|
+
Deliberately left inheriting:
|
|
85
|
+
- direction, writing-mode: the document's script direction is the
|
|
86
|
+
overlay's too.
|
|
87
|
+
- visibility: a hidden subtree should not be able to show an overlay.
|
|
88
|
+
- font-family: every theme defines --font-family at :root, and there is no
|
|
89
|
+
neutral value to fall back to that would beat "the page's font". */
|
|
65
90
|
/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
|
|
66
91
|
one value (both sides equal) or two (start end), so there is no separate
|
|
67
92
|
"which side" prop to remember and no 4-value shorthand order to get wrong.
|
|
@@ -224,14 +249,14 @@ button:hover {
|
|
|
224
249
|
filter: var(--button-hover-filter, var(--clickable-hover-filter, var(--hover-filter, brightness(1.05))));
|
|
225
250
|
transform: var(--button-hover-transform, var(--clickable-hover-transform, var(--hover-transform, none)));
|
|
226
251
|
color: var(--_color);
|
|
227
|
-
background-color: color-mix(in
|
|
252
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--hover-base-color-percentage, 90%), var(--hover-color-mix, var(--_color, white)) calc(100% - var(--hover-base-color-percentage, 90%)));
|
|
228
253
|
box-shadow: var(--button-hover-box-shadow, var(--clickable-hover-box-shadow, var(--hover-box-shadow, var(--_box-shadow, none))));
|
|
229
254
|
}
|
|
230
255
|
|
|
231
256
|
button:active {
|
|
232
257
|
filter: var(--button-active-filter, var(--clickable-active-filter, var(--active-filter, brightness(0.9))));
|
|
233
258
|
transform: var(--button-active-transform, var(--clickable-active-transform, var(--active-transform, none)));
|
|
234
|
-
background-color: color-mix(in
|
|
259
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--active-base-color-percentage, 90%), var(--active-color-mix, black) calc(100% - var(--active-base-color-percentage, 90%)));
|
|
235
260
|
box-shadow: var(--button-active-box-shadow, var(--clickable-active-box-shadow, var(--active-box-shadow, var(--_box-shadow, none))));
|
|
236
261
|
}
|
|
237
262
|
|
|
@@ -239,7 +264,7 @@ button:disabled {
|
|
|
239
264
|
cursor: var(--button-disabled-cursor, var(--clickable-disabled-cursor, var(--disabled-cursor, not-allowed)));
|
|
240
265
|
transform: var(--button-disabled-transform, var(--clickable-disabled-transform, var(--disabled-transform, none)));
|
|
241
266
|
filter: var(--button-disabled-filter, var(--clickable-disabled-filter, var(--disabled-filter, grayscale(0.5))));
|
|
242
|
-
background-color: color-mix(in
|
|
267
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--disabled-base-color-percentage, 50%), var(--disabled-color-mix, gray) calc(100% - var(--disabled-base-color-percentage, 50%)));
|
|
243
268
|
box-shadow: var(--button-disabled-box-shadow, var(--clickable-disabled-box-shadow, var(--disabled-box-shadow, var(--_box-shadow, none))));
|
|
244
269
|
}
|
|
245
270
|
|
|
@@ -357,14 +382,14 @@ button.primary:hover {
|
|
|
357
382
|
filter: var(--primary-hover-filter, var(--button-hover-filter, var(--clickable-hover-filter, var(--hover-filter, brightness(1.05)))));
|
|
358
383
|
transform: var(--primary-hover-transform, var(--button-hover-transform, var(--clickable-hover-transform, var(--hover-transform, none))));
|
|
359
384
|
color: var(--_color);
|
|
360
|
-
background-color: color-mix(in
|
|
385
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--hover-base-color-percentage, 90%), var(--hover-color-mix, var(--_color, white)) calc(100% - var(--hover-base-color-percentage, 90%)));
|
|
361
386
|
box-shadow: var(--primary-hover-box-shadow, var(--button-hover-box-shadow, var(--clickable-hover-box-shadow, var(--hover-box-shadow, var(--_box-shadow, none)))));
|
|
362
387
|
}
|
|
363
388
|
|
|
364
389
|
button.primary:active {
|
|
365
390
|
filter: var(--primary-active-filter, var(--button-active-filter, var(--clickable-active-filter, var(--active-filter, brightness(0.9)))));
|
|
366
391
|
transform: var(--primary-active-transform, var(--button-active-transform, var(--clickable-active-transform, var(--active-transform, none))));
|
|
367
|
-
background-color: color-mix(in
|
|
392
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--active-base-color-percentage, 90%), var(--active-color-mix, black) calc(100% - var(--active-base-color-percentage, 90%)));
|
|
368
393
|
box-shadow: var(--primary-active-box-shadow, var(--button-active-box-shadow, var(--clickable-active-box-shadow, var(--active-box-shadow, var(--_box-shadow, none)))));
|
|
369
394
|
}
|
|
370
395
|
|
|
@@ -372,7 +397,7 @@ button.primary:disabled {
|
|
|
372
397
|
cursor: var(--primary-disabled-cursor, var(--button-disabled-cursor, var(--clickable-disabled-cursor, var(--disabled-cursor, not-allowed))));
|
|
373
398
|
transform: var(--primary-disabled-transform, var(--button-disabled-transform, var(--clickable-disabled-transform, var(--disabled-transform, none))));
|
|
374
399
|
filter: var(--primary-disabled-filter, var(--button-disabled-filter, var(--clickable-disabled-filter, var(--disabled-filter, grayscale(0.5)))));
|
|
375
|
-
background-color: color-mix(in
|
|
400
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--disabled-base-color-percentage, 50%), var(--disabled-color-mix, gray) calc(100% - var(--disabled-base-color-percentage, 50%)));
|
|
376
401
|
box-shadow: var(--primary-disabled-box-shadow, var(--button-disabled-box-shadow, var(--clickable-disabled-box-shadow, var(--disabled-box-shadow, var(--_box-shadow, none)))));
|
|
377
402
|
}
|
|
378
403
|
|
|
@@ -480,14 +505,14 @@ button.warning:hover {
|
|
|
480
505
|
filter: var(--warning-hover-filter, var(--button-hover-filter, var(--clickable-hover-filter, var(--hover-filter, brightness(1.05)))));
|
|
481
506
|
transform: var(--warning-hover-transform, var(--button-hover-transform, var(--clickable-hover-transform, var(--hover-transform, none))));
|
|
482
507
|
color: var(--_color);
|
|
483
|
-
background-color: color-mix(in
|
|
508
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--hover-base-color-percentage, 90%), var(--hover-color-mix, var(--_color, white)) calc(100% - var(--hover-base-color-percentage, 90%)));
|
|
484
509
|
box-shadow: var(--warning-hover-box-shadow, var(--button-hover-box-shadow, var(--clickable-hover-box-shadow, var(--hover-box-shadow, var(--_box-shadow, none)))));
|
|
485
510
|
}
|
|
486
511
|
|
|
487
512
|
button.warning:active {
|
|
488
513
|
filter: var(--warning-active-filter, var(--button-active-filter, var(--clickable-active-filter, var(--active-filter, brightness(0.9)))));
|
|
489
514
|
transform: var(--warning-active-transform, var(--button-active-transform, var(--clickable-active-transform, var(--active-transform, none))));
|
|
490
|
-
background-color: color-mix(in
|
|
515
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--active-base-color-percentage, 90%), var(--active-color-mix, black) calc(100% - var(--active-base-color-percentage, 90%)));
|
|
491
516
|
box-shadow: var(--warning-active-box-shadow, var(--button-active-box-shadow, var(--clickable-active-box-shadow, var(--active-box-shadow, var(--_box-shadow, none)))));
|
|
492
517
|
}
|
|
493
518
|
|
|
@@ -495,7 +520,7 @@ button.warning:disabled {
|
|
|
495
520
|
cursor: var(--warning-disabled-cursor, var(--button-disabled-cursor, var(--clickable-disabled-cursor, var(--disabled-cursor, not-allowed))));
|
|
496
521
|
transform: var(--warning-disabled-transform, var(--button-disabled-transform, var(--clickable-disabled-transform, var(--disabled-transform, none))));
|
|
497
522
|
filter: var(--warning-disabled-filter, var(--button-disabled-filter, var(--clickable-disabled-filter, var(--disabled-filter, grayscale(0.5)))));
|
|
498
|
-
background-color: color-mix(in
|
|
523
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--disabled-base-color-percentage, 50%), var(--disabled-color-mix, gray) calc(100% - var(--disabled-base-color-percentage, 50%)));
|
|
499
524
|
box-shadow: var(--warning-disabled-box-shadow, var(--button-disabled-box-shadow, var(--clickable-disabled-box-shadow, var(--disabled-box-shadow, var(--_box-shadow, none)))));
|
|
500
525
|
}
|
|
501
526
|
|
|
@@ -603,14 +628,14 @@ button.danger:hover {
|
|
|
603
628
|
filter: var(--danger-hover-filter, var(--button-hover-filter, var(--clickable-hover-filter, var(--hover-filter, brightness(1.05)))));
|
|
604
629
|
transform: var(--danger-hover-transform, var(--button-hover-transform, var(--clickable-hover-transform, var(--hover-transform, none))));
|
|
605
630
|
color: var(--_color);
|
|
606
|
-
background-color: color-mix(in
|
|
631
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--hover-base-color-percentage, 90%), var(--hover-color-mix, var(--_color, white)) calc(100% - var(--hover-base-color-percentage, 90%)));
|
|
607
632
|
box-shadow: var(--danger-hover-box-shadow, var(--button-hover-box-shadow, var(--clickable-hover-box-shadow, var(--hover-box-shadow, var(--_box-shadow, none)))));
|
|
608
633
|
}
|
|
609
634
|
|
|
610
635
|
button.danger:active {
|
|
611
636
|
filter: var(--danger-active-filter, var(--button-active-filter, var(--clickable-active-filter, var(--active-filter, brightness(0.9)))));
|
|
612
637
|
transform: var(--danger-active-transform, var(--button-active-transform, var(--clickable-active-transform, var(--active-transform, none))));
|
|
613
|
-
background-color: color-mix(in
|
|
638
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--active-base-color-percentage, 90%), var(--active-color-mix, black) calc(100% - var(--active-base-color-percentage, 90%)));
|
|
614
639
|
box-shadow: var(--danger-active-box-shadow, var(--button-active-box-shadow, var(--clickable-active-box-shadow, var(--active-box-shadow, var(--_box-shadow, none)))));
|
|
615
640
|
}
|
|
616
641
|
|
|
@@ -618,7 +643,7 @@ button.danger:disabled {
|
|
|
618
643
|
cursor: var(--danger-disabled-cursor, var(--button-disabled-cursor, var(--clickable-disabled-cursor, var(--disabled-cursor, not-allowed))));
|
|
619
644
|
transform: var(--danger-disabled-transform, var(--button-disabled-transform, var(--clickable-disabled-transform, var(--disabled-transform, none))));
|
|
620
645
|
filter: var(--danger-disabled-filter, var(--button-disabled-filter, var(--clickable-disabled-filter, var(--disabled-filter, grayscale(0.5)))));
|
|
621
|
-
background-color: color-mix(in
|
|
646
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--disabled-base-color-percentage, 50%), var(--disabled-color-mix, gray) calc(100% - var(--disabled-base-color-percentage, 50%)));
|
|
622
647
|
box-shadow: var(--danger-disabled-box-shadow, var(--button-disabled-box-shadow, var(--clickable-disabled-box-shadow, var(--disabled-box-shadow, var(--_box-shadow, none)))));
|
|
623
648
|
}
|
|
624
649
|
|
|
@@ -726,14 +751,14 @@ button.success:hover {
|
|
|
726
751
|
filter: var(--success-hover-filter, var(--button-hover-filter, var(--clickable-hover-filter, var(--hover-filter, brightness(1.05)))));
|
|
727
752
|
transform: var(--success-hover-transform, var(--button-hover-transform, var(--clickable-hover-transform, var(--hover-transform, none))));
|
|
728
753
|
color: var(--_color);
|
|
729
|
-
background-color: color-mix(in
|
|
754
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--hover-base-color-percentage, 90%), var(--hover-color-mix, var(--_color, white)) calc(100% - var(--hover-base-color-percentage, 90%)));
|
|
730
755
|
box-shadow: var(--success-hover-box-shadow, var(--button-hover-box-shadow, var(--clickable-hover-box-shadow, var(--hover-box-shadow, var(--_box-shadow, none)))));
|
|
731
756
|
}
|
|
732
757
|
|
|
733
758
|
button.success:active {
|
|
734
759
|
filter: var(--success-active-filter, var(--button-active-filter, var(--clickable-active-filter, var(--active-filter, brightness(0.9)))));
|
|
735
760
|
transform: var(--success-active-transform, var(--button-active-transform, var(--clickable-active-transform, var(--active-transform, none))));
|
|
736
|
-
background-color: color-mix(in
|
|
761
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--active-base-color-percentage, 90%), var(--active-color-mix, black) calc(100% - var(--active-base-color-percentage, 90%)));
|
|
737
762
|
box-shadow: var(--success-active-box-shadow, var(--button-active-box-shadow, var(--clickable-active-box-shadow, var(--active-box-shadow, var(--_box-shadow, none)))));
|
|
738
763
|
}
|
|
739
764
|
|
|
@@ -741,7 +766,7 @@ button.success:disabled {
|
|
|
741
766
|
cursor: var(--success-disabled-cursor, var(--button-disabled-cursor, var(--clickable-disabled-cursor, var(--disabled-cursor, not-allowed))));
|
|
742
767
|
transform: var(--success-disabled-transform, var(--button-disabled-transform, var(--clickable-disabled-transform, var(--disabled-transform, none))));
|
|
743
768
|
filter: var(--success-disabled-filter, var(--button-disabled-filter, var(--clickable-disabled-filter, var(--disabled-filter, grayscale(0.5)))));
|
|
744
|
-
background-color: color-mix(in
|
|
769
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--disabled-base-color-percentage, 50%), var(--disabled-color-mix, gray) calc(100% - var(--disabled-base-color-percentage, 50%)));
|
|
745
770
|
box-shadow: var(--success-disabled-box-shadow, var(--button-disabled-box-shadow, var(--clickable-disabled-box-shadow, var(--disabled-box-shadow, var(--_box-shadow, none)))));
|
|
746
771
|
}
|
|
747
772
|
|
|
@@ -849,14 +874,14 @@ button.info:hover {
|
|
|
849
874
|
filter: var(--info-hover-filter, var(--button-hover-filter, var(--clickable-hover-filter, var(--hover-filter, brightness(1.05)))));
|
|
850
875
|
transform: var(--info-hover-transform, var(--button-hover-transform, var(--clickable-hover-transform, var(--hover-transform, none))));
|
|
851
876
|
color: var(--_color);
|
|
852
|
-
background-color: color-mix(in
|
|
877
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--hover-base-color-percentage, 90%), var(--hover-color-mix, var(--_color, white)) calc(100% - var(--hover-base-color-percentage, 90%)));
|
|
853
878
|
box-shadow: var(--info-hover-box-shadow, var(--button-hover-box-shadow, var(--clickable-hover-box-shadow, var(--hover-box-shadow, var(--_box-shadow, none)))));
|
|
854
879
|
}
|
|
855
880
|
|
|
856
881
|
button.info:active {
|
|
857
882
|
filter: var(--info-active-filter, var(--button-active-filter, var(--clickable-active-filter, var(--active-filter, brightness(0.9)))));
|
|
858
883
|
transform: var(--info-active-transform, var(--button-active-transform, var(--clickable-active-transform, var(--active-transform, none))));
|
|
859
|
-
background-color: color-mix(in
|
|
884
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--active-base-color-percentage, 90%), var(--active-color-mix, black) calc(100% - var(--active-base-color-percentage, 90%)));
|
|
860
885
|
box-shadow: var(--info-active-box-shadow, var(--button-active-box-shadow, var(--clickable-active-box-shadow, var(--active-box-shadow, var(--_box-shadow, none)))));
|
|
861
886
|
}
|
|
862
887
|
|
|
@@ -864,7 +889,7 @@ button.info:disabled {
|
|
|
864
889
|
cursor: var(--info-disabled-cursor, var(--button-disabled-cursor, var(--clickable-disabled-cursor, var(--disabled-cursor, not-allowed))));
|
|
865
890
|
transform: var(--info-disabled-transform, var(--button-disabled-transform, var(--clickable-disabled-transform, var(--disabled-transform, none))));
|
|
866
891
|
filter: var(--info-disabled-filter, var(--button-disabled-filter, var(--clickable-disabled-filter, var(--disabled-filter, grayscale(0.5)))));
|
|
867
|
-
background-color: color-mix(in
|
|
892
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--disabled-base-color-percentage, 50%), var(--disabled-color-mix, gray) calc(100% - var(--disabled-base-color-percentage, 50%)));
|
|
868
893
|
box-shadow: var(--info-disabled-box-shadow, var(--button-disabled-box-shadow, var(--clickable-disabled-box-shadow, var(--disabled-box-shadow, var(--_box-shadow, none)))));
|
|
869
894
|
}
|
|
870
895
|
|
|
@@ -64,6 +64,31 @@ const iconSlotted = $derived(Boolean(icon));
|
|
|
64
64
|
text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
|
|
65
65
|
has to happen where the real element is, in the global consumer rule; only
|
|
66
66
|
the VALUES move to context vars here. */
|
|
67
|
+
/* Text reset for an overlay's root element: a tooltip, popover menu or dialog
|
|
68
|
+
that sits in the DOM wherever its trigger was placed.
|
|
69
|
+
|
|
70
|
+
The top layer changes how an element paints and where it is positioned, not
|
|
71
|
+
what it inherits. A popover declared inside a `white-space: nowrap` table
|
|
72
|
+
cell is nowrap too, and one inside a bold, uppercase, centred header is
|
|
73
|
+
bold, uppercase and centred -- styles that belong to the trigger's context,
|
|
74
|
+
not to the overlay. typography-props() doesn't stop that: its chains end in
|
|
75
|
+
`unset`, which for an inherited property means "take the parent's value".
|
|
76
|
+
|
|
77
|
+
So this re-declares every inherited text property with a real default at
|
|
78
|
+
the end of the same variable chain. The vars still win (--tooltip-*, then
|
|
79
|
+
the category, then the global), and custom properties still inherit --
|
|
80
|
+
that is how theming reaches an overlay -- but when nothing is set, the
|
|
81
|
+
overlay gets its own defaults instead of its host's.
|
|
82
|
+
|
|
83
|
+
INCLUDE IT AFTER typography-props() / typography-container-props() in the
|
|
84
|
+
same rule: it has to beat their `unset` fallbacks by source order.
|
|
85
|
+
|
|
86
|
+
Deliberately left inheriting:
|
|
87
|
+
- direction, writing-mode: the document's script direction is the
|
|
88
|
+
overlay's too.
|
|
89
|
+
- visibility: a hidden subtree should not be able to show an overlay.
|
|
90
|
+
- font-family: every theme defines --font-family at :root, and there is no
|
|
91
|
+
neutral value to fall back to that would beat "the page's font". */
|
|
67
92
|
/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
|
|
68
93
|
one value (both sides equal) or two (start end), so there is no separate
|
|
69
94
|
"which side" prop to remember and no 4-value shorthand order to get wrong.
|
|
@@ -227,14 +252,14 @@ a[role=button]:hover {
|
|
|
227
252
|
filter: var(--button-hover-filter, var(--clickable-hover-filter, var(--hover-filter, brightness(1.05))));
|
|
228
253
|
transform: var(--button-hover-transform, var(--clickable-hover-transform, var(--hover-transform, none)));
|
|
229
254
|
color: var(--_color);
|
|
230
|
-
background-color: color-mix(in
|
|
255
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--hover-base-color-percentage, 90%), var(--hover-color-mix, var(--_color, white)) calc(100% - var(--hover-base-color-percentage, 90%)));
|
|
231
256
|
box-shadow: var(--button-hover-box-shadow, var(--clickable-hover-box-shadow, var(--hover-box-shadow, var(--_box-shadow, none))));
|
|
232
257
|
}
|
|
233
258
|
|
|
234
259
|
a[role=button]:active {
|
|
235
260
|
filter: var(--button-active-filter, var(--clickable-active-filter, var(--active-filter, brightness(0.9))));
|
|
236
261
|
transform: var(--button-active-transform, var(--clickable-active-transform, var(--active-transform, none)));
|
|
237
|
-
background-color: color-mix(in
|
|
262
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--active-base-color-percentage, 90%), var(--active-color-mix, black) calc(100% - var(--active-base-color-percentage, 90%)));
|
|
238
263
|
box-shadow: var(--button-active-box-shadow, var(--clickable-active-box-shadow, var(--active-box-shadow, var(--_box-shadow, none))));
|
|
239
264
|
}
|
|
240
265
|
|
|
@@ -242,7 +267,7 @@ a[role=button]:disabled {
|
|
|
242
267
|
cursor: var(--button-disabled-cursor, var(--clickable-disabled-cursor, var(--disabled-cursor, not-allowed)));
|
|
243
268
|
transform: var(--button-disabled-transform, var(--clickable-disabled-transform, var(--disabled-transform, none)));
|
|
244
269
|
filter: var(--button-disabled-filter, var(--clickable-disabled-filter, var(--disabled-filter, grayscale(0.5))));
|
|
245
|
-
background-color: color-mix(in
|
|
270
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--disabled-base-color-percentage, 50%), var(--disabled-color-mix, gray) calc(100% - var(--disabled-base-color-percentage, 50%)));
|
|
246
271
|
box-shadow: var(--button-disabled-box-shadow, var(--clickable-disabled-box-shadow, var(--disabled-box-shadow, var(--_box-shadow, none))));
|
|
247
272
|
}
|
|
248
273
|
|
|
@@ -259,95 +284,9 @@ a[role=button] {
|
|
|
259
284
|
|
|
260
285
|
a[role=button]:hover {
|
|
261
286
|
text-decoration: none;
|
|
262
|
-
/* Override other link styles that may be outside
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
a.primary[role=button]:hover {
|
|
268
|
-
--link-bg: var(--primary-link-bg, var(--button-link-bg, var(--control-link-bg, var(--secondary-link-bg, inherit))));
|
|
269
|
-
--link-fg: var(--primary-link-fg, var(--button-link-fg, var(--control-link-fg, var(--secondary-link-fg, inherit))));
|
|
270
|
-
--_bg-mix-color: var(--primary-bg-mix-color, var(--button-bg-mix-color, var(--control-bg-mix-color, var(--secondary-bg-mix-color, var(--bg-mix-color, transparent)))));
|
|
271
|
-
--_bg-mix-amount: var(--primary-bg-mix-amount, var(--button-bg-mix-amount, var(--control-bg-mix-amount, var(--secondary-bg-mix-amount, var(--bg-mix-amount, 0%)))));
|
|
272
|
-
--_fg-mix-color: var(--primary-fg-mix-color, var(--button-fg-mix-color, var(--control-fg-mix-color, var(--secondary-fg-mix-color, var(--fg-mix-color, transparent)))));
|
|
273
|
-
--_fg-mix-amount: var(--primary-fg-mix-amount, var(--button-fg-mix-amount, var(--control-fg-mix-amount, var(--secondary-fg-mix-amount, var(--fg-mix-amount, 0%)))));
|
|
274
|
-
--_bg-base: var(--primary-bg, var(--button-bg, var(--control-bg, var(--secondary-bg, var(--bg, unset)))));
|
|
275
|
-
--_fg-base: var(--primary-fg, var(--button-fg, var(--control-fg, var(--secondary-fg, var(--fg, unset)))));
|
|
276
|
-
--_background-color: color-mix(
|
|
277
|
-
in srgb,
|
|
278
|
-
var(--_bg-base),
|
|
279
|
-
var(--_bg-mix-color) var(--_bg-mix-amount)
|
|
280
|
-
);
|
|
281
|
-
--_color: color-mix(
|
|
282
|
-
in srgb,
|
|
283
|
-
var(--_fg-base),
|
|
284
|
-
var(--_fg-mix-color) var(--_fg-mix-amount)
|
|
285
|
-
);
|
|
286
|
-
--muted-color: var(--muted-color-override, var(--_background-color));
|
|
287
|
-
--primary-text-fg: var(
|
|
288
|
-
--primary-text-fg-override,
|
|
289
|
-
color-mix(
|
|
290
|
-
in srgb,
|
|
291
|
-
var(--_color),
|
|
292
|
-
var(--primary-color)
|
|
293
|
-
var(--primary-text-amount, var(--text-amount, 50%))
|
|
294
|
-
)
|
|
295
|
-
);
|
|
296
|
-
--secondary-text-fg: var(
|
|
297
|
-
--secondary-text-fg-override,
|
|
298
|
-
color-mix(
|
|
299
|
-
in srgb,
|
|
300
|
-
var(--_color),
|
|
301
|
-
var(--secondary-color)
|
|
302
|
-
var(--secondary-text-amount, var(--text-amount, 50%))
|
|
303
|
-
)
|
|
304
|
-
);
|
|
305
|
-
--info-text-fg: var(
|
|
306
|
-
--info-text-fg-override,
|
|
307
|
-
color-mix(
|
|
308
|
-
in srgb,
|
|
309
|
-
var(--_color),
|
|
310
|
-
var(--info-color)
|
|
311
|
-
var(--info-text-amount, var(--text-amount, 50%))
|
|
312
|
-
)
|
|
313
|
-
);
|
|
314
|
-
--success-text-fg: var(
|
|
315
|
-
--success-text-fg-override,
|
|
316
|
-
color-mix(
|
|
317
|
-
in srgb,
|
|
318
|
-
var(--_color),
|
|
319
|
-
var(--success-color)
|
|
320
|
-
var(--success-text-amount, var(--text-amount, 50%))
|
|
321
|
-
)
|
|
322
|
-
);
|
|
323
|
-
--warning-text-fg: var(
|
|
324
|
-
--warning-text-fg-override,
|
|
325
|
-
color-mix(
|
|
326
|
-
in srgb,
|
|
327
|
-
var(--_color),
|
|
328
|
-
var(--warning-color)
|
|
329
|
-
var(--warning-text-amount, var(--text-amount, 50%))
|
|
330
|
-
)
|
|
331
|
-
);
|
|
332
|
-
--danger-text-fg: var(
|
|
333
|
-
--danger-text-fg-override,
|
|
334
|
-
color-mix(
|
|
335
|
-
in srgb,
|
|
336
|
-
var(--_color),
|
|
337
|
-
var(--danger-color)
|
|
338
|
-
var(--danger-text-amount, var(--text-amount, 50%))
|
|
339
|
-
)
|
|
340
|
-
);
|
|
341
|
-
--muted-text-fg: var(
|
|
342
|
-
--muted-text-fg-override,
|
|
343
|
-
color-mix(
|
|
344
|
-
in srgb,
|
|
345
|
-
var(--_color),
|
|
346
|
-
var(--muted-color)
|
|
347
|
-
var(--muted-text-amount, var(--text-amount, 50%))
|
|
348
|
-
)
|
|
349
|
-
);
|
|
350
|
-
background-color: var(--_background-color);
|
|
287
|
+
/* Override other link styles that may be outside us. Text color only:
|
|
288
|
+
re-applying the full color-props here (as a primary-only rule used
|
|
289
|
+
to) resets background-color and cancels the clickable hover. */
|
|
351
290
|
color: var(--_color);
|
|
352
291
|
}
|
|
353
292
|
|
|
@@ -90,6 +90,31 @@ let ref = $state(null);
|
|
|
90
90
|
text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
|
|
91
91
|
has to happen where the real element is, in the global consumer rule; only
|
|
92
92
|
the VALUES move to context vars here. */
|
|
93
|
+
/* Text reset for an overlay's root element: a tooltip, popover menu or dialog
|
|
94
|
+
that sits in the DOM wherever its trigger was placed.
|
|
95
|
+
|
|
96
|
+
The top layer changes how an element paints and where it is positioned, not
|
|
97
|
+
what it inherits. A popover declared inside a `white-space: nowrap` table
|
|
98
|
+
cell is nowrap too, and one inside a bold, uppercase, centred header is
|
|
99
|
+
bold, uppercase and centred -- styles that belong to the trigger's context,
|
|
100
|
+
not to the overlay. typography-props() doesn't stop that: its chains end in
|
|
101
|
+
`unset`, which for an inherited property means "take the parent's value".
|
|
102
|
+
|
|
103
|
+
So this re-declares every inherited text property with a real default at
|
|
104
|
+
the end of the same variable chain. The vars still win (--tooltip-*, then
|
|
105
|
+
the category, then the global), and custom properties still inherit --
|
|
106
|
+
that is how theming reaches an overlay -- but when nothing is set, the
|
|
107
|
+
overlay gets its own defaults instead of its host's.
|
|
108
|
+
|
|
109
|
+
INCLUDE IT AFTER typography-props() / typography-container-props() in the
|
|
110
|
+
same rule: it has to beat their `unset` fallbacks by source order.
|
|
111
|
+
|
|
112
|
+
Deliberately left inheriting:
|
|
113
|
+
- direction, writing-mode: the document's script direction is the
|
|
114
|
+
overlay's too.
|
|
115
|
+
- visibility: a hidden subtree should not be able to show an overlay.
|
|
116
|
+
- font-family: every theme defines --font-family at :root, and there is no
|
|
117
|
+
neutral value to fall back to that would beat "the page's font". */
|
|
93
118
|
/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
|
|
94
119
|
one value (both sides equal) or two (start end), so there is no separate
|
|
95
120
|
"which side" prop to remember and no 4-value shorthand order to get wrong.
|
|
@@ -303,18 +328,23 @@ label::before {
|
|
|
303
328
|
border-radius: var(--checkbox-radius, 0);
|
|
304
329
|
}
|
|
305
330
|
|
|
306
|
-
|
|
331
|
+
/* The :has(:checked) variants are needed because the checked rule below
|
|
332
|
+
outranks a bare label:hover::before and would swallow the hover; the mix
|
|
333
|
+
still reads the checked colors through --_background-color. */
|
|
334
|
+
label:hover::before,
|
|
335
|
+
label:has(input:checked):hover::before {
|
|
307
336
|
filter: var(--checkbox-hover-filter, var(--clickable-hover-filter, var(--hover-filter, brightness(1.05))));
|
|
308
337
|
transform: var(--checkbox-hover-transform, var(--clickable-hover-transform, var(--hover-transform, none)));
|
|
309
338
|
color: var(--_color);
|
|
310
|
-
background-color: color-mix(in
|
|
339
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--hover-base-color-percentage, 90%), var(--hover-color-mix, var(--_color, white)) calc(100% - var(--hover-base-color-percentage, 90%)));
|
|
311
340
|
box-shadow: var(--checkbox-hover-box-shadow, var(--clickable-hover-box-shadow, var(--hover-box-shadow, var(--_box-shadow, none))));
|
|
312
341
|
}
|
|
313
342
|
|
|
314
|
-
label:active::before
|
|
343
|
+
label:active::before,
|
|
344
|
+
label:has(input:checked):active::before {
|
|
315
345
|
filter: var(--checkbox-active-filter, var(--clickable-active-filter, var(--active-filter, brightness(0.9))));
|
|
316
346
|
transform: var(--checkbox-active-transform, var(--clickable-active-transform, var(--active-transform, none)));
|
|
317
|
-
background-color: color-mix(in
|
|
347
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--active-base-color-percentage, 90%), var(--active-color-mix, black) calc(100% - var(--active-base-color-percentage, 90%)));
|
|
318
348
|
box-shadow: var(--checkbox-active-box-shadow, var(--clickable-active-box-shadow, var(--active-box-shadow, var(--_box-shadow, none))));
|
|
319
349
|
}
|
|
320
350
|
|
|
@@ -55,6 +55,31 @@ const el = $derived(elementProps(restProps, "circle-button", [
|
|
|
55
55
|
text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
|
|
56
56
|
has to happen where the real element is, in the global consumer rule; only
|
|
57
57
|
the VALUES move to context vars here. */
|
|
58
|
+
/* Text reset for an overlay's root element: a tooltip, popover menu or dialog
|
|
59
|
+
that sits in the DOM wherever its trigger was placed.
|
|
60
|
+
|
|
61
|
+
The top layer changes how an element paints and where it is positioned, not
|
|
62
|
+
what it inherits. A popover declared inside a `white-space: nowrap` table
|
|
63
|
+
cell is nowrap too, and one inside a bold, uppercase, centred header is
|
|
64
|
+
bold, uppercase and centred -- styles that belong to the trigger's context,
|
|
65
|
+
not to the overlay. typography-props() doesn't stop that: its chains end in
|
|
66
|
+
`unset`, which for an inherited property means "take the parent's value".
|
|
67
|
+
|
|
68
|
+
So this re-declares every inherited text property with a real default at
|
|
69
|
+
the end of the same variable chain. The vars still win (--tooltip-*, then
|
|
70
|
+
the category, then the global), and custom properties still inherit --
|
|
71
|
+
that is how theming reaches an overlay -- but when nothing is set, the
|
|
72
|
+
overlay gets its own defaults instead of its host's.
|
|
73
|
+
|
|
74
|
+
INCLUDE IT AFTER typography-props() / typography-container-props() in the
|
|
75
|
+
same rule: it has to beat their `unset` fallbacks by source order.
|
|
76
|
+
|
|
77
|
+
Deliberately left inheriting:
|
|
78
|
+
- direction, writing-mode: the document's script direction is the
|
|
79
|
+
overlay's too.
|
|
80
|
+
- visibility: a hidden subtree should not be able to show an overlay.
|
|
81
|
+
- font-family: every theme defines --font-family at :root, and there is no
|
|
82
|
+
neutral value to fall back to that would beat "the page's font". */
|
|
58
83
|
/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
|
|
59
84
|
one value (both sides equal) or two (start end), so there is no separate
|
|
60
85
|
"which side" prop to remember and no 4-value shorthand order to get wrong.
|
|
@@ -82,93 +107,6 @@ const el = $derived(elementProps(restProps, "circle-button", [
|
|
|
82
107
|
container queries don't get their styles overridden by large media queries.
|
|
83
108
|
*/
|
|
84
109
|
/* Convenience groupings */
|
|
85
|
-
button.primary {
|
|
86
|
-
--link-bg: var(--primary-link-bg, var(--button-link-bg, var(--control-link-bg, inherit)));
|
|
87
|
-
--link-fg: var(--primary-link-fg, var(--button-link-fg, var(--control-link-fg, inherit)));
|
|
88
|
-
--_bg-mix-color: var(--primary-bg-mix-color, var(--button-bg-mix-color, var(--control-bg-mix-color, var(--bg-mix-color, transparent))));
|
|
89
|
-
--_bg-mix-amount: var(--primary-bg-mix-amount, var(--button-bg-mix-amount, var(--control-bg-mix-amount, var(--bg-mix-amount, 0%))));
|
|
90
|
-
--_fg-mix-color: var(--primary-fg-mix-color, var(--button-fg-mix-color, var(--control-fg-mix-color, var(--fg-mix-color, transparent))));
|
|
91
|
-
--_fg-mix-amount: var(--primary-fg-mix-amount, var(--button-fg-mix-amount, var(--control-fg-mix-amount, var(--fg-mix-amount, 0%))));
|
|
92
|
-
--_bg-base: var(--primary-bg, var(--button-bg, var(--control-bg, var(--bg, unset))));
|
|
93
|
-
--_fg-base: var(--primary-fg, var(--button-fg, var(--control-fg, var(--fg, unset))));
|
|
94
|
-
--_background-color: color-mix(
|
|
95
|
-
in srgb,
|
|
96
|
-
var(--_bg-base),
|
|
97
|
-
var(--_bg-mix-color) var(--_bg-mix-amount)
|
|
98
|
-
);
|
|
99
|
-
--_color: color-mix(
|
|
100
|
-
in srgb,
|
|
101
|
-
var(--_fg-base),
|
|
102
|
-
var(--_fg-mix-color) var(--_fg-mix-amount)
|
|
103
|
-
);
|
|
104
|
-
--muted-color: var(--muted-color-override, var(--_background-color));
|
|
105
|
-
--primary-text-fg: var(
|
|
106
|
-
--primary-text-fg-override,
|
|
107
|
-
color-mix(
|
|
108
|
-
in srgb,
|
|
109
|
-
var(--_color),
|
|
110
|
-
var(--primary-color)
|
|
111
|
-
var(--primary-text-amount, var(--text-amount, 50%))
|
|
112
|
-
)
|
|
113
|
-
);
|
|
114
|
-
--secondary-text-fg: var(
|
|
115
|
-
--secondary-text-fg-override,
|
|
116
|
-
color-mix(
|
|
117
|
-
in srgb,
|
|
118
|
-
var(--_color),
|
|
119
|
-
var(--secondary-color)
|
|
120
|
-
var(--secondary-text-amount, var(--text-amount, 50%))
|
|
121
|
-
)
|
|
122
|
-
);
|
|
123
|
-
--info-text-fg: var(
|
|
124
|
-
--info-text-fg-override,
|
|
125
|
-
color-mix(
|
|
126
|
-
in srgb,
|
|
127
|
-
var(--_color),
|
|
128
|
-
var(--info-color)
|
|
129
|
-
var(--info-text-amount, var(--text-amount, 50%))
|
|
130
|
-
)
|
|
131
|
-
);
|
|
132
|
-
--success-text-fg: var(
|
|
133
|
-
--success-text-fg-override,
|
|
134
|
-
color-mix(
|
|
135
|
-
in srgb,
|
|
136
|
-
var(--_color),
|
|
137
|
-
var(--success-color)
|
|
138
|
-
var(--success-text-amount, var(--text-amount, 50%))
|
|
139
|
-
)
|
|
140
|
-
);
|
|
141
|
-
--warning-text-fg: var(
|
|
142
|
-
--warning-text-fg-override,
|
|
143
|
-
color-mix(
|
|
144
|
-
in srgb,
|
|
145
|
-
var(--_color),
|
|
146
|
-
var(--warning-color)
|
|
147
|
-
var(--warning-text-amount, var(--text-amount, 50%))
|
|
148
|
-
)
|
|
149
|
-
);
|
|
150
|
-
--danger-text-fg: var(
|
|
151
|
-
--danger-text-fg-override,
|
|
152
|
-
color-mix(
|
|
153
|
-
in srgb,
|
|
154
|
-
var(--_color),
|
|
155
|
-
var(--danger-color)
|
|
156
|
-
var(--danger-text-amount, var(--text-amount, 50%))
|
|
157
|
-
)
|
|
158
|
-
);
|
|
159
|
-
--muted-text-fg: var(
|
|
160
|
-
--muted-text-fg-override,
|
|
161
|
-
color-mix(
|
|
162
|
-
in srgb,
|
|
163
|
-
var(--_color),
|
|
164
|
-
var(--muted-color)
|
|
165
|
-
var(--muted-text-amount, var(--text-amount, 50%))
|
|
166
|
-
)
|
|
167
|
-
);
|
|
168
|
-
background-color: var(--_background-color);
|
|
169
|
-
color: var(--_color);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
110
|
button {
|
|
173
111
|
/* `circle-button` first, `mini-button` behind it. This component was
|
|
174
112
|
called MiniButton until it was renamed to stop people putting text in a
|
|
@@ -285,14 +223,14 @@ button:hover {
|
|
|
285
223
|
filter: var(--circle-button-hover-filter, var(--mini-button-hover-filter, var(--button-hover-filter, var(--clickable-hover-filter, var(--hover-filter, brightness(1.05))))));
|
|
286
224
|
transform: var(--circle-button-hover-transform, var(--mini-button-hover-transform, var(--button-hover-transform, var(--clickable-hover-transform, var(--hover-transform, none)))));
|
|
287
225
|
color: var(--_color);
|
|
288
|
-
background-color: color-mix(in
|
|
226
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--hover-base-color-percentage, 90%), var(--hover-color-mix, var(--_color, white)) calc(100% - var(--hover-base-color-percentage, 90%)));
|
|
289
227
|
box-shadow: var(--circle-button-hover-box-shadow, var(--mini-button-hover-box-shadow, var(--button-hover-box-shadow, var(--clickable-hover-box-shadow, var(--hover-box-shadow, var(--_box-shadow, none))))));
|
|
290
228
|
}
|
|
291
229
|
|
|
292
230
|
button:active {
|
|
293
231
|
filter: var(--circle-button-active-filter, var(--mini-button-active-filter, var(--button-active-filter, var(--clickable-active-filter, var(--active-filter, brightness(0.9))))));
|
|
294
232
|
transform: var(--circle-button-active-transform, var(--mini-button-active-transform, var(--button-active-transform, var(--clickable-active-transform, var(--active-transform, none)))));
|
|
295
|
-
background-color: color-mix(in
|
|
233
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--active-base-color-percentage, 90%), var(--active-color-mix, black) calc(100% - var(--active-base-color-percentage, 90%)));
|
|
296
234
|
box-shadow: var(--circle-button-active-box-shadow, var(--mini-button-active-box-shadow, var(--button-active-box-shadow, var(--clickable-active-box-shadow, var(--active-box-shadow, var(--_box-shadow, none))))));
|
|
297
235
|
}
|
|
298
236
|
|
|
@@ -300,7 +238,7 @@ button:disabled {
|
|
|
300
238
|
cursor: var(--circle-button-disabled-cursor, var(--mini-button-disabled-cursor, var(--button-disabled-cursor, var(--clickable-disabled-cursor, var(--disabled-cursor, not-allowed)))));
|
|
301
239
|
transform: var(--circle-button-disabled-transform, var(--mini-button-disabled-transform, var(--button-disabled-transform, var(--clickable-disabled-transform, var(--disabled-transform, none)))));
|
|
302
240
|
filter: var(--circle-button-disabled-filter, var(--mini-button-disabled-filter, var(--button-disabled-filter, var(--clickable-disabled-filter, var(--disabled-filter, grayscale(0.5))))));
|
|
303
|
-
background-color: color-mix(in
|
|
241
|
+
background-color: color-mix(in oklab, var(--_background-color) var(--disabled-base-color-percentage, 50%), var(--disabled-color-mix, gray) calc(100% - var(--disabled-base-color-percentage, 50%)));
|
|
304
242
|
box-shadow: var(--circle-button-disabled-box-shadow, var(--mini-button-disabled-box-shadow, var(--button-disabled-box-shadow, var(--clickable-disabled-box-shadow, var(--disabled-box-shadow, var(--_box-shadow, none))))));
|
|
305
243
|
}
|
|
306
244
|
|
|
@@ -337,7 +275,10 @@ button {
|
|
|
337
275
|
flex-shrink: 0; /* Don't shrink any more */
|
|
338
276
|
}
|
|
339
277
|
|
|
340
|
-
|
|
278
|
+
/* Variants go through :where() so they only choose which colors apply.
|
|
279
|
+
As plain `button.primary` they tied with the clickable mixin's
|
|
280
|
+
`button:hover` and, coming later, cancelled the hover background. */
|
|
281
|
+
button:where(.primary) {
|
|
341
282
|
--link-bg: var(--primary-link-bg, var(--button-link-bg, var(--control-link-bg, inherit)));
|
|
342
283
|
--link-fg: var(--primary-link-fg, var(--button-link-fg, var(--control-link-fg, inherit)));
|
|
343
284
|
--_bg-mix-color: var(--primary-bg-mix-color, var(--button-bg-mix-color, var(--control-bg-mix-color, var(--bg-mix-color, transparent))));
|
|
@@ -424,7 +365,7 @@ button.primary {
|
|
|
424
365
|
color: var(--_color);
|
|
425
366
|
}
|
|
426
367
|
|
|
427
|
-
button.warning {
|
|
368
|
+
button:where(.warning) {
|
|
428
369
|
--link-bg: var(--warning-link-bg, var(--button-link-bg, var(--control-link-bg, inherit)));
|
|
429
370
|
--link-fg: var(--warning-link-fg, var(--button-link-fg, var(--control-link-fg, inherit)));
|
|
430
371
|
--_bg-mix-color: var(--warning-bg-mix-color, var(--button-bg-mix-color, var(--control-bg-mix-color, var(--bg-mix-color, transparent))));
|
|
@@ -511,7 +452,7 @@ button.warning {
|
|
|
511
452
|
color: var(--_color);
|
|
512
453
|
}
|
|
513
454
|
|
|
514
|
-
button.danger {
|
|
455
|
+
button:where(.danger) {
|
|
515
456
|
--link-bg: var(--danger-link-bg, var(--button-link-bg, var(--control-link-bg, inherit)));
|
|
516
457
|
--link-fg: var(--danger-link-fg, var(--button-link-fg, var(--control-link-fg, inherit)));
|
|
517
458
|
--_bg-mix-color: var(--danger-bg-mix-color, var(--button-bg-mix-color, var(--control-bg-mix-color, var(--bg-mix-color, transparent))));
|
|
@@ -598,7 +539,7 @@ button.danger {
|
|
|
598
539
|
color: var(--_color);
|
|
599
540
|
}
|
|
600
541
|
|
|
601
|
-
button.success {
|
|
542
|
+
button:where(.success) {
|
|
602
543
|
--link-bg: var(--success-link-bg, var(--button-link-bg, var(--control-link-bg, inherit)));
|
|
603
544
|
--link-fg: var(--success-link-fg, var(--button-link-fg, var(--control-link-fg, inherit)));
|
|
604
545
|
--_bg-mix-color: var(--success-bg-mix-color, var(--button-bg-mix-color, var(--control-bg-mix-color, var(--bg-mix-color, transparent))));
|
|
@@ -685,7 +626,7 @@ button.success {
|
|
|
685
626
|
color: var(--_color);
|
|
686
627
|
}
|
|
687
628
|
|
|
688
|
-
button.info {
|
|
629
|
+
button:where(.info) {
|
|
689
630
|
--link-bg: var(--info-link-bg, var(--button-link-bg, var(--control-link-bg, inherit)));
|
|
690
631
|
--link-fg: var(--info-link-fg, var(--button-link-fg, var(--control-link-fg, inherit)));
|
|
691
632
|
--_bg-mix-color: var(--info-bg-mix-color, var(--button-bg-mix-color, var(--control-bg-mix-color, var(--bg-mix-color, transparent))));
|