@zazz-ui/core 0.12.3 → 0.13.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 +6 -6
- package/CHANGELOG.md +40 -0
- package/README.md +8 -6
- package/dist/sri.json +51 -51
- package/dist/zazz.css +1 -1
- package/dist/zazz.js +1 -1
- package/editor/zazz.css-data.json +1238 -3564
- package/editor/zazz.html-data.json +9 -0
- package/editor/zazz.language-data.json +21 -8
- package/editor/zazz.lint-data.json +1139 -1110
- package/package.json +5 -5
- package/src/base/_defaults.css +0 -83
- package/src/base/_properties-2xl.css +0 -8
- package/src/base/_properties-active.css +0 -4
- package/src/base/_properties-checked.css +0 -4
- package/src/base/_properties-current.css +0 -4
- package/src/base/_properties-disabled.css +0 -4
- package/src/base/_properties-focus-visible.css +0 -4
- package/src/base/_properties-focus-within.css +0 -4
- package/src/base/_properties-hover.css +0 -4
- package/src/base/_properties-lg.css +0 -8
- package/src/base/_properties-md.css +0 -8
- package/src/base/_properties-open.css +0 -4
- package/src/base/_properties-sm.css +0 -8
- package/src/base/_properties-starting.css +0 -26
- package/src/base/_properties-stuck.css +0 -2
- package/src/base/_properties-xl.css +0 -8
- package/src/base/_properties.css +23 -0
- package/src/base/_utilities-box.css +1 -6
- package/src/base/_utilities-color.css +1 -1
- package/src/base/_utilities-effects.css +7 -7
- package/src/base/_utilities-flow.css +54 -11
- package/src/base/_utilities-grid.css +5 -85
- package/src/base/_utilities-tier-2xl.css +0 -4
- package/src/base/_utilities-tier-active.css +0 -2
- package/src/base/_utilities-tier-checked.css +0 -2
- package/src/base/_utilities-tier-current.css +0 -2
- package/src/base/_utilities-tier-disabled.css +0 -2
- package/src/base/_utilities-tier-focus-visible.css +0 -2
- package/src/base/_utilities-tier-focus-within.css +0 -2
- package/src/base/_utilities-tier-hover.css +0 -2
- package/src/base/_utilities-tier-lg.css +0 -4
- package/src/base/_utilities-tier-md.css +0 -4
- package/src/base/_utilities-tier-open.css +0 -2
- package/src/base/_utilities-tier-sm.css +0 -4
- package/src/base/_utilities-tier-starting.css +0 -13
- package/src/base/_utilities-tier-stuck.css +0 -1
- package/src/base/_utilities-tier-xl.css +0 -4
- package/src/base/_utilities-typography.css +4 -8
- package/src/base/embla.d.ts.map +1 -1
- package/src/base/embla.js +223 -65
- package/src/base/embla.ts +245 -62
- package/src/base/kit-styling.d.ts.map +1 -1
- package/src/base/kit-styling.js +154 -150
- package/src/base/kit-styling.ts +154 -150
- package/src/base/utilities.d.ts +23 -7
- package/src/base/utilities.d.ts.map +1 -1
- package/src/base/utilities.js +91 -22
- package/src/base/utilities.ts +101 -23
- package/src/head.js +8 -8
- package/src/head.ts +8 -8
- package/src/manifest.d.ts.map +1 -1
- package/src/manifest.js +7 -1
- package/src/manifest.ts +7 -1
- package/src/primitives/carousel/carousel.css +4 -3
- package/src/primitives/carousel/carousel.d.ts +2 -1
- package/src/primitives/carousel/carousel.d.ts.map +1 -1
- package/src/primitives/carousel/carousel.js +2 -1
- package/src/primitives/carousel/carousel.ts +2 -1
- package/src/primitives/debug/audit-core.d.ts.map +1 -1
- package/src/primitives/debug/audit-core.js +46 -4
- package/src/primitives/debug/audit-core.ts +53 -4
- package/src/primitives/lightbox/lightbox.js +2 -2
- package/src/primitives/lightbox/lightbox.ts +2 -2
- package/src/primitives/tabs/tabs-underline.html +117 -0
- package/src/primitives/tabs/tabs.css +119 -27
- package/src/primitives/toggle/toggle.css +153 -40
- package/src/primitives/utilities/flex-direction.html +1 -1
- package/src/primitives/utilities/flex-reverse.html +136 -0
- package/src/primitives/utilities/gallery.html +289 -0
- package/src/primitives/utilities/inline-flex.html +45 -0
- package/src/primitives/utilities/subgrid-col.html +109 -0
- package/src/primitives/utilities/subgrid-row.html +98 -0
- package/src/primitives/utilities/subgrid.html +135 -0
package/src/base/utilities.js
CHANGED
|
@@ -219,6 +219,31 @@ export const DISPLAY_SHORTHANDS = {
|
|
|
219
219
|
"inline-flex-col": ["inline-flex", "column"],
|
|
220
220
|
"inline-flex-col-reverse": ["inline-flex", "column-reverse"],
|
|
221
221
|
};
|
|
222
|
+
/**
|
|
223
|
+
* `--display: grid-gallery`: a grid that picks its column count from its
|
|
224
|
+
* child count, up to `GALLERY_MAX` in a row where they fit at the minimum
|
|
225
|
+
* width (`--ui-gallery-min-w`, `GALLERY_MIN` by default).
|
|
226
|
+
*/
|
|
227
|
+
export const DISPLAY_GALLERY = "grid-gallery";
|
|
228
|
+
export const GALLERY_MAX = 6;
|
|
229
|
+
export const GALLERY_MIN = "20ch";
|
|
230
|
+
/**
|
|
231
|
+
* `--display` keywords for a grid that takes its tracks from the parent grid:
|
|
232
|
+
* `[columns, rows]`, true where the axis is `subgrid`. They follow `flex`,
|
|
233
|
+
* `flex-col`, `flex-row`; the bare keyword, a prefix of the others, comes first.
|
|
234
|
+
*/
|
|
235
|
+
export const DISPLAY_SUBGRIDS = {
|
|
236
|
+
subgrid: [true, true],
|
|
237
|
+
"subgrid-col": [true, false],
|
|
238
|
+
"subgrid-row": [false, true],
|
|
239
|
+
};
|
|
240
|
+
/** Every `--display` value the kit matches as text, besides the CSS keywords. */
|
|
241
|
+
export const DISPLAY_WORDS = [
|
|
242
|
+
...Object.keys(DISPLAY_SHORTHANDS),
|
|
243
|
+
DISPLAY_PILE,
|
|
244
|
+
DISPLAY_GALLERY,
|
|
245
|
+
...Object.keys(DISPLAY_SUBGRIDS),
|
|
246
|
+
];
|
|
222
247
|
/** The border shorthands, all sides first. */
|
|
223
248
|
export const BORDER_SHORTHANDS = [
|
|
224
249
|
"border",
|
|
@@ -249,12 +274,6 @@ export const MARGIN_KEYWORDS = ["auto"];
|
|
|
249
274
|
* substrings (SPEC claim 16), so the axis and `--inset` shorthands go without.
|
|
250
275
|
*/
|
|
251
276
|
export const INSET_KEYWORDS = ["auto"];
|
|
252
|
-
/**
|
|
253
|
-
* Track-list keywords `--grid-cols` / `--grid-rows` take besides a count. `none`
|
|
254
|
-
* is not one: `--template-cols: none` says the same, and every keyword
|
|
255
|
-
* costs a rule per breakpoint (SPEC claim 16).
|
|
256
|
-
*/
|
|
257
|
-
export const GRID_TEMPLATE_KEYWORDS = ["subgrid"];
|
|
258
277
|
/** The utility table. Order within a family is emission order (shorthands first). */
|
|
259
278
|
export const UTILITIES = [
|
|
260
279
|
// flow: keywords and raw values; most are on the no-base allowlist
|
|
@@ -272,13 +291,15 @@ export const UTILITIES = [
|
|
|
272
291
|
// current) element can claim the anchor a toolbar or popover is tethered to.
|
|
273
292
|
// `normal` is position-anchor's initial value. Engines on the older draft
|
|
274
293
|
// don't know it, so the declaration is invalid at computed-value time and
|
|
275
|
-
// falls back to their initial value, `auto`.
|
|
294
|
+
// falls back to their initial value, `auto`. No starting tier on the three:
|
|
295
|
+
// they are discrete, so there is nothing to transition from.
|
|
276
296
|
{
|
|
277
297
|
name: "anchor-name",
|
|
278
298
|
properties: ["anchor-name"],
|
|
279
299
|
mode: "raw",
|
|
280
300
|
family: "flow",
|
|
281
301
|
tiers: "both",
|
|
302
|
+
omitTiers: ["starting"],
|
|
282
303
|
noBase: "none",
|
|
283
304
|
},
|
|
284
305
|
{
|
|
@@ -287,6 +308,7 @@ export const UTILITIES = [
|
|
|
287
308
|
mode: "raw",
|
|
288
309
|
family: "flow",
|
|
289
310
|
tiers: "both",
|
|
311
|
+
omitTiers: ["starting"],
|
|
290
312
|
noBase: "normal",
|
|
291
313
|
},
|
|
292
314
|
// where the tethered element sits on its anchor's 3×3 grid (`block-start
|
|
@@ -297,6 +319,7 @@ export const UTILITIES = [
|
|
|
297
319
|
mode: "raw",
|
|
298
320
|
family: "flow",
|
|
299
321
|
tiers: "both",
|
|
322
|
+
omitTiers: ["starting"],
|
|
300
323
|
noBase: "none",
|
|
301
324
|
},
|
|
302
325
|
{
|
|
@@ -404,7 +427,7 @@ export const UTILITIES = [
|
|
|
404
427
|
noBase: "auto",
|
|
405
428
|
},
|
|
406
429
|
{ name: "row-end", properties: ["grid-row-end"], mode: "raw", family: "flow", noBase: "auto" },
|
|
407
|
-
// grid: integers become repeat() (
|
|
430
|
+
// grid: integers become repeat() (subgrid is a --display keyword); templates are raw;
|
|
408
431
|
// grid-fit packs auto-fit columns
|
|
409
432
|
{
|
|
410
433
|
name: "grid-cols",
|
|
@@ -413,7 +436,6 @@ export const UTILITIES = [
|
|
|
413
436
|
family: "grid",
|
|
414
437
|
emit: "repeat",
|
|
415
438
|
noBase: "1",
|
|
416
|
-
keywords: GRID_TEMPLATE_KEYWORDS,
|
|
417
439
|
},
|
|
418
440
|
{
|
|
419
441
|
name: "grid-rows",
|
|
@@ -422,7 +444,6 @@ export const UTILITIES = [
|
|
|
422
444
|
family: "grid",
|
|
423
445
|
emit: "repeat",
|
|
424
446
|
noBase: "1",
|
|
425
|
-
keywords: GRID_TEMPLATE_KEYWORDS,
|
|
426
447
|
},
|
|
427
448
|
// raw track lists take states too, for the 0fr → 1fr expand (`--template-rows--open: 1fr`)
|
|
428
449
|
{
|
|
@@ -661,8 +682,21 @@ export const UTILITIES = [
|
|
|
661
682
|
family: "typography",
|
|
662
683
|
aliases: FONT_WEIGHTS,
|
|
663
684
|
},
|
|
664
|
-
|
|
665
|
-
{
|
|
685
|
+
// base only: a typeface and its slant do not change with the container's width
|
|
686
|
+
{
|
|
687
|
+
name: "font-family",
|
|
688
|
+
properties: ["font-family"],
|
|
689
|
+
mode: "raw",
|
|
690
|
+
family: "typography",
|
|
691
|
+
tiers: "none",
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
name: "font-style",
|
|
695
|
+
properties: ["font-style"],
|
|
696
|
+
mode: "keyword",
|
|
697
|
+
family: "typography",
|
|
698
|
+
tiers: "none",
|
|
699
|
+
},
|
|
666
700
|
{ name: "leading", properties: ["line-height"], mode: "raw", family: "typography" },
|
|
667
701
|
{ name: "tracking", properties: ["letter-spacing"], mode: "raw", family: "typography" },
|
|
668
702
|
{
|
|
@@ -680,6 +714,7 @@ export const UTILITIES = [
|
|
|
680
714
|
family: "typography",
|
|
681
715
|
emit: "text-wrap",
|
|
682
716
|
tiers: "both",
|
|
717
|
+
omitTiers: ["starting"],
|
|
683
718
|
noBase: "wrap",
|
|
684
719
|
},
|
|
685
720
|
{
|
|
@@ -690,12 +725,14 @@ export const UTILITIES = [
|
|
|
690
725
|
emit: "line-clamp",
|
|
691
726
|
},
|
|
692
727
|
// states too, for the link pattern `--text-decoration--hover: underline`
|
|
728
|
+
// (not starting: a decoration line is discrete)
|
|
693
729
|
{
|
|
694
730
|
name: "text-decoration",
|
|
695
731
|
properties: ["text-decoration-line"],
|
|
696
732
|
mode: "raw",
|
|
697
733
|
family: "typography",
|
|
698
734
|
tiers: "both",
|
|
735
|
+
omitTiers: ["starting"],
|
|
699
736
|
noBase: "none",
|
|
700
737
|
},
|
|
701
738
|
{ name: "whitespace", properties: ["white-space"], mode: "keyword", family: "typography" },
|
|
@@ -777,11 +814,15 @@ export const UTILITIES = [
|
|
|
777
814
|
family: "color",
|
|
778
815
|
pseudo: true,
|
|
779
816
|
},
|
|
817
|
+
// states only, and not starting: a style is discrete, and a border that comes
|
|
818
|
+
// and goes by width changes its width (`--border--md: 0`)
|
|
780
819
|
{
|
|
781
820
|
name: "border-style",
|
|
782
821
|
properties: ["border-style"],
|
|
783
822
|
mode: "raw",
|
|
784
823
|
family: "color",
|
|
824
|
+
tiers: "states",
|
|
825
|
+
omitTiers: ["starting"],
|
|
785
826
|
pseudo: true,
|
|
786
827
|
},
|
|
787
828
|
// border shorthands: a color, a number (px), or a length; the side rules
|
|
@@ -838,6 +879,8 @@ export const UTILITIES = [
|
|
|
838
879
|
properties: ["mix-blend-mode"],
|
|
839
880
|
mode: "keyword",
|
|
840
881
|
family: "effects",
|
|
882
|
+
// a blend mode is discrete
|
|
883
|
+
omitTiers: ["starting"],
|
|
841
884
|
noBase: "normal",
|
|
842
885
|
},
|
|
843
886
|
{
|
|
@@ -851,14 +894,16 @@ export const UTILITIES = [
|
|
|
851
894
|
// --shadow-* tokens wherever this is set, so var() and primitive shadows follow
|
|
852
895
|
{ name: "shadow-tint", properties: [], mode: "raw", family: "box", emit: "none" },
|
|
853
896
|
// the shadow's cast direction: the --shadow-* tokens rotate their offsets by it
|
|
854
|
-
// (0deg casts down, clockwise), re-declared where it is set (_shadows.css)
|
|
897
|
+
// (0deg casts down, clockwise), re-declared where it is set (_shadows.css).
|
|
898
|
+
// Breakpoints only: the light is the scene's, and `--shadow--hover` or
|
|
899
|
+
// `--elevation--hover` moves one element's shadow per state
|
|
855
900
|
{
|
|
856
901
|
name: "shadow-angle",
|
|
857
902
|
properties: [],
|
|
858
903
|
mode: "raw",
|
|
859
904
|
family: "effects",
|
|
860
905
|
emit: "none",
|
|
861
|
-
tiers: "
|
|
906
|
+
tiers: "breakpoints",
|
|
862
907
|
},
|
|
863
908
|
// ring widths are signed: a number is pixels, and a negative ring is inset
|
|
864
909
|
{ name: "ring", properties: [], mode: "raw", family: "effects", emit: "px", tiers: "both" },
|
|
@@ -928,9 +973,20 @@ export const UTILITIES = [
|
|
|
928
973
|
family: "effects",
|
|
929
974
|
emit: "animation",
|
|
930
975
|
tiers: "both",
|
|
976
|
+
// an animation cannot transition; one that runs on entry is the base value
|
|
977
|
+
omitTiers: ["starting"],
|
|
931
978
|
noBase: "none",
|
|
932
979
|
},
|
|
933
|
-
|
|
980
|
+
// no starting tier on the three: a transition's timing is read from the style
|
|
981
|
+
// the element lands in, never from its starting style
|
|
982
|
+
{
|
|
983
|
+
name: "transition",
|
|
984
|
+
pseudo: true,
|
|
985
|
+
properties: ["transition"],
|
|
986
|
+
mode: "raw",
|
|
987
|
+
family: "effects",
|
|
988
|
+
omitTiers: ["starting"],
|
|
989
|
+
},
|
|
934
990
|
// longhands after the shorthand, so they win over --transition and over a
|
|
935
991
|
// primitive's transition: retime one element without restating its property list
|
|
936
992
|
{
|
|
@@ -940,6 +996,7 @@ export const UTILITIES = [
|
|
|
940
996
|
mode: "raw",
|
|
941
997
|
family: "effects",
|
|
942
998
|
tiers: "both",
|
|
999
|
+
omitTiers: ["starting"],
|
|
943
1000
|
},
|
|
944
1001
|
{
|
|
945
1002
|
name: "transition-delay",
|
|
@@ -948,8 +1005,10 @@ export const UTILITIES = [
|
|
|
948
1005
|
mode: "raw",
|
|
949
1006
|
family: "effects",
|
|
950
1007
|
tiers: "both",
|
|
1008
|
+
omitTiers: ["starting"],
|
|
951
1009
|
},
|
|
952
|
-
// box: no tiers, except radius (
|
|
1010
|
+
// box: no tiers, except radius (both), its corners, pointer-events, --container
|
|
1011
|
+
// and --container-type (breakpoints), and z (states)
|
|
953
1012
|
// a number is that many --spacing steps times --radius-multiplier, like the
|
|
954
1013
|
// --radius-* tokens (`--radius: 2.5` is --radius-md); `full` is the pill token
|
|
955
1014
|
{
|
|
@@ -998,12 +1057,13 @@ export const UTILITIES = [
|
|
|
998
1057
|
emit: "direct",
|
|
999
1058
|
keywords: ["only", "none"],
|
|
1000
1059
|
},
|
|
1060
|
+
// base only: a stacking context paints nothing, so no width needs it switched
|
|
1001
1061
|
{
|
|
1002
1062
|
name: "isolation",
|
|
1003
1063
|
properties: ["isolation"],
|
|
1004
1064
|
mode: "keyword",
|
|
1005
1065
|
family: "flow",
|
|
1006
|
-
|
|
1066
|
+
tiers: "none",
|
|
1007
1067
|
},
|
|
1008
1068
|
{ name: "overflow", properties: ["overflow"], mode: "keyword", family: "box" },
|
|
1009
1069
|
{
|
|
@@ -1031,6 +1091,7 @@ export const UTILITIES = [
|
|
|
1031
1091
|
},
|
|
1032
1092
|
{ name: "visibility", pseudo: true, properties: ["visibility"], mode: "keyword", family: "box" },
|
|
1033
1093
|
// states, so a hovered, open, or focused item can sit above its neighbors
|
|
1094
|
+
// (not starting: the order an element enters in is the order it rests in)
|
|
1034
1095
|
{
|
|
1035
1096
|
name: "z",
|
|
1036
1097
|
pseudo: true,
|
|
@@ -1038,18 +1099,21 @@ export const UTILITIES = [
|
|
|
1038
1099
|
mode: "raw",
|
|
1039
1100
|
family: "box",
|
|
1040
1101
|
tiers: "states",
|
|
1102
|
+
omitTiers: ["starting"],
|
|
1041
1103
|
noBase: "auto",
|
|
1042
1104
|
},
|
|
1043
1105
|
{ name: "object-fit", properties: ["object-fit"], mode: "keyword", family: "box" },
|
|
1044
1106
|
{ name: "object-position", properties: ["object-position"], mode: "raw", family: "box" },
|
|
1045
|
-
// the shorthand first: each tier's longhands load after it (`containerRules`)
|
|
1107
|
+
// the shorthand first: each tier's longhands load after it (`containerRules`).
|
|
1108
|
+
// The name is base only: what changes with width is whether the element is a
|
|
1109
|
+
// container, which the type (or the shorthand) says
|
|
1046
1110
|
...["container", "container-name", "container-type"].map((name) => ({
|
|
1047
1111
|
name,
|
|
1048
1112
|
properties: [name],
|
|
1049
1113
|
mode: "raw",
|
|
1050
1114
|
family: "box",
|
|
1051
1115
|
emit: "direct",
|
|
1052
|
-
tiers: "breakpoints",
|
|
1116
|
+
tiers: name === "container-name" ? "none" : "breakpoints",
|
|
1053
1117
|
})),
|
|
1054
1118
|
];
|
|
1055
1119
|
/** Utilities that exist only on pseudo-elements. */
|
|
@@ -1057,9 +1121,8 @@ export const PSEUDO_ONLY = [
|
|
|
1057
1121
|
{ name: "content", properties: ["content"], mode: "raw", family: "box", pseudo: true },
|
|
1058
1122
|
];
|
|
1059
1123
|
export const PSEUDO_SIDES = ["before", "after"];
|
|
1060
|
-
/** Tier names a
|
|
1061
|
-
|
|
1062
|
-
const kind = utility.tiers ?? FAMILY_TIERS[utility.family];
|
|
1124
|
+
/** Tier names of a kind, in setter order. */
|
|
1125
|
+
function tiersOfKind(kind) {
|
|
1063
1126
|
if (kind === "breakpoints")
|
|
1064
1127
|
return BREAKPOINTS;
|
|
1065
1128
|
if (kind === "states")
|
|
@@ -1068,6 +1131,12 @@ export function tiersOf(utility) {
|
|
|
1068
1131
|
return [...STATES, ...BREAKPOINTS];
|
|
1069
1132
|
return [];
|
|
1070
1133
|
}
|
|
1134
|
+
/** Tier names a utility takes, in setter order: its kind (its own, else its family's) less `omitTiers`. */
|
|
1135
|
+
export function tiersOf(utility) {
|
|
1136
|
+
const tiers = tiersOfKind(utility.tiers ?? FAMILY_TIERS[utility.family]);
|
|
1137
|
+
const omit = utility.omitTiers;
|
|
1138
|
+
return omit ? tiers.filter((tier) => !omit.includes(tier)) : tiers;
|
|
1139
|
+
}
|
|
1071
1140
|
const TIER_NAMES = new Set([...BREAKPOINTS, ...STATES]);
|
|
1072
1141
|
/** `--before-w--md` → { side: "before", name: "w", tier: "md" }; `--group-bg--hover` sets `group`. */
|
|
1073
1142
|
export function parseUtilityName(raw) {
|
package/src/base/utilities.ts
CHANGED
|
@@ -191,6 +191,12 @@ export interface Utility {
|
|
|
191
191
|
chainEnd?: string;
|
|
192
192
|
/** Overrides the family's tier kind (`none` for a utility that is base-only). */
|
|
193
193
|
tiers?: Tiers;
|
|
194
|
+
/**
|
|
195
|
+
* Single tiers the utility leaves out of its kind. `starting` is the usual
|
|
196
|
+
* one: `@starting-style` is the style an element transitions from, so on a
|
|
197
|
+
* property that cannot transition the tier would do nothing.
|
|
198
|
+
*/
|
|
199
|
+
omitTiers?: readonly (Breakpoint | State)[];
|
|
194
200
|
/**
|
|
195
201
|
* What a dual utility's number multiplies (default `var(--spacing)`):
|
|
196
202
|
* `--radius: 2` is two steps of `--spacing` times `--radius-multiplier`.
|
|
@@ -350,6 +356,34 @@ export const DISPLAY_SHORTHANDS: Readonly<Record<string, readonly [string, strin
|
|
|
350
356
|
"inline-flex-col-reverse": ["inline-flex", "column-reverse"],
|
|
351
357
|
};
|
|
352
358
|
|
|
359
|
+
/**
|
|
360
|
+
* `--display: grid-gallery`: a grid that picks its column count from its
|
|
361
|
+
* child count, up to `GALLERY_MAX` in a row where they fit at the minimum
|
|
362
|
+
* width (`--ui-gallery-min-w`, `GALLERY_MIN` by default).
|
|
363
|
+
*/
|
|
364
|
+
export const DISPLAY_GALLERY = "grid-gallery";
|
|
365
|
+
export const GALLERY_MAX = 6;
|
|
366
|
+
export const GALLERY_MIN = "20ch";
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* `--display` keywords for a grid that takes its tracks from the parent grid:
|
|
370
|
+
* `[columns, rows]`, true where the axis is `subgrid`. They follow `flex`,
|
|
371
|
+
* `flex-col`, `flex-row`; the bare keyword, a prefix of the others, comes first.
|
|
372
|
+
*/
|
|
373
|
+
export const DISPLAY_SUBGRIDS: Readonly<Record<string, readonly [boolean, boolean]>> = {
|
|
374
|
+
subgrid: [true, true],
|
|
375
|
+
"subgrid-col": [true, false],
|
|
376
|
+
"subgrid-row": [false, true],
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
/** Every `--display` value the kit matches as text, besides the CSS keywords. */
|
|
380
|
+
export const DISPLAY_WORDS: readonly string[] = [
|
|
381
|
+
...Object.keys(DISPLAY_SHORTHANDS),
|
|
382
|
+
DISPLAY_PILE,
|
|
383
|
+
DISPLAY_GALLERY,
|
|
384
|
+
...Object.keys(DISPLAY_SUBGRIDS),
|
|
385
|
+
];
|
|
386
|
+
|
|
353
387
|
/** The border shorthands, all sides first. */
|
|
354
388
|
export const BORDER_SHORTHANDS = [
|
|
355
389
|
"border",
|
|
@@ -384,13 +418,6 @@ export const MARGIN_KEYWORDS = ["auto"] as const;
|
|
|
384
418
|
*/
|
|
385
419
|
export const INSET_KEYWORDS = ["auto"] as const;
|
|
386
420
|
|
|
387
|
-
/**
|
|
388
|
-
* Track-list keywords `--grid-cols` / `--grid-rows` take besides a count. `none`
|
|
389
|
-
* is not one: `--template-cols: none` says the same, and every keyword
|
|
390
|
-
* costs a rule per breakpoint (SPEC claim 16).
|
|
391
|
-
*/
|
|
392
|
-
export const GRID_TEMPLATE_KEYWORDS = ["subgrid"] as const;
|
|
393
|
-
|
|
394
421
|
/** The utility table. Order within a family is emission order (shorthands first). */
|
|
395
422
|
export const UTILITIES: readonly Utility[] = [
|
|
396
423
|
// flow: keywords and raw values; most are on the no-base allowlist
|
|
@@ -408,13 +435,15 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
408
435
|
// current) element can claim the anchor a toolbar or popover is tethered to.
|
|
409
436
|
// `normal` is position-anchor's initial value. Engines on the older draft
|
|
410
437
|
// don't know it, so the declaration is invalid at computed-value time and
|
|
411
|
-
// falls back to their initial value, `auto`.
|
|
438
|
+
// falls back to their initial value, `auto`. No starting tier on the three:
|
|
439
|
+
// they are discrete, so there is nothing to transition from.
|
|
412
440
|
{
|
|
413
441
|
name: "anchor-name",
|
|
414
442
|
properties: ["anchor-name"],
|
|
415
443
|
mode: "raw",
|
|
416
444
|
family: "flow",
|
|
417
445
|
tiers: "both",
|
|
446
|
+
omitTiers: ["starting"],
|
|
418
447
|
noBase: "none",
|
|
419
448
|
},
|
|
420
449
|
{
|
|
@@ -423,6 +452,7 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
423
452
|
mode: "raw",
|
|
424
453
|
family: "flow",
|
|
425
454
|
tiers: "both",
|
|
455
|
+
omitTiers: ["starting"],
|
|
426
456
|
noBase: "normal",
|
|
427
457
|
},
|
|
428
458
|
// where the tethered element sits on its anchor's 3×3 grid (`block-start
|
|
@@ -433,6 +463,7 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
433
463
|
mode: "raw",
|
|
434
464
|
family: "flow",
|
|
435
465
|
tiers: "both",
|
|
466
|
+
omitTiers: ["starting"],
|
|
436
467
|
noBase: "none",
|
|
437
468
|
},
|
|
438
469
|
{
|
|
@@ -540,7 +571,7 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
540
571
|
noBase: "auto",
|
|
541
572
|
},
|
|
542
573
|
{ name: "row-end", properties: ["grid-row-end"], mode: "raw", family: "flow", noBase: "auto" },
|
|
543
|
-
// grid: integers become repeat() (
|
|
574
|
+
// grid: integers become repeat() (subgrid is a --display keyword); templates are raw;
|
|
544
575
|
// grid-fit packs auto-fit columns
|
|
545
576
|
{
|
|
546
577
|
name: "grid-cols",
|
|
@@ -549,7 +580,6 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
549
580
|
family: "grid",
|
|
550
581
|
emit: "repeat",
|
|
551
582
|
noBase: "1",
|
|
552
|
-
keywords: GRID_TEMPLATE_KEYWORDS,
|
|
553
583
|
},
|
|
554
584
|
{
|
|
555
585
|
name: "grid-rows",
|
|
@@ -558,7 +588,6 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
558
588
|
family: "grid",
|
|
559
589
|
emit: "repeat",
|
|
560
590
|
noBase: "1",
|
|
561
|
-
keywords: GRID_TEMPLATE_KEYWORDS,
|
|
562
591
|
},
|
|
563
592
|
// raw track lists take states too, for the 0fr → 1fr expand (`--template-rows--open: 1fr`)
|
|
564
593
|
{
|
|
@@ -799,8 +828,21 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
799
828
|
family: "typography",
|
|
800
829
|
aliases: FONT_WEIGHTS,
|
|
801
830
|
},
|
|
802
|
-
|
|
803
|
-
{
|
|
831
|
+
// base only: a typeface and its slant do not change with the container's width
|
|
832
|
+
{
|
|
833
|
+
name: "font-family",
|
|
834
|
+
properties: ["font-family"],
|
|
835
|
+
mode: "raw",
|
|
836
|
+
family: "typography",
|
|
837
|
+
tiers: "none",
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
name: "font-style",
|
|
841
|
+
properties: ["font-style"],
|
|
842
|
+
mode: "keyword",
|
|
843
|
+
family: "typography",
|
|
844
|
+
tiers: "none",
|
|
845
|
+
},
|
|
804
846
|
{ name: "leading", properties: ["line-height"], mode: "raw", family: "typography" },
|
|
805
847
|
{ name: "tracking", properties: ["letter-spacing"], mode: "raw", family: "typography" },
|
|
806
848
|
{
|
|
@@ -818,6 +860,7 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
818
860
|
family: "typography",
|
|
819
861
|
emit: "text-wrap",
|
|
820
862
|
tiers: "both",
|
|
863
|
+
omitTiers: ["starting"],
|
|
821
864
|
noBase: "wrap",
|
|
822
865
|
},
|
|
823
866
|
{
|
|
@@ -828,12 +871,14 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
828
871
|
emit: "line-clamp",
|
|
829
872
|
},
|
|
830
873
|
// states too, for the link pattern `--text-decoration--hover: underline`
|
|
874
|
+
// (not starting: a decoration line is discrete)
|
|
831
875
|
{
|
|
832
876
|
name: "text-decoration",
|
|
833
877
|
properties: ["text-decoration-line"],
|
|
834
878
|
mode: "raw",
|
|
835
879
|
family: "typography",
|
|
836
880
|
tiers: "both",
|
|
881
|
+
omitTiers: ["starting"],
|
|
837
882
|
noBase: "none",
|
|
838
883
|
},
|
|
839
884
|
{ name: "whitespace", properties: ["white-space"], mode: "keyword", family: "typography" },
|
|
@@ -915,11 +960,15 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
915
960
|
family: "color",
|
|
916
961
|
pseudo: true,
|
|
917
962
|
},
|
|
963
|
+
// states only, and not starting: a style is discrete, and a border that comes
|
|
964
|
+
// and goes by width changes its width (`--border--md: 0`)
|
|
918
965
|
{
|
|
919
966
|
name: "border-style",
|
|
920
967
|
properties: ["border-style"],
|
|
921
968
|
mode: "raw",
|
|
922
969
|
family: "color",
|
|
970
|
+
tiers: "states",
|
|
971
|
+
omitTiers: ["starting"],
|
|
923
972
|
pseudo: true,
|
|
924
973
|
},
|
|
925
974
|
// border shorthands: a color, a number (px), or a length; the side rules
|
|
@@ -976,6 +1025,8 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
976
1025
|
properties: ["mix-blend-mode"],
|
|
977
1026
|
mode: "keyword",
|
|
978
1027
|
family: "effects",
|
|
1028
|
+
// a blend mode is discrete
|
|
1029
|
+
omitTiers: ["starting"],
|
|
979
1030
|
noBase: "normal",
|
|
980
1031
|
},
|
|
981
1032
|
{
|
|
@@ -989,14 +1040,16 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
989
1040
|
// --shadow-* tokens wherever this is set, so var() and primitive shadows follow
|
|
990
1041
|
{ name: "shadow-tint", properties: [], mode: "raw", family: "box", emit: "none" },
|
|
991
1042
|
// the shadow's cast direction: the --shadow-* tokens rotate their offsets by it
|
|
992
|
-
// (0deg casts down, clockwise), re-declared where it is set (_shadows.css)
|
|
1043
|
+
// (0deg casts down, clockwise), re-declared where it is set (_shadows.css).
|
|
1044
|
+
// Breakpoints only: the light is the scene's, and `--shadow--hover` or
|
|
1045
|
+
// `--elevation--hover` moves one element's shadow per state
|
|
993
1046
|
{
|
|
994
1047
|
name: "shadow-angle",
|
|
995
1048
|
properties: [],
|
|
996
1049
|
mode: "raw",
|
|
997
1050
|
family: "effects",
|
|
998
1051
|
emit: "none",
|
|
999
|
-
tiers: "
|
|
1052
|
+
tiers: "breakpoints",
|
|
1000
1053
|
},
|
|
1001
1054
|
// ring widths are signed: a number is pixels, and a negative ring is inset
|
|
1002
1055
|
{ name: "ring", properties: [], mode: "raw", family: "effects", emit: "px", tiers: "both" },
|
|
@@ -1066,9 +1119,20 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
1066
1119
|
family: "effects",
|
|
1067
1120
|
emit: "animation",
|
|
1068
1121
|
tiers: "both",
|
|
1122
|
+
// an animation cannot transition; one that runs on entry is the base value
|
|
1123
|
+
omitTiers: ["starting"],
|
|
1069
1124
|
noBase: "none",
|
|
1070
1125
|
},
|
|
1071
|
-
|
|
1126
|
+
// no starting tier on the three: a transition's timing is read from the style
|
|
1127
|
+
// the element lands in, never from its starting style
|
|
1128
|
+
{
|
|
1129
|
+
name: "transition",
|
|
1130
|
+
pseudo: true,
|
|
1131
|
+
properties: ["transition"],
|
|
1132
|
+
mode: "raw",
|
|
1133
|
+
family: "effects",
|
|
1134
|
+
omitTiers: ["starting"],
|
|
1135
|
+
},
|
|
1072
1136
|
// longhands after the shorthand, so they win over --transition and over a
|
|
1073
1137
|
// primitive's transition: retime one element without restating its property list
|
|
1074
1138
|
{
|
|
@@ -1078,6 +1142,7 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
1078
1142
|
mode: "raw",
|
|
1079
1143
|
family: "effects",
|
|
1080
1144
|
tiers: "both",
|
|
1145
|
+
omitTiers: ["starting"],
|
|
1081
1146
|
},
|
|
1082
1147
|
{
|
|
1083
1148
|
name: "transition-delay",
|
|
@@ -1086,8 +1151,10 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
1086
1151
|
mode: "raw",
|
|
1087
1152
|
family: "effects",
|
|
1088
1153
|
tiers: "both",
|
|
1154
|
+
omitTiers: ["starting"],
|
|
1089
1155
|
},
|
|
1090
|
-
// box: no tiers, except radius (
|
|
1156
|
+
// box: no tiers, except radius (both), its corners, pointer-events, --container
|
|
1157
|
+
// and --container-type (breakpoints), and z (states)
|
|
1091
1158
|
// a number is that many --spacing steps times --radius-multiplier, like the
|
|
1092
1159
|
// --radius-* tokens (`--radius: 2.5` is --radius-md); `full` is the pill token
|
|
1093
1160
|
{
|
|
@@ -1138,12 +1205,13 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
1138
1205
|
emit: "direct",
|
|
1139
1206
|
keywords: ["only", "none"],
|
|
1140
1207
|
},
|
|
1208
|
+
// base only: a stacking context paints nothing, so no width needs it switched
|
|
1141
1209
|
{
|
|
1142
1210
|
name: "isolation",
|
|
1143
1211
|
properties: ["isolation"],
|
|
1144
1212
|
mode: "keyword",
|
|
1145
1213
|
family: "flow",
|
|
1146
|
-
|
|
1214
|
+
tiers: "none",
|
|
1147
1215
|
},
|
|
1148
1216
|
{ name: "overflow", properties: ["overflow"], mode: "keyword", family: "box" },
|
|
1149
1217
|
{
|
|
@@ -1171,6 +1239,7 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
1171
1239
|
},
|
|
1172
1240
|
{ name: "visibility", pseudo: true, properties: ["visibility"], mode: "keyword", family: "box" },
|
|
1173
1241
|
// states, so a hovered, open, or focused item can sit above its neighbors
|
|
1242
|
+
// (not starting: the order an element enters in is the order it rests in)
|
|
1174
1243
|
{
|
|
1175
1244
|
name: "z",
|
|
1176
1245
|
pseudo: true,
|
|
@@ -1178,18 +1247,21 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
1178
1247
|
mode: "raw",
|
|
1179
1248
|
family: "box",
|
|
1180
1249
|
tiers: "states",
|
|
1250
|
+
omitTiers: ["starting"],
|
|
1181
1251
|
noBase: "auto",
|
|
1182
1252
|
},
|
|
1183
1253
|
{ name: "object-fit", properties: ["object-fit"], mode: "keyword", family: "box" },
|
|
1184
1254
|
{ name: "object-position", properties: ["object-position"], mode: "raw", family: "box" },
|
|
1185
|
-
// the shorthand first: each tier's longhands load after it (`containerRules`)
|
|
1255
|
+
// the shorthand first: each tier's longhands load after it (`containerRules`).
|
|
1256
|
+
// The name is base only: what changes with width is whether the element is a
|
|
1257
|
+
// container, which the type (or the shorthand) says
|
|
1186
1258
|
...["container", "container-name", "container-type"].map((name) => ({
|
|
1187
1259
|
name,
|
|
1188
1260
|
properties: [name],
|
|
1189
1261
|
mode: "raw" as const,
|
|
1190
1262
|
family: "box" as const,
|
|
1191
1263
|
emit: "direct" as const,
|
|
1192
|
-
tiers: "breakpoints" as const,
|
|
1264
|
+
tiers: name === "container-name" ? ("none" as const) : ("breakpoints" as const),
|
|
1193
1265
|
})),
|
|
1194
1266
|
];
|
|
1195
1267
|
|
|
@@ -1201,15 +1273,21 @@ export const PSEUDO_ONLY: readonly Utility[] = [
|
|
|
1201
1273
|
export const PSEUDO_SIDES = ["before", "after"] as const;
|
|
1202
1274
|
export type PseudoSide = (typeof PSEUDO_SIDES)[number];
|
|
1203
1275
|
|
|
1204
|
-
/** Tier names a
|
|
1205
|
-
|
|
1206
|
-
const kind = utility.tiers ?? FAMILY_TIERS[utility.family];
|
|
1276
|
+
/** Tier names of a kind, in setter order. */
|
|
1277
|
+
function tiersOfKind(kind: Tiers): readonly string[] {
|
|
1207
1278
|
if (kind === "breakpoints") return BREAKPOINTS;
|
|
1208
1279
|
if (kind === "states") return STATES;
|
|
1209
1280
|
if (kind === "both") return [...STATES, ...BREAKPOINTS];
|
|
1210
1281
|
return [];
|
|
1211
1282
|
}
|
|
1212
1283
|
|
|
1284
|
+
/** Tier names a utility takes, in setter order: its kind (its own, else its family's) less `omitTiers`. */
|
|
1285
|
+
export function tiersOf(utility: Utility): readonly string[] {
|
|
1286
|
+
const tiers = tiersOfKind(utility.tiers ?? FAMILY_TIERS[utility.family]);
|
|
1287
|
+
const omit: readonly string[] | undefined = utility.omitTiers;
|
|
1288
|
+
return omit ? tiers.filter((tier) => !omit.includes(tier)) : tiers;
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1213
1291
|
/** A utility property name, split into its parts. */
|
|
1214
1292
|
export interface UtilityName {
|
|
1215
1293
|
name: string;
|
package/src/head.js
CHANGED
|
@@ -80,27 +80,27 @@ const ESM_DEPENDENCIES = [
|
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
name: "embla-carousel",
|
|
83
|
-
version: "
|
|
83
|
+
version: "9.0.0-rc04",
|
|
84
84
|
file: "esm/embla-carousel.esm.js",
|
|
85
|
-
integrity: "sha384-
|
|
85
|
+
integrity: "sha384-Qcz5VJ/iRhG3zPRMT8li6rYNSsXcCeSQ6URxPlQh7joEd/nNxRRkCZxlJoTZr3Ch",
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
name: "embla-carousel-autoplay",
|
|
89
|
-
version: "
|
|
89
|
+
version: "9.0.0-rc04",
|
|
90
90
|
file: "esm/embla-carousel-autoplay.esm.js",
|
|
91
|
-
integrity: "sha384-
|
|
91
|
+
integrity: "sha384-dsPLKoLTpj/hIVD1I1zYA1kDCI32uRH4seU3ly+s7Lm9MdWVsj1OmE8HELhZ/Fm4",
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
name: "embla-carousel-auto-scroll",
|
|
95
|
-
version: "
|
|
95
|
+
version: "9.0.0-rc04",
|
|
96
96
|
file: "esm/embla-carousel-auto-scroll.esm.js",
|
|
97
|
-
integrity: "sha384-
|
|
97
|
+
integrity: "sha384-bOWyJNYHSsncAhdIgavN6TjY6Bb/NRLV9fAon5xy9HquiFZbNYTjq2JZ5bq5nyb5",
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
name: "embla-carousel-class-names",
|
|
101
|
-
version: "
|
|
101
|
+
version: "9.0.0-rc04",
|
|
102
102
|
file: "esm/embla-carousel-class-names.esm.js",
|
|
103
|
-
integrity: "sha384-
|
|
103
|
+
integrity: "sha384-y8wWJW7HPdqr5guB+ZdF/o9FIRGg2KtH9TdoAttP7jjEU9bQlAzY0Fc5FiIMYQN1",
|
|
104
104
|
},
|
|
105
105
|
];
|
|
106
106
|
/**
|