@zazz-ui/core 0.4.1 → 0.5.0
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/AUTHORING.md +158 -0
- package/CHANGELOG.md +331 -0
- package/README.md +55 -23
- package/dist/scroll-state-C8mA5gq6.js +1 -0
- package/dist/sri.json +124 -72
- package/dist/zazz.css +1 -1
- package/dist/zazz.js +1 -1
- package/editor/zazz.css-data.json +116794 -0
- package/editor/zazz.html-data.json +1683 -0
- package/editor/zazz.language-data.json +5001 -0
- package/editor/zazz.lint-data.json +152 -0
- package/package.json +12 -5
- package/src/base/_breakpoints.css +12 -0
- package/src/base/_layers.css +8 -9
- package/src/base/_properties-2xl.css +171 -0
- package/src/base/_properties-active.css +107 -0
- package/src/base/_properties-checked.css +107 -0
- package/src/base/_properties-current.css +107 -0
- package/src/base/_properties-disabled.css +107 -0
- package/src/base/_properties-focus-visible.css +107 -0
- package/src/base/_properties-focus-within.css +107 -0
- package/src/base/_properties-hover.css +107 -0
- package/src/base/_properties-lg.css +171 -0
- package/src/base/_properties-md.css +171 -0
- package/src/base/_properties-open.css +107 -0
- package/src/base/_properties-sm.css +171 -0
- package/src/base/_properties-starting.css +55 -0
- package/src/base/_properties-stuck.css +55 -0
- package/src/base/_properties-xl.css +171 -0
- package/src/base/_properties.css +555 -0
- package/src/base/_reset.css +67 -75
- package/src/base/_switches.css +145 -0
- package/src/base/_typography.css +437 -370
- package/src/base/_utilities-box.css +142 -0
- package/src/base/_utilities-color.css +290 -0
- package/src/base/_utilities-effects.css +235 -0
- package/src/base/_utilities-flow.css +312 -0
- package/src/base/_utilities-grid.css +143 -0
- package/src/base/_utilities-margin.css +376 -0
- package/src/base/_utilities-pseudo.css +426 -0
- package/src/base/_utilities-sizing.css +259 -0
- package/src/base/_utilities-spacing.css +190 -0
- package/src/base/_utilities-tier-2xl.css +93 -0
- package/src/base/_utilities-tier-active.css +61 -0
- package/src/base/_utilities-tier-checked.css +61 -0
- package/src/base/_utilities-tier-current.css +61 -0
- package/src/base/_utilities-tier-disabled.css +61 -0
- package/src/base/_utilities-tier-focus-visible.css +61 -0
- package/src/base/_utilities-tier-focus-within.css +61 -0
- package/src/base/_utilities-tier-hover.css +63 -0
- package/src/base/_utilities-tier-lg.css +93 -0
- package/src/base/_utilities-tier-md.css +93 -0
- package/src/base/_utilities-tier-open.css +61 -0
- package/src/base/_utilities-tier-sm.css +93 -0
- package/src/base/_utilities-tier-starting.css +35 -0
- package/src/base/_utilities-tier-stuck.css +114 -0
- package/src/base/_utilities-tier-xl.css +93 -0
- package/src/base/_utilities-typography.css +141 -0
- package/src/base/_variables.css +323 -372
- package/src/base/_view-transitions.css +10 -12
- package/src/base/command-score.d.ts.map +1 -1
- package/src/base/command-score.js +1 -2
- package/src/base/command-score.ts +1 -2
- package/src/base/dialog-lifecycle.js +1 -1
- package/src/base/dialog-lifecycle.ts +1 -1
- package/src/base/embla.d.ts +6 -7
- package/src/base/embla.d.ts.map +1 -1
- package/src/base/embla.js +89 -55
- package/src/base/embla.ts +89 -55
- package/src/base/hotkeys.d.ts +0 -5
- package/src/base/hotkeys.d.ts.map +1 -1
- package/src/base/hotkeys.ts +0 -5
- package/src/base/navigation.d.ts +12 -1
- package/src/base/navigation.d.ts.map +1 -1
- package/src/base/navigation.js +229 -86
- package/src/base/navigation.ts +224 -92
- package/src/base/reveal.js +14 -14
- package/src/base/reveal.ts +14 -14
- package/src/base/scroll-state.d.ts +21 -0
- package/src/base/scroll-state.d.ts.map +1 -0
- package/src/base/scroll-state.js +177 -0
- package/src/base/scroll-state.ts +188 -0
- package/src/base/signals.d.ts +1 -2
- package/src/base/signals.d.ts.map +1 -1
- package/src/base/signals.js +4 -6
- package/src/base/signals.ts +4 -6
- package/src/base/style-format.d.ts +33 -0
- package/src/base/style-format.d.ts.map +1 -0
- package/src/base/style-format.js +160 -0
- package/src/base/style-format.ts +180 -0
- package/src/base/typeahead.d.ts +19 -4
- package/src/base/typeahead.d.ts.map +1 -1
- package/src/base/typeahead.js +68 -21
- package/src/base/typeahead.ts +73 -23
- package/src/base/utilities.d.ts +188 -0
- package/src/base/utilities.d.ts.map +1 -0
- package/src/base/utilities.js +750 -0
- package/src/base/utilities.ts +865 -0
- package/src/base/utils.d.ts +3 -7
- package/src/base/utils.d.ts.map +1 -1
- package/src/base/utils.js +4 -8
- package/src/base/utils.ts +4 -8
- package/src/base/zazz-element.d.ts +14 -8
- package/src/base/zazz-element.d.ts.map +1 -1
- package/src/base/zazz-element.js +14 -8
- package/src/base/zazz-element.ts +15 -8
- package/src/globals.d.ts +1 -1
- package/src/head.d.ts +50 -4
- package/src/head.d.ts.map +1 -1
- package/src/head.js +119 -38
- package/src/head.ts +172 -41
- package/src/index.css +57 -14
- package/src/index.js +5 -0
- package/src/index.ts +6 -0
- package/src/manifest.d.ts +36 -5
- package/src/manifest.d.ts.map +1 -1
- package/src/manifest.js +150 -6
- package/src/manifest.ts +167 -9
- package/src/primitives/accordion/accordion.css +18 -17
- package/src/primitives/accordion/accordion.html +42 -9
- package/src/primitives/alert-dialog/alert-dialog.css +13 -13
- package/src/primitives/alert-dialog/alert-dialog.html +26 -12
- package/src/primitives/autocomplete/autocomplete-groups.html +64 -33
- package/src/primitives/autocomplete/autocomplete.css +43 -39
- package/src/primitives/autocomplete/autocomplete.d.ts +6 -5
- package/src/primitives/autocomplete/autocomplete.d.ts.map +1 -1
- package/src/primitives/autocomplete/autocomplete.html +38 -26
- package/src/primitives/autocomplete/autocomplete.js +6 -5
- package/src/primitives/autocomplete/autocomplete.ts +6 -5
- package/src/primitives/avatar/avatar.html +110 -15
- package/src/primitives/badge/badge-icon.html +22 -8
- package/src/primitives/badge/badge.css +401 -128
- package/src/primitives/badge/badge.html +12 -6
- package/src/primitives/breadcrumbs/breadcrumbs.html +25 -5
- package/src/primitives/button/button-icon-only.html +17 -11
- package/src/primitives/button/button-icon.html +9 -3
- package/src/primitives/button/button.css +408 -164
- package/src/primitives/button/button.html +14 -7
- package/src/primitives/button-group/button-group-vertical.html +5 -5
- package/src/primitives/button-group/button-group.css +53 -25
- package/src/primitives/button-group/button-group.html +18 -12
- package/src/primitives/callout/callout.css +114 -0
- package/src/primitives/callout/callout.html +188 -0
- package/src/primitives/card/card-subgrid.html +249 -34
- package/src/primitives/card/card.css +125 -0
- package/src/primitives/card/card.html +141 -20
- package/src/primitives/carousel/carousel.css +30 -20
- package/src/primitives/carousel/carousel.d.ts +7 -10
- package/src/primitives/carousel/carousel.d.ts.map +1 -1
- package/src/primitives/carousel/carousel.html +420 -84
- package/src/primitives/carousel/carousel.js +1 -1
- package/src/primitives/carousel/carousel.ts +8 -11
- package/src/primitives/checkbox/checkbox-tasklist.html +6 -6
- package/src/primitives/checkbox/checkbox.css +98 -40
- package/src/primitives/checkbox/checkbox.d.ts.map +1 -1
- package/src/primitives/checkbox/checkbox.html +13 -8
- package/src/primitives/checkbox/checkbox.js +7 -9
- package/src/primitives/checkbox/checkbox.ts +7 -15
- package/src/primitives/combobox/combobox-multiselect.html +53 -33
- package/src/primitives/combobox/combobox.css +145 -122
- package/src/primitives/combobox/combobox.d.ts +12 -11
- package/src/primitives/combobox/combobox.d.ts.map +1 -1
- package/src/primitives/combobox/combobox.html +48 -28
- package/src/primitives/combobox/combobox.js +46 -51
- package/src/primitives/combobox/combobox.ts +48 -55
- package/src/primitives/command/command-actions.d.ts +2 -3
- package/src/primitives/command/command-actions.d.ts.map +1 -1
- package/src/primitives/command/command-actions.html +48 -33
- package/src/primitives/command/command-actions.js +12 -10
- package/src/primitives/command/command-actions.ts +12 -13
- package/src/primitives/command/command-dialog.html +49 -25
- package/src/primitives/command/command.css +52 -42
- package/src/primitives/command/command.d.ts +10 -7
- package/src/primitives/command/command.d.ts.map +1 -1
- package/src/primitives/command/command.html +95 -46
- package/src/primitives/command/command.js +30 -13
- package/src/primitives/command/command.ts +30 -12
- package/src/primitives/debug/audit-core.d.ts +64 -0
- package/src/primitives/debug/audit-core.d.ts.map +1 -0
- package/src/primitives/debug/audit-core.js +356 -0
- package/src/primitives/debug/audit-core.ts +535 -0
- package/src/primitives/debug/debug.d.ts +50 -0
- package/src/primitives/debug/debug.d.ts.map +1 -0
- package/src/primitives/debug/debug.js +168 -0
- package/src/primitives/debug/debug.ts +211 -0
- package/src/primitives/dialog/dialog-with-form.html +67 -45
- package/src/primitives/dialog/dialog.css +87 -61
- package/src/primitives/dialog/dialog.html +25 -17
- package/src/primitives/fields/fields.css +108 -134
- package/src/primitives/fields/fields.html +39 -0
- package/src/primitives/input/input-icon-leading.html +3 -3
- package/src/primitives/input/input-icon-trailing.html +3 -3
- package/src/primitives/input/input.css +87 -49
- package/src/primitives/input/input.html +15 -15
- package/src/primitives/input-group/input-group-password-group.html +15 -15
- package/src/primitives/input-group/input-group.css +118 -75
- package/src/primitives/input-group/input-group.html +42 -30
- package/src/primitives/kbd/kbd-group.html +15 -2
- package/src/primitives/kbd/kbd.css +44 -31
- package/src/primitives/kbd/kbd.html +7 -1
- package/src/primitives/layout/layout.css +159 -0
- package/src/primitives/layout/layout.html +35 -0
- package/src/primitives/lightbox/lightbox.css +178 -105
- package/src/primitives/lightbox/lightbox.d.ts.map +1 -1
- package/src/primitives/lightbox/lightbox.html +138 -166
- package/src/primitives/lightbox/lightbox.js +10 -13
- package/src/primitives/lightbox/lightbox.ts +12 -13
- package/src/primitives/menu/menu-interest.html +60 -18
- package/src/primitives/menu/menu.css +22 -17
- package/src/primitives/menu/menu.d.ts +5 -5
- package/src/primitives/menu/menu.html +195 -40
- package/src/primitives/menu/menu.js +8 -8
- package/src/primitives/menu/menu.ts +8 -8
- package/src/primitives/menubar/menubar-help-search.html +78 -32
- package/src/primitives/menubar/menubar.html +166 -38
- package/src/primitives/meter/meter.css +41 -38
- package/src/primitives/meter/meter.html +44 -9
- package/src/primitives/mobile-menu/mobile-menu.css +47 -40
- package/src/primitives/mobile-menu/mobile-menu.html +1460 -179
- package/src/primitives/navigation-menu/navigation-menu-featured.html +155 -33
- package/src/primitives/navigation-menu/navigation-menu-icon-grid.html +222 -47
- package/src/primitives/navigation-menu/navigation-menu-interest.html +130 -38
- package/src/primitives/navigation-menu/navigation-menu-megamenu.html +402 -72
- package/src/primitives/navigation-menu/navigation-menu-simple.html +90 -40
- package/src/primitives/navigation-menu/navigation-menu.css +104 -106
- package/src/primitives/navigation-menu/navigation-menu.html +554 -158
- package/src/primitives/otp/otp.css +43 -44
- package/src/primitives/otp/otp.d.ts +4 -5
- package/src/primitives/otp/otp.d.ts.map +1 -1
- package/src/primitives/otp/otp.html +7 -6
- package/src/primitives/otp/otp.js +13 -18
- package/src/primitives/otp/otp.ts +12 -19
- package/src/primitives/password-group/password-group.css +132 -107
- package/src/primitives/password-group/password-group.d.ts.map +1 -1
- package/src/primitives/password-group/password-group.html +23 -16
- package/src/primitives/password-group/password-group.js +11 -12
- package/src/primitives/password-group/password-group.ts +11 -12
- package/src/primitives/popover/popover.css +88 -95
- package/src/primitives/popover/popover.html +18 -0
- package/src/primitives/progress/progress-indeterminate.html +1 -1
- package/src/primitives/progress/progress.css +34 -35
- package/src/primitives/progress/progress.html +18 -4
- package/src/primitives/prose/prose.html +19 -12
- package/src/primitives/radio/radio.css +83 -46
- package/src/primitives/radio/radio.html +16 -11
- package/src/primitives/reveal/reveal.css +37 -46
- package/src/primitives/reveal/reveal.html +15 -0
- package/src/primitives/scroll-fade/scroll-fade.css +115 -0
- package/src/primitives/scroll-fade/scroll-fade.html +69 -0
- package/src/primitives/select/multiselect.d.ts +8 -10
- package/src/primitives/select/multiselect.d.ts.map +1 -1
- package/src/primitives/select/multiselect.js +23 -27
- package/src/primitives/select/multiselect.ts +23 -29
- package/src/primitives/select/select-align.html +79 -16
- package/src/primitives/select/select-multiple.html +8 -4
- package/src/primitives/select/select-sides.html +104 -21
- package/src/primitives/select/select.css +297 -186
- package/src/primitives/select/select.html +24 -5
- package/src/primitives/separator/separator.css +15 -18
- package/src/primitives/separator/separator.html +37 -10
- package/src/primitives/slider/slider.css +48 -38
- package/src/primitives/slider/slider.html +9 -1
- package/src/primitives/style-guard/style-guard.d.ts +19 -0
- package/src/primitives/style-guard/style-guard.d.ts.map +1 -0
- package/src/primitives/style-guard/style-guard.js +125 -0
- package/src/primitives/style-guard/style-guard.ts +153 -0
- package/src/primitives/switch/switch.css +42 -33
- package/src/primitives/switch/switch.html +11 -6
- package/src/primitives/table/table-alternating.html +1 -1
- package/src/primitives/table/table-grid.html +5 -5
- package/src/primitives/table/table-size-sm.html +1 -1
- package/src/primitives/table/table.css +64 -61
- package/src/primitives/table/table.html +7 -7
- package/src/primitives/tabs/tabs.css +167 -166
- package/src/primitives/tabs/tabs.d.ts +10 -11
- package/src/primitives/tabs/tabs.d.ts.map +1 -1
- package/src/primitives/tabs/tabs.html +192 -36
- package/src/primitives/tabs/tabs.js +14 -15
- package/src/primitives/tabs/tabs.ts +14 -15
- package/src/primitives/textarea/textarea.css +69 -44
- package/src/primitives/textarea/textarea.html +3 -3
- package/src/primitives/toaster/toaster.css +90 -92
- package/src/primitives/toaster/toaster.d.ts +0 -6
- package/src/primitives/toaster/toaster.d.ts.map +1 -1
- package/src/primitives/toaster/toaster.html +22 -18
- package/src/primitives/toaster/toaster.js +64 -72
- package/src/primitives/toaster/toaster.ts +71 -87
- package/src/primitives/toggle/toggle.css +368 -153
- package/src/primitives/toggle/toggle.html +27 -9
- package/src/primitives/toggle-group/toggle-group-multiple.html +3 -3
- package/src/primitives/toggle-group/toggle-group-vertical.html +4 -4
- package/src/primitives/toggle-group/toggle-group.css +71 -23
- package/src/primitives/toggle-group/toggle-group.html +3 -3
- package/src/primitives/toolbar/toolbar.html +35 -13
- package/src/primitives/tooltip/tooltip-disabled.html +3 -3
- package/src/primitives/tooltip/tooltip-sides.html +36 -14
- package/src/primitives/tooltip/tooltip-with-kbd.html +5 -5
- package/src/primitives/tooltip/tooltip.css +111 -80
- package/src/primitives/tooltip/tooltip.html +3 -3
- package/src/primitives/utilities/aspect-ratio.html +51 -7
- package/src/primitives/utilities/basis.html +64 -11
- package/src/primitives/utilities/col-span.html +65 -9
- package/src/primitives/utilities/compose.html +48 -10
- package/src/primitives/utilities/flex-align.html +89 -19
- package/src/primitives/utilities/flex-direction.html +111 -13
- package/src/primitives/utilities/flex-grow.html +41 -7
- package/src/primitives/utilities/gap.html +158 -19
- package/src/primitives/utilities/grid-cols.html +75 -7
- package/src/primitives/utilities/grid-responsive.html +111 -12
- package/src/primitives/utilities/margin-auto.html +38 -7
- package/src/primitives/utilities/object-fit.html +75 -13
- package/src/primitives/utilities/order.html +40 -4
- package/src/primitives/utilities/overflow.html +74 -20
- package/src/primitives/utilities/padding-compose.html +67 -10
- package/src/primitives/utilities/padding.html +84 -13
- package/src/primitives/utilities/pile.html +29 -0
- package/src/primitives/utilities/position.html +65 -8
- package/src/primitives/utilities/responsive-flex.html +54 -7
- package/src/primitives/utilities/responsive-grid.html +115 -12
- package/src/primitives/utilities/size.html +120 -16
- package/src/primitives/utilities/width.html +123 -16
- package/examples/about.html +0 -583
- package/examples/components.html +0 -1028
- package/examples/forms.html +0 -504
- package/examples/index.html +0 -261
- package/examples/layout.html +0 -313
- package/examples/products.html +0 -839
- package/examples/responsive.html +0 -332
- package/src/base/_layout.css +0 -571
- package/src/base/_utilities.css +0 -6758
- package/src/primitives/utilities/grid-pile.html +0 -5
|
@@ -1,93 +1,240 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* button.css — Button (
|
|
2
|
+
* button.css — Button ([data-ui~="button"])
|
|
3
3
|
*
|
|
4
4
|
* @layer variables, components
|
|
5
|
-
* @requires
|
|
5
|
+
* @requires _layers.css, _variables.css, _reset.css, _properties.css (--_*-resolved, --_focus-ring), fields.css (--ui-field-* metrics), kbd.css (--ui-kbd-*)
|
|
6
6
|
* @uses color-mix(), oklch(from …) — variant hover/active tints
|
|
7
7
|
* @uses text-box — vertical trim (patchy browser support)
|
|
8
|
-
* @tokens --ui-button-* (@layer variables; metrics default to the --ui-field-* family)
|
|
9
|
-
* @consumedby toggle.css
|
|
8
|
+
* @tokens --ui-button-* (@layer variables; hooks are named after the utilities they back; metrics default to the --ui-field-* family)
|
|
9
|
+
* @consumedby toggle.css, select.css, button-group.css, autocomplete.css, combobox.css,
|
|
10
|
+
* command.css, lightbox.css, menu.css, navigation-menu.css, popover.css
|
|
11
|
+
*
|
|
12
|
+
* Every utility-backed declaration reads one chain, highest first:
|
|
13
|
+
* var(--_<utility>-resolved, var(--_button-<utility>, var(--ui-button-<utility>)))
|
|
14
|
+
* The resolver is set by the utilities layer from the element's `style` gate
|
|
15
|
+
* (inline utilities and their tiers), the private by a variant or size on this
|
|
16
|
+
* element, and the hook by :root, a subtree, or an inline hook.
|
|
10
17
|
*/
|
|
11
18
|
|
|
12
19
|
@layer variables {
|
|
13
20
|
:root {
|
|
14
|
-
/*
|
|
15
|
-
button
|
|
16
|
-
|
|
17
|
-
to diverge just the buttons. Colors stay independent — a button surface is
|
|
18
|
-
not a field surface, and button borders don't go primary on hover. */
|
|
21
|
+
/* metrics follow --ui-field-* so buttons match adjacent fields; remap a
|
|
22
|
+
--ui-button-* token to diverge. Colors stay independent: a button is not a
|
|
23
|
+
field surface, and its border doesn't go primary on hover. */
|
|
19
24
|
--ui-button-ring-color: var(--ui-field-ring-color);
|
|
20
25
|
|
|
21
26
|
--ui-button-font-family: var(--font-family-body);
|
|
22
27
|
--ui-button-font-size: var(--ui-field-font-size);
|
|
23
28
|
--ui-button-font-weight: var(--font-weight-strong);
|
|
24
|
-
--ui-button-
|
|
29
|
+
--ui-button-leading: var(--ui-field-leading);
|
|
25
30
|
|
|
26
|
-
--ui-button-
|
|
27
|
-
--ui-button-
|
|
28
|
-
--ui-button-
|
|
31
|
+
--ui-button-bg: var(--color-background);
|
|
32
|
+
--ui-button-bg--hover: oklch(from var(--color-background) calc(l - 0.025) c h);
|
|
33
|
+
--ui-button-bg--active: oklch(from var(--color-background) calc(l - 0.05) c h);
|
|
29
34
|
|
|
30
|
-
--ui-button-
|
|
31
|
-
--ui-button-
|
|
32
|
-
--ui-button-
|
|
35
|
+
--ui-button-text: var(--color-foreground);
|
|
36
|
+
--ui-button-text--hover: var(--color-foreground);
|
|
37
|
+
--ui-button-text--active: var(--color-foreground);
|
|
33
38
|
|
|
34
39
|
--ui-button-border-width: var(--ui-field-border-width);
|
|
35
40
|
--ui-button-border-style: var(--ui-field-border-style);
|
|
36
|
-
--ui-button-border-color: var(--border);
|
|
37
|
-
--ui-button-border-color--hover: var(--border);
|
|
38
|
-
--ui-button-border-color--active: var(--border);
|
|
41
|
+
--ui-button-border-color: var(--ui-field-border-color);
|
|
42
|
+
--ui-button-border-color--hover: var(--ui-field-border-color);
|
|
43
|
+
--ui-button-border-color--active: var(--ui-field-border-color);
|
|
39
44
|
|
|
40
|
-
|
|
41
|
-
--ui-button-
|
|
42
|
-
--ui-button-
|
|
43
|
-
--ui-button-
|
|
45
|
+
/* dual-mode: a scale number or a length */
|
|
46
|
+
--ui-button-gap: var(--spacing);
|
|
47
|
+
--ui-button-px: var(--ui-field-px);
|
|
48
|
+
--ui-button-min-h: var(--ui-field-h);
|
|
49
|
+
--ui-button-rounded: var(--ui-field-rounded);
|
|
44
50
|
|
|
45
51
|
--ui-button-icon-size: var(--ui-field-icon-size);
|
|
46
52
|
|
|
47
|
-
/*
|
|
48
|
-
never `none`, so the focus ring layers stay valid */
|
|
53
|
+
/* never `none`: the focus ring layers into this box-shadow list */
|
|
49
54
|
--ui-button-shadow: 0 0 transparent;
|
|
50
55
|
}
|
|
51
56
|
}
|
|
52
57
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
/* Variant privates: non-inheriting so a variant never cascades into a nested
|
|
59
|
+
button. Unset, they are guaranteed-invalid and the chain falls to the hook. */
|
|
60
|
+
@property --_button-ring-color {
|
|
61
|
+
syntax: "*";
|
|
62
|
+
inherits: false;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@property --_button-font-family {
|
|
66
|
+
syntax: "*";
|
|
67
|
+
inherits: false;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@property --_button-font-size {
|
|
71
|
+
syntax: "*";
|
|
72
|
+
inherits: false;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@property --_button-font-weight {
|
|
76
|
+
syntax: "*";
|
|
77
|
+
inherits: false;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@property --_button-leading {
|
|
81
|
+
syntax: "*";
|
|
82
|
+
inherits: false;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@property --_button-bg {
|
|
86
|
+
syntax: "*";
|
|
87
|
+
inherits: false;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@property --_button-bg--hover {
|
|
91
|
+
syntax: "*";
|
|
92
|
+
inherits: false;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@property --_button-bg--active {
|
|
96
|
+
syntax: "*";
|
|
97
|
+
inherits: false;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@property --_button-text {
|
|
101
|
+
syntax: "*";
|
|
102
|
+
inherits: false;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@property --_button-text--hover {
|
|
106
|
+
syntax: "*";
|
|
107
|
+
inherits: false;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@property --_button-text--active {
|
|
111
|
+
syntax: "*";
|
|
112
|
+
inherits: false;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@property --_button-border-width {
|
|
116
|
+
syntax: "*";
|
|
117
|
+
inherits: false;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@property --_button-border-style {
|
|
121
|
+
syntax: "*";
|
|
122
|
+
inherits: false;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@property --_button-border-color {
|
|
126
|
+
syntax: "*";
|
|
127
|
+
inherits: false;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
@property --_button-border-color--hover {
|
|
131
|
+
syntax: "*";
|
|
132
|
+
inherits: false;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@property --_button-border-color--active {
|
|
136
|
+
syntax: "*";
|
|
137
|
+
inherits: false;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@property --_button-gap {
|
|
141
|
+
syntax: "*";
|
|
142
|
+
inherits: false;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@property --_button-px {
|
|
146
|
+
syntax: "*";
|
|
147
|
+
inherits: false;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@property --_button-min-h {
|
|
151
|
+
syntax: "*";
|
|
152
|
+
inherits: false;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
@property --_button-rounded {
|
|
156
|
+
syntax: "*";
|
|
157
|
+
inherits: false;
|
|
158
|
+
}
|
|
57
159
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
160
|
+
@property --_button-icon-size {
|
|
161
|
+
syntax: "*";
|
|
162
|
+
inherits: false;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
@property --_button-shadow {
|
|
166
|
+
syntax: "*";
|
|
167
|
+
inherits: false;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@layer ui.components {
|
|
171
|
+
:where([data-ui~="button"]) {
|
|
172
|
+
font-family: var(
|
|
173
|
+
--_font-family-resolved,
|
|
174
|
+
var(--_button-font-family, var(--ui-button-font-family))
|
|
175
|
+
);
|
|
176
|
+
font-size: var(--_font-size-resolved, var(--_button-font-size, var(--ui-button-font-size)));
|
|
177
|
+
font-weight: var(
|
|
178
|
+
--_font-weight-resolved,
|
|
179
|
+
var(--_button-font-weight, var(--ui-button-font-weight))
|
|
180
|
+
);
|
|
181
|
+
line-height: var(--_leading-resolved, var(--_button-leading, var(--ui-button-leading)));
|
|
63
182
|
|
|
64
183
|
display: flex;
|
|
65
184
|
align-items: center;
|
|
66
185
|
justify-content: center;
|
|
67
|
-
column-gap: var(--ui-button-gap);
|
|
68
186
|
flex-shrink: 0;
|
|
69
187
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
188
|
+
--_gap-len: var(--_gap-resolved, var(--_button-gap, var(--ui-button-gap)));
|
|
189
|
+
--_gap-num: var(--_gap-resolved, var(--_button-gap, var(--ui-button-gap)));
|
|
190
|
+
column-gap: calc(var(--_gap-len) + var(--_gap-num) * var(--spacing));
|
|
73
191
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
192
|
+
--_min-h-len: var(--_min-h-resolved, var(--_button-min-h, var(--ui-button-min-h)));
|
|
193
|
+
--_min-h-num: var(--_min-h-resolved, var(--_button-min-h, var(--ui-button-min-h)));
|
|
194
|
+
min-block-size: calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing));
|
|
195
|
+
min-inline-size: max-content;
|
|
77
196
|
|
|
78
|
-
|
|
79
|
-
|
|
197
|
+
--_px-len: var(--_px-resolved, var(--_button-px, var(--ui-button-px)));
|
|
198
|
+
--_px-num: var(--_px-resolved, var(--_button-px, var(--ui-button-px)));
|
|
199
|
+
padding-inline: calc(var(--_px-len) + var(--_px-num) * var(--spacing));
|
|
200
|
+
|
|
201
|
+
border-width: var(
|
|
202
|
+
--_border-width-resolved,
|
|
203
|
+
var(--_button-border-width, var(--ui-button-border-width))
|
|
204
|
+
);
|
|
205
|
+
border-style: var(
|
|
206
|
+
--_border-style-resolved,
|
|
207
|
+
var(--_button-border-style, var(--ui-button-border-style))
|
|
208
|
+
);
|
|
209
|
+
border-color: var(
|
|
210
|
+
--_border-color-resolved,
|
|
211
|
+
var(--_button-border-color, var(--ui-button-border-color))
|
|
212
|
+
);
|
|
213
|
+
border-radius: var(--_rounded-resolved, var(--_button-rounded, var(--ui-button-rounded)));
|
|
214
|
+
|
|
215
|
+
color: var(--_text-resolved, var(--_button-text, var(--ui-button-text)));
|
|
216
|
+
background-color: var(--_bg-resolved, var(--_button-bg, var(--ui-button-bg)));
|
|
80
217
|
background-clip: padding-box;
|
|
218
|
+
white-space-collapse: collapse;
|
|
81
219
|
|
|
82
|
-
/* ring
|
|
83
|
-
|
|
220
|
+
/* The ring is published to --_focus-ring so the utilities layer's
|
|
221
|
+
box-shadow emission keeps it above a --shadow or --ring utility; the ring
|
|
222
|
+
widths grow from 0 on :focus-visible so the ring eases in. */
|
|
84
223
|
--_ring-offset-width: 0px;
|
|
85
224
|
--_ring-width: 0px;
|
|
86
|
-
--_ring: color-mix(
|
|
225
|
+
--_ring-fill: color-mix(
|
|
226
|
+
in oklch,
|
|
227
|
+
var(--_ring-color-resolved, var(--_button-ring-color, var(--ui-button-ring-color)))
|
|
228
|
+
var(--ring-opacity),
|
|
229
|
+
transparent
|
|
230
|
+
);
|
|
231
|
+
--_focus-ring:
|
|
232
|
+
0 0 0 var(--_ring-offset-width) var(--ring-offset-shadow-color),
|
|
233
|
+
0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width))
|
|
234
|
+
var(--_ring-fill, var(--ring-shadow-color));
|
|
87
235
|
box-shadow:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
var(--ui-button-shadow);
|
|
236
|
+
var(--_focus-ring, 0 0 #0000),
|
|
237
|
+
var(--_shadow-resolved, var(--_button-shadow, var(--ui-button-shadow)));
|
|
91
238
|
|
|
92
239
|
cursor: default;
|
|
93
240
|
text-decoration: none;
|
|
@@ -102,8 +249,8 @@
|
|
|
102
249
|
text-box: trim-both ex alphabetic;
|
|
103
250
|
}
|
|
104
251
|
|
|
105
|
-
a[href]
|
|
106
|
-
a[href]
|
|
252
|
+
a[href] :where([data-ui~="button"]):not(:disabled, [aria-disabled="true"]),
|
|
253
|
+
a[href]:where([data-ui~="button"]):not(:disabled, [aria-disabled="true"]) {
|
|
107
254
|
cursor: pointer;
|
|
108
255
|
}
|
|
109
256
|
|
|
@@ -111,29 +258,38 @@
|
|
|
111
258
|
BUTTON STATES
|
|
112
259
|
=========================================================================== */
|
|
113
260
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
261
|
+
@media (hover: hover) {
|
|
262
|
+
:where([data-ui~="button"]):hover:not(:disabled, [aria-disabled="true"]) {
|
|
263
|
+
color: var(--_text-resolved, var(--_button-text--hover, var(--ui-button-text--hover)));
|
|
264
|
+
background-color: var(--_bg-resolved, var(--_button-bg--hover, var(--ui-button-bg--hover)));
|
|
265
|
+
border-color: var(
|
|
266
|
+
--_border-color-resolved,
|
|
267
|
+
var(--_button-border-color--hover, var(--ui-button-border-color--hover))
|
|
268
|
+
);
|
|
269
|
+
}
|
|
118
270
|
}
|
|
119
271
|
|
|
120
|
-
|
|
121
|
-
color: var(--ui-button-
|
|
122
|
-
background-color: var(--ui-button-
|
|
123
|
-
border-color: var(
|
|
272
|
+
:where([data-ui~="button"]):active:not(:disabled, [aria-disabled="true"]) {
|
|
273
|
+
color: var(--_text-resolved, var(--_button-text--active, var(--ui-button-text--active)));
|
|
274
|
+
background-color: var(--_bg-resolved, var(--_button-bg--active, var(--ui-button-bg--active)));
|
|
275
|
+
border-color: var(
|
|
276
|
+
--_border-color-resolved,
|
|
277
|
+
var(--_button-border-color--active, var(--ui-button-border-color--active))
|
|
278
|
+
);
|
|
124
279
|
}
|
|
125
280
|
|
|
126
|
-
|
|
281
|
+
:where([data-ui~="button"]):focus-visible:not(:disabled, [aria-disabled="true"]) {
|
|
127
282
|
--_ring-offset-width: var(--ring-offset-width);
|
|
128
283
|
--_ring-width: var(--ring-width);
|
|
129
284
|
|
|
130
285
|
outline-color: transparent;
|
|
131
286
|
}
|
|
132
287
|
|
|
133
|
-
:
|
|
134
|
-
|
|
135
|
-
--
|
|
136
|
-
--
|
|
288
|
+
/* before the variants at the same specificity: a disabled primary keeps its color; only the default surface goes muted */
|
|
289
|
+
:where([data-ui~="button"]:is(:disabled, [aria-disabled="true"])) {
|
|
290
|
+
--_button-text: var(--color-muted-foreground);
|
|
291
|
+
--_button-bg: var(--color-muted);
|
|
292
|
+
--_button-shadow: 0 0 transparent;
|
|
137
293
|
--decoration-line: none;
|
|
138
294
|
|
|
139
295
|
cursor: default;
|
|
@@ -141,7 +297,7 @@
|
|
|
141
297
|
outline: none;
|
|
142
298
|
}
|
|
143
299
|
|
|
144
|
-
|
|
300
|
+
:where([data-ui~="button"])[aria-busy="true"] {
|
|
145
301
|
cursor: progress;
|
|
146
302
|
}
|
|
147
303
|
|
|
@@ -149,7 +305,7 @@
|
|
|
149
305
|
BUTTON ICONS
|
|
150
306
|
=========================================================================== */
|
|
151
307
|
|
|
152
|
-
|
|
308
|
+
:where([data-ui~="button"]) > svg {
|
|
153
309
|
inline-size: var(--ui-button-icon-size);
|
|
154
310
|
block-size: var(--ui-button-icon-size);
|
|
155
311
|
pointer-events: none;
|
|
@@ -160,134 +316,218 @@
|
|
|
160
316
|
}
|
|
161
317
|
|
|
162
318
|
/* ===========================================================================
|
|
163
|
-
BUTTON VARIANTS
|
|
319
|
+
BUTTON VARIANTS — data-button-variant writes the privates
|
|
164
320
|
=========================================================================== */
|
|
321
|
+
:where([data-ui~="button"][data-button-variant="outline"]) {
|
|
322
|
+
--_button-bg: transparent;
|
|
165
323
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
--ui-button-background--hover: oklch(from var(--primary) l c h / 0.9);
|
|
169
|
-
--ui-button-background--active: oklch(from var(--primary) l c h / 0.8);
|
|
324
|
+
--_button-shadow: 0 0 transparent;
|
|
325
|
+
}
|
|
170
326
|
|
|
171
|
-
|
|
172
|
-
--
|
|
173
|
-
--
|
|
327
|
+
:where([data-ui~="button"][data-button-variant="primary"]) {
|
|
328
|
+
--_button-bg: var(--color-primary);
|
|
329
|
+
--_button-bg--hover: oklch(from var(--color-primary) l c h / 0.9);
|
|
330
|
+
--_button-bg--active: oklch(from var(--color-primary) l c h / 0.8);
|
|
174
331
|
|
|
175
|
-
--
|
|
176
|
-
--
|
|
177
|
-
--
|
|
332
|
+
--_button-text: var(--color-primary-foreground);
|
|
333
|
+
--_button-text--hover: var(--color-primary-foreground);
|
|
334
|
+
--_button-text--active: var(--color-primary-foreground);
|
|
178
335
|
|
|
179
|
-
--
|
|
336
|
+
--_button-border-color: transparent;
|
|
337
|
+
--_button-border-color--hover: transparent;
|
|
338
|
+
--_button-border-color--active: transparent;
|
|
339
|
+
|
|
340
|
+
--_button-shadow: 0 0 transparent;
|
|
180
341
|
}
|
|
181
342
|
|
|
182
|
-
|
|
183
|
-
--
|
|
184
|
-
--
|
|
185
|
-
--
|
|
343
|
+
:where([data-ui~="button"][data-button-variant="secondary"]) {
|
|
344
|
+
--_button-bg: var(--color-secondary);
|
|
345
|
+
--_button-bg--hover: oklch(from var(--color-secondary) l c h / 0.9);
|
|
346
|
+
--_button-bg--active: oklch(from var(--color-secondary) l c h / 0.8);
|
|
186
347
|
|
|
187
|
-
--
|
|
188
|
-
--
|
|
189
|
-
--
|
|
348
|
+
--_button-text: var(--color-secondary-foreground);
|
|
349
|
+
--_button-text--hover: var(--color-secondary-foreground);
|
|
350
|
+
--_button-text--active: var(--color-secondary-foreground);
|
|
190
351
|
|
|
191
|
-
--
|
|
192
|
-
--
|
|
193
|
-
--
|
|
352
|
+
--_button-border-color: transparent;
|
|
353
|
+
--_button-border-color--hover: transparent;
|
|
354
|
+
--_button-border-color--active: transparent;
|
|
194
355
|
|
|
195
|
-
--
|
|
356
|
+
--_button-shadow: 0 0 transparent;
|
|
196
357
|
}
|
|
197
358
|
|
|
198
|
-
|
|
199
|
-
--
|
|
200
|
-
--
|
|
201
|
-
--
|
|
359
|
+
:where([data-ui~="button"][data-button-variant="tertiary"]) {
|
|
360
|
+
--_button-bg: var(--color-tertiary);
|
|
361
|
+
--_button-bg--hover: oklch(from var(--color-tertiary) l c h / 0.9);
|
|
362
|
+
--_button-bg--active: oklch(from var(--color-tertiary) l c h / 0.8);
|
|
202
363
|
|
|
203
|
-
--
|
|
204
|
-
--
|
|
205
|
-
--
|
|
364
|
+
--_button-text: var(--color-tertiary-foreground);
|
|
365
|
+
--_button-text--hover: var(--color-tertiary-foreground);
|
|
366
|
+
--_button-text--active: var(--color-tertiary-foreground);
|
|
206
367
|
|
|
207
|
-
--
|
|
208
|
-
--
|
|
209
|
-
--
|
|
368
|
+
--_button-border-color: transparent;
|
|
369
|
+
--_button-border-color--hover: transparent;
|
|
370
|
+
--_button-border-color--active: transparent;
|
|
210
371
|
|
|
211
|
-
--
|
|
372
|
+
--_button-shadow: 0 0 transparent;
|
|
212
373
|
}
|
|
213
374
|
|
|
214
|
-
|
|
215
|
-
--
|
|
375
|
+
:where([data-ui~="button"][data-button-variant="muted"]) {
|
|
376
|
+
--_button-bg: var(--color-muted);
|
|
377
|
+
--_button-bg--hover: oklch(from var(--color-muted) l c h / calc(alpha - 0.02));
|
|
378
|
+
--_button-bg--active: var(--color-muted);
|
|
216
379
|
|
|
217
|
-
--
|
|
218
|
-
--
|
|
219
|
-
--
|
|
380
|
+
--_button-text: var(--color-foreground);
|
|
381
|
+
--_button-text--hover: var(--color-foreground);
|
|
382
|
+
--_button-text--active: var(--color-foreground);
|
|
220
383
|
|
|
221
|
-
--
|
|
222
|
-
--
|
|
223
|
-
--
|
|
384
|
+
--_button-border-color: transparent;
|
|
385
|
+
--_button-border-color--hover: transparent;
|
|
386
|
+
--_button-border-color--active: transparent;
|
|
224
387
|
|
|
225
|
-
--
|
|
226
|
-
|
|
227
|
-
--ui-button-border-color--active: var(--ui-button-background--active);
|
|
388
|
+
--_button-shadow: 0 0 transparent;
|
|
389
|
+
}
|
|
228
390
|
|
|
229
|
-
|
|
391
|
+
:where([data-ui~="button"][data-button-variant="ghost"]) {
|
|
392
|
+
--_button-bg: transparent;
|
|
393
|
+
--_button-bg--hover: var(--color-muted);
|
|
394
|
+
--_button-bg--active: oklch(from var(--color-muted) l c h / calc(alpha - 0.02));
|
|
395
|
+
|
|
396
|
+
--_button-text: var(--color-foreground);
|
|
397
|
+
--_button-text--hover: var(--color-foreground);
|
|
398
|
+
--_button-text--active: var(--color-foreground);
|
|
399
|
+
|
|
400
|
+
--_button-border-color: transparent;
|
|
401
|
+
--_button-border-color--hover: transparent;
|
|
402
|
+
--_button-border-color--active: transparent;
|
|
403
|
+
|
|
404
|
+
--_button-shadow: 0 0 transparent;
|
|
230
405
|
}
|
|
231
406
|
|
|
232
|
-
|
|
233
|
-
--
|
|
234
|
-
--ui-button-background--hover: transparent;
|
|
235
|
-
--ui-button-background--active: transparent;
|
|
407
|
+
:where([data-ui~="button"][data-button-variant="info"]) {
|
|
408
|
+
--_button-ring-color: var(--color-info);
|
|
236
409
|
|
|
237
|
-
--
|
|
238
|
-
--
|
|
239
|
-
--
|
|
410
|
+
--_button-bg: var(--color-info);
|
|
411
|
+
--_button-bg--hover: oklch(from var(--color-info) l c h / 0.9);
|
|
412
|
+
--_button-bg--active: oklch(from var(--color-info) l c h / 0.8);
|
|
240
413
|
|
|
241
|
-
--
|
|
414
|
+
--_button-text: var(--color-info-foreground);
|
|
415
|
+
--_button-text--hover: var(--color-info-foreground);
|
|
416
|
+
--_button-text--active: var(--color-info-foreground);
|
|
242
417
|
|
|
243
|
-
--
|
|
244
|
-
--
|
|
245
|
-
--
|
|
418
|
+
--_button-border-color: transparent;
|
|
419
|
+
--_button-border-color--hover: transparent;
|
|
420
|
+
--_button-border-color--active: transparent;
|
|
246
421
|
|
|
247
|
-
--
|
|
422
|
+
--_button-shadow: 0 0 transparent;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
:where([data-ui~="button"][data-button-variant="success"]) {
|
|
426
|
+
--_button-ring-color: var(--color-success);
|
|
427
|
+
|
|
428
|
+
--_button-bg: var(--color-success);
|
|
429
|
+
--_button-bg--hover: oklch(from var(--color-success) l c h / 0.9);
|
|
430
|
+
--_button-bg--active: oklch(from var(--color-success) l c h / 0.8);
|
|
248
431
|
|
|
249
|
-
text
|
|
250
|
-
text
|
|
251
|
-
text
|
|
252
|
-
|
|
253
|
-
|
|
432
|
+
--_button-text: var(--color-success-foreground);
|
|
433
|
+
--_button-text--hover: var(--color-success-foreground);
|
|
434
|
+
--_button-text--active: var(--color-success-foreground);
|
|
435
|
+
|
|
436
|
+
--_button-border-color: transparent;
|
|
437
|
+
--_button-border-color--hover: transparent;
|
|
438
|
+
--_button-border-color--active: transparent;
|
|
439
|
+
|
|
440
|
+
--_button-shadow: 0 0 transparent;
|
|
254
441
|
}
|
|
255
442
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
443
|
+
:where([data-ui~="button"][data-button-variant="warning"]) {
|
|
444
|
+
--_button-ring-color: var(--color-warning);
|
|
445
|
+
|
|
446
|
+
--_button-bg: var(--color-warning);
|
|
447
|
+
--_button-bg--hover: oklch(from var(--color-warning) l c h / 0.9);
|
|
448
|
+
--_button-bg--active: oklch(from var(--color-warning) l c h / 0.8);
|
|
449
|
+
|
|
450
|
+
--_button-text: var(--color-warning-foreground);
|
|
451
|
+
--_button-text--hover: var(--color-warning-foreground);
|
|
452
|
+
--_button-text--active: var(--color-warning-foreground);
|
|
453
|
+
|
|
454
|
+
--_button-border-color: transparent;
|
|
455
|
+
--_button-border-color--hover: transparent;
|
|
456
|
+
--_button-border-color--active: transparent;
|
|
457
|
+
|
|
458
|
+
--_button-shadow: 0 0 transparent;
|
|
259
459
|
}
|
|
260
460
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
461
|
+
:where([data-ui~="button"][data-button-variant="destructive"]) {
|
|
462
|
+
--_button-ring-color: var(--color-destructive);
|
|
463
|
+
|
|
464
|
+
--_button-bg: var(--color-destructive);
|
|
465
|
+
--_button-bg--hover: oklch(from var(--color-destructive) l c h / 0.9);
|
|
466
|
+
--_button-bg--active: oklch(from var(--color-destructive) l c h / 0.8);
|
|
467
|
+
|
|
468
|
+
--_button-text: var(--color-destructive-foreground);
|
|
469
|
+
--_button-text--hover: var(--color-destructive-foreground);
|
|
470
|
+
--_button-text--active: var(--color-destructive-foreground);
|
|
471
|
+
|
|
472
|
+
--_button-border-color: transparent;
|
|
473
|
+
--_button-border-color--hover: transparent;
|
|
474
|
+
--_button-border-color--active: transparent;
|
|
475
|
+
|
|
476
|
+
--_button-shadow: 0 0 transparent;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
:where([data-ui~="button"][data-button-variant="link"]) {
|
|
480
|
+
--_button-bg: transparent;
|
|
481
|
+
--_button-bg--hover: transparent;
|
|
482
|
+
--_button-bg--active: transparent;
|
|
483
|
+
|
|
484
|
+
--_button-text: var(--color-foreground);
|
|
485
|
+
--_button-text--hover: oklch(from var(--color-primary) l c h / 0.6);
|
|
486
|
+
--_button-text--active: oklch(from var(--color-primary) l c h / 0.5);
|
|
487
|
+
|
|
488
|
+
--_button-border-style: none;
|
|
489
|
+
|
|
490
|
+
/* no minimum: the link sizes to its text (dual mode cannot carry fit-content) */
|
|
491
|
+
--_button-min-h: 0;
|
|
492
|
+
--_button-px: 0;
|
|
493
|
+
--_button-rounded: 0;
|
|
494
|
+
|
|
495
|
+
--_button-shadow: 0 0 transparent;
|
|
264
496
|
}
|
|
265
497
|
|
|
266
498
|
/* ===========================================================================
|
|
267
|
-
BUTTON SIZES
|
|
499
|
+
BUTTON SIZES — data-button-size
|
|
268
500
|
=========================================================================== */
|
|
269
501
|
|
|
270
|
-
|
|
271
|
-
--
|
|
272
|
-
--
|
|
273
|
-
--
|
|
502
|
+
:where([data-ui~="button"][data-button-size="sm"]) {
|
|
503
|
+
--_button-min-h: calc(var(--spacing) * 6);
|
|
504
|
+
--_button-px: calc(var(--spacing) * 2);
|
|
505
|
+
--_button-rounded: var(--radius-sm);
|
|
506
|
+
--_button-font-size: var(--font-size-xs);
|
|
274
507
|
}
|
|
275
508
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
509
|
+
:where(
|
|
510
|
+
:is(ui-button-group, [data-ui~="button-group"]):has([data-ui~="button"][data-button-size="sm"])
|
|
511
|
+
) {
|
|
512
|
+
--_button-group-rounded: var(--radius-sm);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
:where([data-ui~="button"][data-button-size="icon"]) {
|
|
516
|
+
block-size: calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing));
|
|
517
|
+
inline-size: calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing));
|
|
279
518
|
padding: 0;
|
|
280
519
|
aspect-ratio: 1 / 1;
|
|
281
520
|
}
|
|
282
521
|
|
|
283
|
-
|
|
284
|
-
--
|
|
285
|
-
--
|
|
286
|
-
--
|
|
287
|
-
|
|
522
|
+
:where([data-ui~="button"][data-button-size="icon-sm"]) {
|
|
523
|
+
--_button-min-h: calc(var(--spacing) * 6);
|
|
524
|
+
--_button-px: calc(var(--spacing) * 2);
|
|
525
|
+
--_button-rounded: var(--radius-sm);
|
|
526
|
+
/* the hook, not a private: it must inherit to reach the icon */
|
|
527
|
+
--ui-button-icon-size: calc(var(--spacing) * 3.5);
|
|
288
528
|
|
|
289
|
-
block-size: var(--
|
|
290
|
-
inline-size: var(--
|
|
529
|
+
block-size: calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing));
|
|
530
|
+
inline-size: calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing));
|
|
291
531
|
padding: 0;
|
|
292
532
|
aspect-ratio: 1 / 1;
|
|
293
533
|
}
|
|
@@ -297,29 +537,33 @@
|
|
|
297
537
|
=========================================================================== */
|
|
298
538
|
|
|
299
539
|
/* Descendant (not child) so keys wrapped in a ui-kbd-group still resize */
|
|
300
|
-
|
|
301
|
-
--ui-kbd-min-
|
|
302
|
-
--ui-kbd-min-
|
|
303
|
-
--ui-kbd-icon-size: var(--
|
|
540
|
+
:where([data-ui~="button"]) :where(kbd) {
|
|
541
|
+
--ui-kbd-min-w: calc(var(--spacing) * 4.5);
|
|
542
|
+
--ui-kbd-min-h: calc(var(--spacing) * 4.5);
|
|
543
|
+
--ui-kbd-icon-size: calc(var(--spacing) * 3);
|
|
304
544
|
}
|
|
305
545
|
|
|
306
|
-
|
|
307
|
-
|
|
546
|
+
:where([data-ui~="button"]):has(
|
|
547
|
+
> :where(kbd, ui-kbd-group, [data-ui~="kbd-group"]):last-child:not(:only-child)
|
|
548
|
+
) {
|
|
549
|
+
padding-inline-end: calc(var(--spacing) * 1.5);
|
|
308
550
|
}
|
|
309
551
|
|
|
310
|
-
|
|
311
|
-
|
|
552
|
+
:where([data-ui~="button"]):has(
|
|
553
|
+
> :where(kbd, ui-kbd-group, [data-ui~="kbd-group"]):first-child:not(:only-child)
|
|
554
|
+
) {
|
|
555
|
+
padding-inline-start: calc(var(--spacing) * 1.5);
|
|
312
556
|
}
|
|
313
557
|
|
|
314
|
-
|
|
315
|
-
> :where(kbd, ui-kbd-group,
|
|
558
|
+
:where([data-ui~="button"][data-button-size="sm"]):has(
|
|
559
|
+
> :where(kbd, ui-kbd-group, [data-ui~="kbd-group"]):last-child:not(:only-child)
|
|
316
560
|
) {
|
|
317
|
-
padding-inline-end: var(--
|
|
561
|
+
padding-inline-end: calc(var(--spacing) * 0.5);
|
|
318
562
|
}
|
|
319
563
|
|
|
320
|
-
|
|
321
|
-
> :where(kbd, ui-kbd-group,
|
|
564
|
+
:where([data-ui~="button"][data-button-size="sm"]):has(
|
|
565
|
+
> :where(kbd, ui-kbd-group, [data-ui~="kbd-group"]):first-child:not(:only-child)
|
|
322
566
|
) {
|
|
323
|
-
padding-inline-start: var(--
|
|
567
|
+
padding-inline-start: calc(var(--spacing) * 0.5);
|
|
324
568
|
}
|
|
325
569
|
}
|