@zazz-ui/core 0.8.2 → 0.8.4
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/CHANGELOG.md +39 -0
- package/README.md +2 -2
- package/dist/sri.json +48 -48
- package/dist/zazz.css +1 -1
- package/dist/zazz.js +1 -1
- package/editor/zazz.css-data.json +1968 -592
- package/editor/zazz.language-data.json +26 -17
- package/editor/zazz.lint-data.json +10 -0
- package/package.json +1 -1
- package/src/base/_defaults.css +5 -0
- package/src/base/_properties-2xl.css +4 -0
- package/src/base/_properties-active.css +12 -0
- package/src/base/_properties-checked.css +12 -0
- package/src/base/_properties-current.css +12 -0
- package/src/base/_properties-disabled.css +12 -0
- package/src/base/_properties-focus-visible.css +12 -0
- package/src/base/_properties-focus-within.css +12 -0
- package/src/base/_properties-hover.css +12 -0
- package/src/base/_properties-lg.css +4 -0
- package/src/base/_properties-md.css +4 -0
- package/src/base/_properties-open.css +12 -0
- package/src/base/_properties-sm.css +4 -0
- package/src/base/_properties-starting.css +6 -0
- package/src/base/_properties-stuck.css +6 -0
- package/src/base/_properties-xl.css +4 -0
- package/src/base/_properties.css +16 -0
- package/src/base/_shadows.css +17 -17
- package/src/base/_utilities-box.css +2 -2
- package/src/base/_utilities-spacing.css +42 -0
- package/src/base/_utilities-tier-2xl.css +2 -0
- package/src/base/_utilities-tier-active.css +6 -0
- package/src/base/_utilities-tier-checked.css +6 -0
- package/src/base/_utilities-tier-current.css +6 -0
- package/src/base/_utilities-tier-disabled.css +6 -0
- package/src/base/_utilities-tier-focus-visible.css +6 -0
- package/src/base/_utilities-tier-focus-within.css +6 -0
- package/src/base/_utilities-tier-hover.css +6 -0
- package/src/base/_utilities-tier-lg.css +2 -0
- package/src/base/_utilities-tier-md.css +2 -0
- package/src/base/_utilities-tier-open.css +6 -0
- package/src/base/_utilities-tier-sm.css +2 -0
- package/src/base/_utilities-tier-starting.css +3 -0
- package/src/base/_utilities-tier-stuck.css +3 -0
- package/src/base/_utilities-tier-xl.css +2 -0
- package/src/base/_variables.css +2 -2
- package/src/base/embla.d.ts.map +1 -1
- package/src/base/embla.js +48 -5
- package/src/base/embla.ts +63 -5
- package/src/base/kit-styling.d.ts.map +1 -1
- package/src/base/kit-styling.js +1 -0
- package/src/base/kit-styling.ts +1 -0
- package/src/base/utilities.d.ts +5 -2
- package/src/base/utilities.d.ts.map +1 -1
- package/src/base/utilities.js +35 -2
- package/src/base/utilities.ts +49 -4
- package/src/manifest.d.ts.map +1 -1
- package/src/manifest.js +1 -0
- package/src/manifest.ts +1 -0
- package/src/primitives/badge/badge.css +69 -27
- package/src/primitives/button/button.css +67 -25
- package/src/primitives/callout/callout.css +9 -9
- package/src/primitives/carousel/carousel.css +8 -7
- package/src/primitives/popover/popover.css +2 -2
- package/src/primitives/switch/switch.css +2 -2
- package/src/primitives/utilities/space.html +18 -0
package/src/base/kit-styling.js
CHANGED
package/src/base/kit-styling.ts
CHANGED
|
@@ -505,4 +505,5 @@ export const TIER_BLOCKS: Readonly<Record<string, readonly number[]>> = {
|
|
|
505
505
|
"text-decoration": [136, 140, 190, 237, 239, 248, 249],
|
|
506
506
|
"text-wrap": [7, 8, 9, 10, 11, 12, 113, 133, 236, 251],
|
|
507
507
|
translate: [66, 161, 162],
|
|
508
|
+
z: [65, 77, 78, 91, 111, 113, 151, 185],
|
|
508
509
|
};
|
package/src/base/utilities.d.ts
CHANGED
|
@@ -80,9 +80,10 @@ export interface Utility {
|
|
|
80
80
|
* width and color channels, and the side rules emit them. `px` feeds a
|
|
81
81
|
* composite too, as one signed length `--_<name>-w`: a number is that many
|
|
82
82
|
* pixels, a length passes through, and the sign carries meaning (a negative
|
|
83
|
-
* ring is inset).
|
|
83
|
+
* ring is inset). `space` is a dual value the container publishes for its
|
|
84
|
+
* direct children, who take it as a margin (`SPACE_PROPERTIES`).
|
|
84
85
|
*/
|
|
85
|
-
emit?: "plain" | "repeat" | "span" | "grid-fit" | "line-clamp" | "bg" | "none" | "border" | "px";
|
|
86
|
+
emit?: "plain" | "repeat" | "span" | "grid-fit" | "line-clamp" | "bg" | "none" | "border" | "px" | "space";
|
|
86
87
|
/**
|
|
87
88
|
* What the precedence chain ends in when neither the base nor an active tier
|
|
88
89
|
* sets the utility: a `px` utility that stands in for a token (`--focus-ring`
|
|
@@ -130,6 +131,8 @@ export interface Utility {
|
|
|
130
131
|
*/
|
|
131
132
|
aliases?: Readonly<Record<string, string>>;
|
|
132
133
|
}
|
|
134
|
+
/** The margin each `space` utility gives a container's children (all but the last). */
|
|
135
|
+
export declare const SPACE_PROPERTIES: Readonly<Record<string, string>>;
|
|
133
136
|
/**
|
|
134
137
|
* The utilities that compose into one `box-shadow` (the rings, shadow, and
|
|
135
138
|
* elevation): the composite's chains all end in a literal, so a tier alone
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["utilities.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,qDAAqD;AACrD,eAAO,MAAM,WAAW,YAAI,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAU,CAAC;AACpE,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtD;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAMrD,CAAC;AAEF,oDAAoD;AACpD,eAAO,MAAM,MAAM,YACjB,UAAU,EACV,UAAU,EACV,QAAQ,EACR,eAAe,EACf,cAAc,EACd,OAAO,EACP,SAAS,EACT,SAAS,EACT,MAAM,EACN,OAAO,CACC,CAAC;AACX,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5C;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,KAAK,EACL;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,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QAAQ,EAAE,kBAAkB;aAAE,UAAU,YAAG,UAAU,EAAE,UAAU,EAAE,QAAQ;EAChF,CAAC;AAEX,0DAA0D;AAC1D,eAAO,MAAM,eAAe,YAAI,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,CAAU,CAAC;AAC9F,eAAO,MAAM,eAAe,YAAI,MAAM,CAAU,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,cAAc,YAAI,MAAM,CAAU,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,YAAI,SAAS,CAAU,CAAC;AAE3D,qFAAqF;AACrF,eAAO,MAAM,SAAS,EAAE,SAAS,OAAO,EA8sBvC,CAAC;AAEF,oDAAoD;AACpD,eAAO,MAAM,WAAW,EAAE,SAAS,OAAO,EAEzC,CAAC;AAEF,eAAO,MAAM,YAAY,YAAI,QAAQ,EAAE,OAAO,CAAU,CAAC;AACzD,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,6DAA6D;AAC7D,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,CAM3D;AAED,qDAAqD;AACrD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,IAAI,CAAC;CACd;AAID,sGAAsG;AACtG,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAyBzD"}
|
package/src/base/utilities.js
CHANGED
|
@@ -103,6 +103,11 @@ export const FAMILY_TIERS = {
|
|
|
103
103
|
effects: "states",
|
|
104
104
|
box: "none",
|
|
105
105
|
};
|
|
106
|
+
/** The margin each `space` utility gives a container's children (all but the last). */
|
|
107
|
+
export const SPACE_PROPERTIES = {
|
|
108
|
+
"space-x": "margin-inline-end",
|
|
109
|
+
"space-y": "margin-block-end",
|
|
110
|
+
};
|
|
106
111
|
/**
|
|
107
112
|
* The utilities that compose into one `box-shadow` (the rings, shadow, and
|
|
108
113
|
* elevation): the composite's chains all end in a literal, so a tier alone
|
|
@@ -434,6 +439,25 @@ export const UTILITIES = [
|
|
|
434
439
|
{ name: "gap", properties: ["gap"], mode: "dual", family: "spacing", noBase: "0" },
|
|
435
440
|
{ name: "gap-x", properties: ["column-gap"], mode: "dual", family: "spacing", noBase: "0" },
|
|
436
441
|
{ name: "gap-y", properties: ["row-gap"], mode: "dual", family: "spacing", noBase: "0" },
|
|
442
|
+
// the margin between a container's direct children, Tailwind's space-x / space-y;
|
|
443
|
+
// states and breakpoints on the container. Before the margin family, so a
|
|
444
|
+
// child's own --mr / --mb wins.
|
|
445
|
+
{
|
|
446
|
+
name: "space-x",
|
|
447
|
+
properties: [],
|
|
448
|
+
mode: "dual",
|
|
449
|
+
family: "spacing",
|
|
450
|
+
emit: "space",
|
|
451
|
+
tiers: "both",
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
name: "space-y",
|
|
455
|
+
properties: [],
|
|
456
|
+
mode: "dual",
|
|
457
|
+
family: "spacing",
|
|
458
|
+
emit: "space",
|
|
459
|
+
tiers: "both",
|
|
460
|
+
},
|
|
437
461
|
{
|
|
438
462
|
name: "inset",
|
|
439
463
|
pseudo: true,
|
|
@@ -847,7 +871,7 @@ export const UTILITIES = [
|
|
|
847
871
|
family: "effects",
|
|
848
872
|
tiers: "both",
|
|
849
873
|
},
|
|
850
|
-
// box: no tiers
|
|
874
|
+
// box: no tiers, except radius (breakpoints) and z (states)
|
|
851
875
|
// a number is that many --spacing steps times --radius-multiplier, like the
|
|
852
876
|
// --radius-* tokens (`--radius: 2.5` is --radius-md); `full` is the pill token
|
|
853
877
|
{
|
|
@@ -901,7 +925,16 @@ export const UTILITIES = [
|
|
|
901
925
|
family: "box",
|
|
902
926
|
},
|
|
903
927
|
{ name: "visibility", pseudo: true, properties: ["visibility"], mode: "keyword", family: "box" },
|
|
904
|
-
|
|
928
|
+
// states, so a hovered, open, or focused item can sit above its neighbors
|
|
929
|
+
{
|
|
930
|
+
name: "z",
|
|
931
|
+
pseudo: true,
|
|
932
|
+
properties: ["z-index"],
|
|
933
|
+
mode: "raw",
|
|
934
|
+
family: "box",
|
|
935
|
+
tiers: "states",
|
|
936
|
+
noBase: "auto",
|
|
937
|
+
},
|
|
905
938
|
{ name: "object-fit", properties: ["object-fit"], mode: "keyword", family: "box" },
|
|
906
939
|
{ name: "object-position", properties: ["object-position"], mode: "raw", family: "box" },
|
|
907
940
|
// the divider between children for the divide-x / divide-y switches: the
|
package/src/base/utilities.ts
CHANGED
|
@@ -152,9 +152,20 @@ export interface Utility {
|
|
|
152
152
|
* width and color channels, and the side rules emit them. `px` feeds a
|
|
153
153
|
* composite too, as one signed length `--_<name>-w`: a number is that many
|
|
154
154
|
* pixels, a length passes through, and the sign carries meaning (a negative
|
|
155
|
-
* ring is inset).
|
|
155
|
+
* ring is inset). `space` is a dual value the container publishes for its
|
|
156
|
+
* direct children, who take it as a margin (`SPACE_PROPERTIES`).
|
|
156
157
|
*/
|
|
157
|
-
emit?:
|
|
158
|
+
emit?:
|
|
159
|
+
| "plain"
|
|
160
|
+
| "repeat"
|
|
161
|
+
| "span"
|
|
162
|
+
| "grid-fit"
|
|
163
|
+
| "line-clamp"
|
|
164
|
+
| "bg"
|
|
165
|
+
| "none"
|
|
166
|
+
| "border"
|
|
167
|
+
| "px"
|
|
168
|
+
| "space";
|
|
158
169
|
/**
|
|
159
170
|
* What the precedence chain ends in when neither the base nor an active tier
|
|
160
171
|
* sets the utility: a `px` utility that stands in for a token (`--focus-ring`
|
|
@@ -203,6 +214,12 @@ export interface Utility {
|
|
|
203
214
|
aliases?: Readonly<Record<string, string>>;
|
|
204
215
|
}
|
|
205
216
|
|
|
217
|
+
/** The margin each `space` utility gives a container's children (all but the last). */
|
|
218
|
+
export const SPACE_PROPERTIES: Readonly<Record<string, string>> = {
|
|
219
|
+
"space-x": "margin-inline-end",
|
|
220
|
+
"space-y": "margin-block-end",
|
|
221
|
+
};
|
|
222
|
+
|
|
206
223
|
/**
|
|
207
224
|
* The utilities that compose into one `box-shadow` (the rings, shadow, and
|
|
208
225
|
* elevation): the composite's chains all end in a literal, so a tier alone
|
|
@@ -547,6 +564,25 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
547
564
|
{ name: "gap", properties: ["gap"], mode: "dual", family: "spacing", noBase: "0" },
|
|
548
565
|
{ name: "gap-x", properties: ["column-gap"], mode: "dual", family: "spacing", noBase: "0" },
|
|
549
566
|
{ name: "gap-y", properties: ["row-gap"], mode: "dual", family: "spacing", noBase: "0" },
|
|
567
|
+
// the margin between a container's direct children, Tailwind's space-x / space-y;
|
|
568
|
+
// states and breakpoints on the container. Before the margin family, so a
|
|
569
|
+
// child's own --mr / --mb wins.
|
|
570
|
+
{
|
|
571
|
+
name: "space-x",
|
|
572
|
+
properties: [],
|
|
573
|
+
mode: "dual",
|
|
574
|
+
family: "spacing",
|
|
575
|
+
emit: "space",
|
|
576
|
+
tiers: "both",
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
name: "space-y",
|
|
580
|
+
properties: [],
|
|
581
|
+
mode: "dual",
|
|
582
|
+
family: "spacing",
|
|
583
|
+
emit: "space",
|
|
584
|
+
tiers: "both",
|
|
585
|
+
},
|
|
550
586
|
{
|
|
551
587
|
name: "inset",
|
|
552
588
|
pseudo: true,
|
|
@@ -960,7 +996,7 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
960
996
|
family: "effects",
|
|
961
997
|
tiers: "both",
|
|
962
998
|
},
|
|
963
|
-
// box: no tiers
|
|
999
|
+
// box: no tiers, except radius (breakpoints) and z (states)
|
|
964
1000
|
// a number is that many --spacing steps times --radius-multiplier, like the
|
|
965
1001
|
// --radius-* tokens (`--radius: 2.5` is --radius-md); `full` is the pill token
|
|
966
1002
|
{
|
|
@@ -1016,7 +1052,16 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
1016
1052
|
family: "box",
|
|
1017
1053
|
},
|
|
1018
1054
|
{ name: "visibility", pseudo: true, properties: ["visibility"], mode: "keyword", family: "box" },
|
|
1019
|
-
|
|
1055
|
+
// states, so a hovered, open, or focused item can sit above its neighbors
|
|
1056
|
+
{
|
|
1057
|
+
name: "z",
|
|
1058
|
+
pseudo: true,
|
|
1059
|
+
properties: ["z-index"],
|
|
1060
|
+
mode: "raw",
|
|
1061
|
+
family: "box",
|
|
1062
|
+
tiers: "states",
|
|
1063
|
+
noBase: "auto",
|
|
1064
|
+
},
|
|
1020
1065
|
{ name: "object-fit", properties: ["object-fit"], mode: "keyword", family: "box" },
|
|
1021
1066
|
{ name: "object-position", properties: ["object-position"], mode: "raw", family: "box" },
|
|
1022
1067
|
// the divider between children for the divide-x / divide-y switches: the
|
package/src/manifest.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["manifest.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AAIH;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAIlC,yEAAyE;AACzE,MAAM,WAAW,cAAc;IAC7B,6EAA6E;IAC7E,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,qDAAqD;IACrD,EAAE,EAAE,MAAM,EAAE,CAAC;IACb;;;;OAIG;IACH,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,0EAA0E;IAC1E,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB;;;;;OAKG;IACH,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,uDAAuD;IACvD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,uGAAuG;IACvG,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAgBD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,
|
|
1
|
+
{"version":3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C;IACnB;;;;OAIG;IACH,IAAI,EAAE,uBAAuB,CAAC;CAC/B;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,eAAe,EAE3C,CAAC;AAEF,qFAAqF;AACrF,eAAO,MAAM,SAAS,EAAE,MAAM,EAErB,CAAC;AAEV,eAAO,MAAM,iBAAiB,EAAE,MAAM,EA0CrC,CAAC;AAIF;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAoBxD;AAID,MAAM,MAAM,aAAa,GACrB,cAAc,GACd,UAAU,GACV,SAAS,GACT,iBAAiB,GACjB,OAAO,GACP,QAAQ,GACR,UAAU,GACV,UAAU,GACV,UAAU,GACV,MAAM,GACN,aAAa,GACb,KAAK,GACL,UAAU,GACV,MAAM,GACN,SAAS,CAAC;AAEd;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC,CAmC/E,CAAC"}
|
package/src/manifest.js
CHANGED
|
@@ -532,6 +532,7 @@ export const PRIMITIVES = {
|
|
|
532
532
|
"primitives/utilities/responsive-flex.html",
|
|
533
533
|
"primitives/utilities/responsive-grid.html",
|
|
534
534
|
"primitives/utilities/size.html",
|
|
535
|
+
"primitives/utilities/space.html",
|
|
535
536
|
"primitives/utilities/width.html",
|
|
536
537
|
],
|
|
537
538
|
},
|
package/src/manifest.ts
CHANGED
|
@@ -568,6 +568,7 @@ export const PRIMITIVES: Record<string, PrimitiveEntry> = {
|
|
|
568
568
|
"primitives/utilities/responsive-flex.html",
|
|
569
569
|
"primitives/utilities/responsive-grid.html",
|
|
570
570
|
"primitives/utilities/size.html",
|
|
571
|
+
"primitives/utilities/space.html",
|
|
571
572
|
"primitives/utilities/width.html",
|
|
572
573
|
],
|
|
573
574
|
},
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
--ui-badge-leading: 1;
|
|
25
25
|
|
|
26
26
|
--ui-badge-bg: var(--color-background);
|
|
27
|
-
--ui-badge-bg--hover: var(--color-
|
|
28
|
-
--ui-badge-bg--active: oklch(from var(--color-
|
|
27
|
+
--ui-badge-bg--hover: oklch(from var(--color-background) calc(l - 0.025) c h);
|
|
28
|
+
--ui-badge-bg--active: oklch(from var(--color-background) calc(l - 0.05) c h);
|
|
29
29
|
|
|
30
30
|
--ui-badge-text: var(--color-foreground);
|
|
31
31
|
--ui-badge-text--hover: var(--color-foreground);
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
--ui-badge-px: calc(var(--spacing) * 1.25);
|
|
43
43
|
--ui-badge-h: calc(var(--spacing) * 5);
|
|
44
44
|
--ui-badge-radius: var(--radius-sm);
|
|
45
|
+
--ui-badge-background-clip: border-box;
|
|
45
46
|
|
|
46
47
|
--ui-badge-icon-size: calc(var(--spacing) * 3);
|
|
47
48
|
|
|
@@ -151,6 +152,11 @@
|
|
|
151
152
|
inherits: false;
|
|
152
153
|
}
|
|
153
154
|
|
|
155
|
+
@property --_badge-background-clip {
|
|
156
|
+
syntax: "*";
|
|
157
|
+
inherits: false;
|
|
158
|
+
}
|
|
159
|
+
|
|
154
160
|
@property --_badge-icon-size {
|
|
155
161
|
syntax: "*";
|
|
156
162
|
inherits: false;
|
|
@@ -212,7 +218,10 @@
|
|
|
212
218
|
|
|
213
219
|
color: var(--_text-resolved, var(--_badge-text, var(--ui-badge-text)));
|
|
214
220
|
background-color: var(--_bg-resolved, var(--_badge-bg, var(--ui-badge-bg)));
|
|
215
|
-
background-clip:
|
|
221
|
+
background-clip: var(
|
|
222
|
+
--_background-clip-resolved,
|
|
223
|
+
var(--_badge-background-clip, var(--ui-badge-background-clip))
|
|
224
|
+
);
|
|
216
225
|
white-space-collapse: collapse;
|
|
217
226
|
|
|
218
227
|
/* The ring is published to --_focus-shadow so the utilities layer's
|
|
@@ -317,8 +326,14 @@
|
|
|
317
326
|
|
|
318
327
|
:where([data-ui~="badge"][data-badge-variant="primary"]) {
|
|
319
328
|
--_badge-bg: var(--color-primary);
|
|
320
|
-
--_badge-bg--hover:
|
|
321
|
-
|
|
329
|
+
--_badge-bg--hover: light-dark(
|
|
330
|
+
oklch(from var(--color-primary) calc(l + (1 - l) * 0.2) c h),
|
|
331
|
+
oklch(from var(--color-primary) calc(l * 0.8) c h)
|
|
332
|
+
);
|
|
333
|
+
--_badge-bg--active: light-dark(
|
|
334
|
+
oklch(from var(--color-primary) calc(l + (1 - l) * 0.3) c h),
|
|
335
|
+
oklch(from var(--color-primary) calc(l * 0.7) c h)
|
|
336
|
+
);
|
|
322
337
|
|
|
323
338
|
--_badge-text: var(--color-primary-foreground);
|
|
324
339
|
--_badge-text--hover: var(--color-primary-foreground);
|
|
@@ -331,8 +346,14 @@
|
|
|
331
346
|
|
|
332
347
|
:where([data-ui~="badge"][data-badge-variant="secondary"]) {
|
|
333
348
|
--_badge-bg: var(--color-secondary);
|
|
334
|
-
--_badge-bg--hover:
|
|
335
|
-
|
|
349
|
+
--_badge-bg--hover: light-dark(
|
|
350
|
+
oklch(from var(--color-secondary) calc(l + (1 - l) * 0.2) c h),
|
|
351
|
+
oklch(from var(--color-secondary) calc(l * 0.8) c h)
|
|
352
|
+
);
|
|
353
|
+
--_badge-bg--active: light-dark(
|
|
354
|
+
oklch(from var(--color-secondary) calc(l + (1 - l) * 0.3) c h),
|
|
355
|
+
oklch(from var(--color-secondary) calc(l * 0.7) c h)
|
|
356
|
+
);
|
|
336
357
|
|
|
337
358
|
--_badge-text: var(--color-secondary-foreground);
|
|
338
359
|
--_badge-text--hover: var(--color-secondary-foreground);
|
|
@@ -345,8 +366,14 @@
|
|
|
345
366
|
|
|
346
367
|
:where([data-ui~="badge"][data-badge-variant="tertiary"]) {
|
|
347
368
|
--_badge-bg: var(--color-tertiary);
|
|
348
|
-
--_badge-bg--hover:
|
|
349
|
-
|
|
369
|
+
--_badge-bg--hover: light-dark(
|
|
370
|
+
oklch(from var(--color-tertiary) calc(l + (1 - l) * 0.2) c h),
|
|
371
|
+
oklch(from var(--color-tertiary) calc(l * 0.8) c h)
|
|
372
|
+
);
|
|
373
|
+
--_badge-bg--active: light-dark(
|
|
374
|
+
oklch(from var(--color-tertiary) calc(l + (1 - l) * 0.3) c h),
|
|
375
|
+
oklch(from var(--color-tertiary) calc(l * 0.7) c h)
|
|
376
|
+
);
|
|
350
377
|
|
|
351
378
|
--_badge-text: var(--color-tertiary-foreground);
|
|
352
379
|
--_badge-text--hover: var(--color-tertiary-foreground);
|
|
@@ -358,9 +385,13 @@
|
|
|
358
385
|
}
|
|
359
386
|
|
|
360
387
|
:where([data-ui~="badge"][data-badge-variant="muted"]) {
|
|
361
|
-
|
|
362
|
-
--_badge-bg
|
|
363
|
-
|
|
388
|
+
/* --color-muted flattened onto the page so the surface stays opaque */
|
|
389
|
+
--_badge-bg: light-dark(
|
|
390
|
+
color-mix(in srgb, var(--color-foreground) 5%, var(--color-background)),
|
|
391
|
+
color-mix(in srgb, var(--color-foreground) 10%, var(--color-background))
|
|
392
|
+
);
|
|
393
|
+
--_badge-bg--hover: oklch(from var(--_badge-bg) calc(l - 0.025) c h);
|
|
394
|
+
--_badge-bg--active: oklch(from var(--_badge-bg) calc(l - 0.05) c h);
|
|
364
395
|
|
|
365
396
|
--_badge-text: var(--color-foreground);
|
|
366
397
|
--_badge-text--hover: var(--color-foreground);
|
|
@@ -373,8 +404,12 @@
|
|
|
373
404
|
|
|
374
405
|
:where([data-ui~="badge"][data-badge-variant="ghost"]) {
|
|
375
406
|
--_badge-bg: transparent;
|
|
376
|
-
|
|
377
|
-
--_badge-bg--
|
|
407
|
+
/* the muted variant's opaque surface */
|
|
408
|
+
--_badge-bg--hover: light-dark(
|
|
409
|
+
color-mix(in srgb, var(--color-foreground) 5%, var(--color-background)),
|
|
410
|
+
color-mix(in srgb, var(--color-foreground) 10%, var(--color-background))
|
|
411
|
+
);
|
|
412
|
+
--_badge-bg--active: oklch(from var(--_badge-bg--hover) calc(l - 0.025) c h);
|
|
378
413
|
|
|
379
414
|
--_badge-text: var(--color-foreground);
|
|
380
415
|
--_badge-text--hover: var(--color-foreground);
|
|
@@ -386,7 +421,8 @@
|
|
|
386
421
|
}
|
|
387
422
|
|
|
388
423
|
/* Status variants (info, success, warning, destructive) share one soft
|
|
389
|
-
design: the status color
|
|
424
|
+
design: the status color mixed 10% (20% in dark) into the page background
|
|
425
|
+
as an opaque surface, and
|
|
390
426
|
the status hue as the text with its lightness clamped (at most 0.45 in
|
|
391
427
|
light, at least 0.82 in dark) so it holds 4.5:1 on the tint and on the
|
|
392
428
|
hover and active steps; status-contrast.browser.test.ts checks it. No border. One rule derives the states from the
|
|
@@ -399,8 +435,8 @@
|
|
|
399
435
|
[data-badge-variant="destructive"]
|
|
400
436
|
)
|
|
401
437
|
) {
|
|
402
|
-
--_badge-bg--hover: oklch(from var(--_badge-bg)
|
|
403
|
-
--_badge-bg--active: oklch(from var(--_badge-bg)
|
|
438
|
+
--_badge-bg--hover: oklch(from var(--_badge-bg) calc(l - 0.025) c h);
|
|
439
|
+
--_badge-bg--active: oklch(from var(--_badge-bg) calc(l - 0.05) c h);
|
|
404
440
|
|
|
405
441
|
--_badge-text--hover: var(--_badge-text);
|
|
406
442
|
--_badge-text--active: var(--_badge-text);
|
|
@@ -415,8 +451,8 @@
|
|
|
415
451
|
:where([data-ui~="badge"][data-badge-variant="info"]) {
|
|
416
452
|
--_badge-ring-color: var(--color-info);
|
|
417
453
|
--_badge-bg: light-dark(
|
|
418
|
-
|
|
419
|
-
|
|
454
|
+
color-mix(in srgb, var(--color-info) 10%, var(--color-background)),
|
|
455
|
+
color-mix(in srgb, var(--color-info) 20%, var(--color-background))
|
|
420
456
|
);
|
|
421
457
|
--_badge-text: light-dark(
|
|
422
458
|
oklch(from var(--color-info) min(l, 0.45) c h),
|
|
@@ -427,8 +463,8 @@
|
|
|
427
463
|
:where([data-ui~="badge"][data-badge-variant="success"]) {
|
|
428
464
|
--_badge-ring-color: var(--color-success);
|
|
429
465
|
--_badge-bg: light-dark(
|
|
430
|
-
|
|
431
|
-
|
|
466
|
+
color-mix(in srgb, var(--color-success) 10%, var(--color-background)),
|
|
467
|
+
color-mix(in srgb, var(--color-success) 20%, var(--color-background))
|
|
432
468
|
);
|
|
433
469
|
--_badge-text: light-dark(
|
|
434
470
|
oklch(from var(--color-success) min(l, 0.45) c h),
|
|
@@ -439,8 +475,8 @@
|
|
|
439
475
|
:where([data-ui~="badge"][data-badge-variant="warning"]) {
|
|
440
476
|
--_badge-ring-color: var(--color-warning);
|
|
441
477
|
--_badge-bg: light-dark(
|
|
442
|
-
|
|
443
|
-
|
|
478
|
+
color-mix(in srgb, var(--color-warning) 10%, var(--color-background)),
|
|
479
|
+
color-mix(in srgb, var(--color-warning) 20%, var(--color-background))
|
|
444
480
|
);
|
|
445
481
|
--_badge-text: light-dark(
|
|
446
482
|
oklch(from var(--color-warning) min(l, 0.45) c h),
|
|
@@ -451,8 +487,8 @@
|
|
|
451
487
|
:where([data-ui~="badge"][data-badge-variant="destructive"]) {
|
|
452
488
|
--_badge-ring-color: var(--color-destructive);
|
|
453
489
|
--_badge-bg: light-dark(
|
|
454
|
-
|
|
455
|
-
|
|
490
|
+
color-mix(in srgb, var(--color-destructive) 10%, var(--color-background)),
|
|
491
|
+
color-mix(in srgb, var(--color-destructive) 20%, var(--color-background))
|
|
456
492
|
);
|
|
457
493
|
--_badge-text: light-dark(
|
|
458
494
|
oklch(from var(--color-destructive) min(l, 0.45) c h),
|
|
@@ -466,8 +502,14 @@
|
|
|
466
502
|
--_badge-bg--active: transparent;
|
|
467
503
|
|
|
468
504
|
--_badge-text: var(--color-foreground);
|
|
469
|
-
--_badge-text--hover:
|
|
470
|
-
|
|
505
|
+
--_badge-text--hover: light-dark(
|
|
506
|
+
oklch(from var(--color-primary) calc(l + (1 - l) * 0.4) c h),
|
|
507
|
+
oklch(from var(--color-primary) calc(l * 0.6) c h)
|
|
508
|
+
);
|
|
509
|
+
--_badge-text--active: light-dark(
|
|
510
|
+
oklch(from var(--color-primary) calc(l + (1 - l) * 0.5) c h),
|
|
511
|
+
oklch(from var(--color-primary) calc(l * 0.5) c h)
|
|
512
|
+
);
|
|
471
513
|
|
|
472
514
|
--_badge-border-style: none;
|
|
473
515
|
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
--ui-button-px: var(--ui-field-px);
|
|
48
48
|
--ui-button-min-h: var(--ui-field-h);
|
|
49
49
|
--ui-button-radius: var(--ui-field-radius);
|
|
50
|
+
--ui-button-background-clip: padding-box;
|
|
50
51
|
|
|
51
52
|
--ui-button-icon-size: var(--ui-field-icon-size);
|
|
52
53
|
|
|
@@ -157,6 +158,11 @@
|
|
|
157
158
|
inherits: false;
|
|
158
159
|
}
|
|
159
160
|
|
|
161
|
+
@property --_button-background-clip {
|
|
162
|
+
syntax: "*";
|
|
163
|
+
inherits: false;
|
|
164
|
+
}
|
|
165
|
+
|
|
160
166
|
@property --_button-icon-size {
|
|
161
167
|
syntax: "*";
|
|
162
168
|
inherits: false;
|
|
@@ -218,7 +224,10 @@
|
|
|
218
224
|
|
|
219
225
|
color: var(--_text-resolved, var(--_button-text, var(--ui-button-text)));
|
|
220
226
|
background-color: var(--_bg-resolved, var(--_button-bg, var(--ui-button-bg)));
|
|
221
|
-
background-clip:
|
|
227
|
+
background-clip: var(
|
|
228
|
+
--_background-clip-resolved,
|
|
229
|
+
var(--_button-background-clip, var(--ui-button-background-clip))
|
|
230
|
+
);
|
|
222
231
|
white-space-collapse: collapse;
|
|
223
232
|
|
|
224
233
|
/* The ring is published to --_focus-shadow so the utilities layer's
|
|
@@ -337,8 +346,14 @@
|
|
|
337
346
|
|
|
338
347
|
:where([data-ui~="button"][data-button-variant="primary"]) {
|
|
339
348
|
--_button-bg: var(--color-primary);
|
|
340
|
-
--_button-bg--hover:
|
|
341
|
-
|
|
349
|
+
--_button-bg--hover: light-dark(
|
|
350
|
+
oklch(from var(--color-primary) calc(l + (1 - l) * 0.2) c h),
|
|
351
|
+
oklch(from var(--color-primary) calc(l * 0.8) c h)
|
|
352
|
+
);
|
|
353
|
+
--_button-bg--active: light-dark(
|
|
354
|
+
oklch(from var(--color-primary) calc(l + (1 - l) * 0.3) c h),
|
|
355
|
+
oklch(from var(--color-primary) calc(l * 0.7) c h)
|
|
356
|
+
);
|
|
342
357
|
|
|
343
358
|
--_button-text: var(--color-primary-foreground);
|
|
344
359
|
--_button-text--hover: var(--color-primary-foreground);
|
|
@@ -353,8 +368,14 @@
|
|
|
353
368
|
|
|
354
369
|
:where([data-ui~="button"][data-button-variant="secondary"]) {
|
|
355
370
|
--_button-bg: var(--color-secondary);
|
|
356
|
-
--_button-bg--hover:
|
|
357
|
-
|
|
371
|
+
--_button-bg--hover: light-dark(
|
|
372
|
+
oklch(from var(--color-secondary) calc(l + (1 - l) * 0.2) c h),
|
|
373
|
+
oklch(from var(--color-secondary) calc(l * 0.8) c h)
|
|
374
|
+
);
|
|
375
|
+
--_button-bg--active: light-dark(
|
|
376
|
+
oklch(from var(--color-secondary) calc(l + (1 - l) * 0.3) c h),
|
|
377
|
+
oklch(from var(--color-secondary) calc(l * 0.7) c h)
|
|
378
|
+
);
|
|
358
379
|
|
|
359
380
|
--_button-text: var(--color-secondary-foreground);
|
|
360
381
|
--_button-text--hover: var(--color-secondary-foreground);
|
|
@@ -369,8 +390,14 @@
|
|
|
369
390
|
|
|
370
391
|
:where([data-ui~="button"][data-button-variant="tertiary"]) {
|
|
371
392
|
--_button-bg: var(--color-tertiary);
|
|
372
|
-
--_button-bg--hover:
|
|
373
|
-
|
|
393
|
+
--_button-bg--hover: light-dark(
|
|
394
|
+
oklch(from var(--color-tertiary) calc(l + (1 - l) * 0.2) c h),
|
|
395
|
+
oklch(from var(--color-tertiary) calc(l * 0.8) c h)
|
|
396
|
+
);
|
|
397
|
+
--_button-bg--active: light-dark(
|
|
398
|
+
oklch(from var(--color-tertiary) calc(l + (1 - l) * 0.3) c h),
|
|
399
|
+
oklch(from var(--color-tertiary) calc(l * 0.7) c h)
|
|
400
|
+
);
|
|
374
401
|
|
|
375
402
|
--_button-text: var(--color-tertiary-foreground);
|
|
376
403
|
--_button-text--hover: var(--color-tertiary-foreground);
|
|
@@ -384,9 +411,13 @@
|
|
|
384
411
|
}
|
|
385
412
|
|
|
386
413
|
:where([data-ui~="button"][data-button-variant="muted"]) {
|
|
387
|
-
|
|
388
|
-
--_button-bg
|
|
389
|
-
|
|
414
|
+
/* --color-muted flattened onto the page so the surface stays opaque */
|
|
415
|
+
--_button-bg: light-dark(
|
|
416
|
+
color-mix(in srgb, var(--color-foreground) 5%, var(--color-background)),
|
|
417
|
+
color-mix(in srgb, var(--color-foreground) 10%, var(--color-background))
|
|
418
|
+
);
|
|
419
|
+
--_button-bg--hover: oklch(from var(--_button-bg) calc(l - 0.025) c h);
|
|
420
|
+
--_button-bg--active: oklch(from var(--_button-bg) calc(l - 0.05) c h);
|
|
390
421
|
|
|
391
422
|
--_button-text: var(--color-foreground);
|
|
392
423
|
--_button-text--hover: var(--color-foreground);
|
|
@@ -401,8 +432,12 @@
|
|
|
401
432
|
|
|
402
433
|
:where([data-ui~="button"][data-button-variant="ghost"]) {
|
|
403
434
|
--_button-bg: transparent;
|
|
404
|
-
|
|
405
|
-
--_button-bg--
|
|
435
|
+
/* the muted variant's opaque surface */
|
|
436
|
+
--_button-bg--hover: light-dark(
|
|
437
|
+
color-mix(in srgb, var(--color-foreground) 5%, var(--color-background)),
|
|
438
|
+
color-mix(in srgb, var(--color-foreground) 10%, var(--color-background))
|
|
439
|
+
);
|
|
440
|
+
--_button-bg--active: oklch(from var(--_button-bg--hover) calc(l - 0.025) c h);
|
|
406
441
|
|
|
407
442
|
--_button-text: var(--color-foreground);
|
|
408
443
|
--_button-text--hover: var(--color-foreground);
|
|
@@ -416,7 +451,8 @@
|
|
|
416
451
|
}
|
|
417
452
|
|
|
418
453
|
/* Status variants (info, success, warning, destructive) share one soft
|
|
419
|
-
design: the status color
|
|
454
|
+
design: the status color mixed 10% (20% in dark) into the page background
|
|
455
|
+
as an opaque surface, and
|
|
420
456
|
the status hue as the text with its lightness clamped (at most 0.45 in
|
|
421
457
|
light, at least 0.82 in dark) so it holds 4.5:1 on the tint and on the
|
|
422
458
|
hover and active steps; status-contrast.browser.test.ts checks it. No border. One rule derives the states from the
|
|
@@ -429,8 +465,8 @@
|
|
|
429
465
|
[data-button-variant="destructive"]
|
|
430
466
|
)
|
|
431
467
|
) {
|
|
432
|
-
--_button-bg--hover: oklch(from var(--_button-bg)
|
|
433
|
-
--_button-bg--active: oklch(from var(--_button-bg)
|
|
468
|
+
--_button-bg--hover: oklch(from var(--_button-bg) calc(l - 0.025) c h);
|
|
469
|
+
--_button-bg--active: oklch(from var(--_button-bg) calc(l - 0.05) c h);
|
|
434
470
|
|
|
435
471
|
--_button-text--hover: var(--_button-text);
|
|
436
472
|
--_button-text--active: var(--_button-text);
|
|
@@ -445,8 +481,8 @@
|
|
|
445
481
|
:where([data-ui~="button"][data-button-variant="info"]) {
|
|
446
482
|
--_button-ring-color: var(--color-info);
|
|
447
483
|
--_button-bg: light-dark(
|
|
448
|
-
|
|
449
|
-
|
|
484
|
+
color-mix(in srgb, var(--color-info) 10%, var(--color-background)),
|
|
485
|
+
color-mix(in srgb, var(--color-info) 20%, var(--color-background))
|
|
450
486
|
);
|
|
451
487
|
--_button-text: light-dark(
|
|
452
488
|
oklch(from var(--color-info) min(l, 0.45) c h),
|
|
@@ -457,8 +493,8 @@
|
|
|
457
493
|
:where([data-ui~="button"][data-button-variant="success"]) {
|
|
458
494
|
--_button-ring-color: var(--color-success);
|
|
459
495
|
--_button-bg: light-dark(
|
|
460
|
-
|
|
461
|
-
|
|
496
|
+
color-mix(in srgb, var(--color-success) 10%, var(--color-background)),
|
|
497
|
+
color-mix(in srgb, var(--color-success) 20%, var(--color-background))
|
|
462
498
|
);
|
|
463
499
|
--_button-text: light-dark(
|
|
464
500
|
oklch(from var(--color-success) min(l, 0.45) c h),
|
|
@@ -469,8 +505,8 @@
|
|
|
469
505
|
:where([data-ui~="button"][data-button-variant="warning"]) {
|
|
470
506
|
--_button-ring-color: var(--color-warning);
|
|
471
507
|
--_button-bg: light-dark(
|
|
472
|
-
|
|
473
|
-
|
|
508
|
+
color-mix(in srgb, var(--color-warning) 10%, var(--color-background)),
|
|
509
|
+
color-mix(in srgb, var(--color-warning) 20%, var(--color-background))
|
|
474
510
|
);
|
|
475
511
|
--_button-text: light-dark(
|
|
476
512
|
oklch(from var(--color-warning) min(l, 0.45) c h),
|
|
@@ -481,8 +517,8 @@
|
|
|
481
517
|
:where([data-ui~="button"][data-button-variant="destructive"]) {
|
|
482
518
|
--_button-ring-color: var(--color-destructive);
|
|
483
519
|
--_button-bg: light-dark(
|
|
484
|
-
|
|
485
|
-
|
|
520
|
+
color-mix(in srgb, var(--color-destructive) 10%, var(--color-background)),
|
|
521
|
+
color-mix(in srgb, var(--color-destructive) 20%, var(--color-background))
|
|
486
522
|
);
|
|
487
523
|
--_button-text: light-dark(
|
|
488
524
|
oklch(from var(--color-destructive) min(l, 0.45) c h),
|
|
@@ -496,8 +532,14 @@
|
|
|
496
532
|
--_button-bg--active: transparent;
|
|
497
533
|
|
|
498
534
|
--_button-text: var(--color-foreground);
|
|
499
|
-
--_button-text--hover:
|
|
500
|
-
|
|
535
|
+
--_button-text--hover: light-dark(
|
|
536
|
+
oklch(from var(--color-primary) calc(l + (1 - l) * 0.4) c h),
|
|
537
|
+
oklch(from var(--color-primary) calc(l * 0.6) c h)
|
|
538
|
+
);
|
|
539
|
+
--_button-text--active: light-dark(
|
|
540
|
+
oklch(from var(--color-primary) calc(l + (1 - l) * 0.5) c h),
|
|
541
|
+
oklch(from var(--color-primary) calc(l * 0.5) c h)
|
|
542
|
+
);
|
|
501
543
|
|
|
502
544
|
--_button-border-style: none;
|
|
503
545
|
|