@zazz-ui/core 0.6.2 → 0.7.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 +5 -3
- package/CHANGELOG.md +38 -0
- package/README.md +3 -3
- package/dist/csp-D72qtdXZ.js +1 -0
- package/dist/sri.json +54 -49
- package/dist/zazz.css +1 -1
- package/dist/zazz.js +1 -1
- package/editor/zazz.css-data.json +312 -24
- package/editor/zazz.language-data.json +9 -9
- package/editor/zazz.lint-data.json +2028 -0
- package/package.json +1 -1
- package/src/base/_defaults.css +367 -0
- package/src/base/_layers.css +6 -2
- package/src/base/_properties-2xl.css +8 -2
- 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 +8 -2
- package/src/base/_properties-md.css +8 -2
- package/src/base/_properties-open.css +12 -0
- package/src/base/_properties-sm.css +8 -2
- package/src/base/_properties-starting.css +6 -0
- package/src/base/_properties-stuck.css +6 -0
- package/src/base/_properties-xl.css +8 -2
- package/src/base/_properties.css +12 -3
- package/src/base/_utilities-box.css +0 -15
- package/src/base/_utilities-effects.css +0 -15
- package/src/base/_utilities-flow.css +79 -68
- package/src/base/_utilities-grid.css +20 -32
- package/src/base/_utilities-sizing.css +0 -3
- package/src/base/_utilities-spacing.css +36 -11
- package/src/base/_utilities-tier-2xl.css +4 -1
- 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 +4 -1
- package/src/base/_utilities-tier-md.css +4 -1
- package/src/base/_utilities-tier-open.css +6 -0
- package/src/base/_utilities-tier-sm.css +4 -1
- 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 +4 -1
- package/src/base/_utilities-typography.css +0 -9
- package/src/base/csp.d.ts +19 -0
- package/src/base/csp.d.ts.map +1 -0
- package/src/base/csp.js +131 -0
- package/src/base/csp.ts +137 -0
- package/src/base/declarations.d.ts +36 -0
- package/src/base/declarations.d.ts.map +1 -0
- package/src/base/declarations.js +70 -0
- package/src/base/declarations.ts +97 -0
- package/src/base/kit-styling.d.ts +11 -0
- package/src/base/kit-styling.d.ts.map +1 -0
- package/src/base/kit-styling.js +467 -0
- package/src/base/kit-styling.ts +470 -0
- package/src/base/style-format.d.ts +3 -22
- package/src/base/style-format.d.ts.map +1 -1
- package/src/base/style-format.js +4 -62
- package/src/base/style-format.ts +4 -71
- package/src/base/utilities.d.ts +14 -6
- package/src/base/utilities.d.ts.map +1 -1
- package/src/base/utilities.js +81 -29
- package/src/base/utilities.ts +92 -38
- package/src/head.d.ts +6 -0
- package/src/head.d.ts.map +1 -1
- package/src/head.js +21 -14
- package/src/head.ts +38 -11
- package/src/index.css +1 -0
- package/src/index.js +22 -0
- package/src/index.ts +19 -0
- package/src/manifest.d.ts +21 -1
- package/src/manifest.d.ts.map +1 -1
- package/src/manifest.js +12 -2
- package/src/manifest.ts +27 -2
- package/src/primitives/debug/audit-core.d.ts +9 -1
- package/src/primitives/debug/audit-core.d.ts.map +1 -1
- package/src/primitives/debug/audit-core.js +58 -8
- package/src/primitives/debug/audit-core.ts +84 -7
- package/src/primitives/debug/debug.d.ts +0 -15
- package/src/primitives/debug/debug.d.ts.map +1 -1
- package/src/primitives/debug/debug.js +11 -2
- package/src/primitives/debug/debug.ts +12 -1
- package/src/primitives/prose/prose.html +3 -3
- package/src/primitives/table/table-size-sm.html +12 -12
- package/src/primitives/utilities/aspect-ratio.html +1 -0
- package/src/primitives/utilities/margin-auto.html +1 -1
- package/src/primitives/utilities/overflow.html +5 -6
- package/src/primitives/utilities/position.html +1 -1
- package/src/primitives/utilities/width.html +2 -1
package/src/base/style-format.ts
CHANGED
|
@@ -30,78 +30,11 @@ import {
|
|
|
30
30
|
|
|
31
31
|
// --- Declarations ---
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
// the parser lives in declarations.ts (no imports) so the CSP fallback can share it
|
|
34
|
+
import { scanDeclarations, splitDeclarations } from "./declarations.ts";
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
export
|
|
38
|
-
/** The whole declaration. */
|
|
39
|
-
span: Range;
|
|
40
|
-
/** The name; a declaration still being typed (`--p`) is all name. */
|
|
41
|
-
name: string;
|
|
42
|
-
nameSpan: Range;
|
|
43
|
-
/** Offset of the colon, or -1 when there is none yet. */
|
|
44
|
-
colon: number;
|
|
45
|
-
value: string;
|
|
46
|
-
/** Empty (`[colon + 1, colon + 1]`) when nothing follows the colon. */
|
|
47
|
-
valueSpan: Range;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/** Trims `[start, end)` of `text` to its non-whitespace extent. */
|
|
51
|
-
function trimRange(text: string, start: number, end: number): Range {
|
|
52
|
-
while (start < end && /\s/.test(text[start]!)) start++;
|
|
53
|
-
while (end > start && /\s/.test(text[end - 1]!)) end--;
|
|
54
|
-
return [start, end];
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Scans a style value into declarations, splitting on top-level `;` (not inside
|
|
59
|
-
* parentheses or quotes). Empty segments are skipped.
|
|
60
|
-
*/
|
|
61
|
-
export function scanDeclarations(value: string): ScannedDeclaration[] {
|
|
62
|
-
const found: ScannedDeclaration[] = [];
|
|
63
|
-
const push = (from: number, to: number) => {
|
|
64
|
-
const span = trimRange(value, from, to);
|
|
65
|
-
if (span[0] === span[1]) return;
|
|
66
|
-
const colon = value.indexOf(":", span[0]);
|
|
67
|
-
const hasColon = colon !== -1 && colon < span[1];
|
|
68
|
-
const nameSpan = hasColon ? trimRange(value, span[0], colon) : span;
|
|
69
|
-
const valueSpan = hasColon
|
|
70
|
-
? trimRange(value, colon + 1, span[1])
|
|
71
|
-
: ([span[1], span[1]] as Range);
|
|
72
|
-
found.push({
|
|
73
|
-
span,
|
|
74
|
-
name: value.slice(...nameSpan),
|
|
75
|
-
nameSpan,
|
|
76
|
-
colon: hasColon ? colon : -1,
|
|
77
|
-
value: value.slice(...valueSpan),
|
|
78
|
-
valueSpan,
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
let depth = 0;
|
|
82
|
-
let quote: string | null = null;
|
|
83
|
-
let start = 0;
|
|
84
|
-
for (let i = 0; i < value.length; i++) {
|
|
85
|
-
const ch = value[i]!;
|
|
86
|
-
if (quote) {
|
|
87
|
-
if (ch === "\\") i++;
|
|
88
|
-
else if (ch === quote) quote = null;
|
|
89
|
-
} else if (ch === '"' || ch === "'") quote = ch;
|
|
90
|
-
else if (ch === "(") depth++;
|
|
91
|
-
else if (ch === ")") depth = Math.max(0, depth - 1);
|
|
92
|
-
else if (ch === ";" && depth === 0) {
|
|
93
|
-
push(start, i);
|
|
94
|
-
start = i + 1;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
push(start, value.length);
|
|
98
|
-
return found;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/** Splits a style value on top-level `;`, ignoring ones inside parentheses or quotes. */
|
|
102
|
-
export function splitDeclarations(value: string): string[] {
|
|
103
|
-
return scanDeclarations(value).map(({ span }) => value.slice(...span));
|
|
104
|
-
}
|
|
36
|
+
export { scanDeclarations, splitDeclarations };
|
|
37
|
+
export type { Range, ScannedDeclaration } from "./declarations.ts";
|
|
105
38
|
|
|
106
39
|
/** Collapses whitespace runs to one space, outside quotes. */
|
|
107
40
|
function collapse(text: string): string {
|
package/src/base/utilities.d.ts
CHANGED
|
@@ -99,14 +99,10 @@ export interface Utility {
|
|
|
99
99
|
inherits?: true;
|
|
100
100
|
/**
|
|
101
101
|
* No-base allowlist: the CSS initial value as a literal. A utility with
|
|
102
|
-
* `noBase` applies a tier
|
|
102
|
+
* `noBase` applies a tier without a base value wherever no kit rule sets its
|
|
103
|
+
* property (the tier-only rule is in `@layer defaults`, which they beat).
|
|
103
104
|
*/
|
|
104
105
|
noBase?: string;
|
|
105
|
-
/**
|
|
106
|
-
* Extra selectors excluded from the no-base rule: elements whose
|
|
107
|
-
* placement chain a primitive owns, e.g. a layout's children for `--band`.
|
|
108
|
-
*/
|
|
109
|
-
noBaseExclude?: readonly string[];
|
|
110
106
|
/**
|
|
111
107
|
* Keywords the typed emission (the dual pair, or an integer's `repeat()`)
|
|
112
108
|
* cannot carry. A utility written with one of its keywords, at the base or
|
|
@@ -129,6 +125,18 @@ export interface Utility {
|
|
|
129
125
|
*/
|
|
130
126
|
aliases?: Readonly<Record<string, string>>;
|
|
131
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* The utilities that compose into one `box-shadow` (ring and shadow): the
|
|
130
|
+
* composite's chains all end in a literal, so a tier alone works on them, like
|
|
131
|
+
* a no-base utility.
|
|
132
|
+
*/
|
|
133
|
+
export declare const BOX_SHADOW_COMPOSITE: readonly ["shadow", "ring", "ring-color", "ring-offset", "ring-offset-color"];
|
|
134
|
+
/**
|
|
135
|
+
* The shorthands whose base a longhand's tier overrides, nearest first: `--p: 4;
|
|
136
|
+
* --px--md: 1` pads 4 below md and 1 inline from md. A shorthand's base is a
|
|
137
|
+
* base for its longhands' tiers.
|
|
138
|
+
*/
|
|
139
|
+
export declare const SHORTHAND_OF: Readonly<Record<string, readonly string[]>>;
|
|
132
140
|
/** Gradient types: `--bg-<type>` emits `<type>-gradient(<prelude>, <--bg-stops>)`. */
|
|
133
141
|
export declare const GRADIENT_TYPES: readonly ["linear", "radial", "conic"];
|
|
134
142
|
/** The size scale shared by the token keywords (`--shadow: md`). */
|
|
@@ -1 +1 @@
|
|
|
1
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GAIG;AACH,eAAO,MAAM,sBAAsB,YAAI,SAAS,CAAU,CAAC;AAE3D,qFAAqF;AACrF,eAAO,MAAM,SAAS,EAAE,SAAS,OAAO,EA0lBvC,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,35 @@ export const FAMILY_TIERS = {
|
|
|
103
103
|
effects: "states",
|
|
104
104
|
box: "none",
|
|
105
105
|
};
|
|
106
|
+
/**
|
|
107
|
+
* The utilities that compose into one `box-shadow` (ring and shadow): the
|
|
108
|
+
* composite's chains all end in a literal, so a tier alone works on them, like
|
|
109
|
+
* a no-base utility.
|
|
110
|
+
*/
|
|
111
|
+
export const BOX_SHADOW_COMPOSITE = [
|
|
112
|
+
"shadow",
|
|
113
|
+
"ring",
|
|
114
|
+
"ring-color",
|
|
115
|
+
"ring-offset",
|
|
116
|
+
"ring-offset-color",
|
|
117
|
+
];
|
|
118
|
+
/**
|
|
119
|
+
* The shorthands whose base a longhand's tier overrides, nearest first: `--p: 4;
|
|
120
|
+
* --px--md: 1` pads 4 below md and 1 inline from md. A shorthand's base is a
|
|
121
|
+
* base for its longhands' tiers.
|
|
122
|
+
*/
|
|
123
|
+
export const SHORTHAND_OF = {
|
|
124
|
+
px: ["p"],
|
|
125
|
+
py: ["p"],
|
|
126
|
+
pt: ["py", "p"],
|
|
127
|
+
pb: ["py", "p"],
|
|
128
|
+
pl: ["px", "p"],
|
|
129
|
+
pr: ["px", "p"],
|
|
130
|
+
"gap-x": ["gap"],
|
|
131
|
+
"gap-y": ["gap"],
|
|
132
|
+
basis: ["flex"],
|
|
133
|
+
shrink: ["flex"],
|
|
134
|
+
};
|
|
106
135
|
/** Gradient types: `--bg-<type>` emits `<type>-gradient(<prelude>, <--bg-stops>)`. */
|
|
107
136
|
export const GRADIENT_TYPES = ["linear", "radial", "conic"];
|
|
108
137
|
/** The size scale shared by the token keywords (`--shadow: md`). */
|
|
@@ -177,8 +206,6 @@ export const BORDER_SIDES = [
|
|
|
177
206
|
/** The four sizing keywords. Margin takes only `auto`. */
|
|
178
207
|
export const SIZING_KEYWORDS = ["auto", "fit-content", "min-content", "max-content"];
|
|
179
208
|
export const MARGIN_KEYWORDS = ["auto"];
|
|
180
|
-
/** A layout places its children; a tier-only column utility there keeps the band below the tier. */
|
|
181
|
-
const LAYOUT_CHILDREN = ["ui-layout > *", '[data-ui~="layout"] > *'];
|
|
182
209
|
/**
|
|
183
210
|
* Track-list keywords `--grid-cols` / `--grid-rows` take besides a count. `none`
|
|
184
211
|
* is not one: `--template-cols: none` says the same, and every keyword
|
|
@@ -198,6 +225,37 @@ export const UTILITIES = [
|
|
|
198
225
|
family: "flow",
|
|
199
226
|
noBase: "static",
|
|
200
227
|
},
|
|
228
|
+
// anchor positioning: states and breakpoints, so the hovered (or open, or
|
|
229
|
+
// current) element can claim the anchor a toolbar or popover is tethered to.
|
|
230
|
+
// `normal` is position-anchor's initial value. Engines on the older draft
|
|
231
|
+
// don't know it, so the declaration is invalid at computed-value time and
|
|
232
|
+
// falls back to their initial value, `auto`.
|
|
233
|
+
{
|
|
234
|
+
name: "anchor-name",
|
|
235
|
+
properties: ["anchor-name"],
|
|
236
|
+
mode: "raw",
|
|
237
|
+
family: "flow",
|
|
238
|
+
tiers: "both",
|
|
239
|
+
noBase: "none",
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: "position-anchor",
|
|
243
|
+
properties: ["position-anchor"],
|
|
244
|
+
mode: "raw",
|
|
245
|
+
family: "flow",
|
|
246
|
+
tiers: "both",
|
|
247
|
+
noBase: "normal",
|
|
248
|
+
},
|
|
249
|
+
// where the tethered element sits on its anchor's 3×3 grid (`block-start
|
|
250
|
+
// span-inline-end`); a popover keeps its own area under a tier alone
|
|
251
|
+
{
|
|
252
|
+
name: "position-area",
|
|
253
|
+
properties: ["position-area"],
|
|
254
|
+
mode: "raw",
|
|
255
|
+
family: "flow",
|
|
256
|
+
tiers: "both",
|
|
257
|
+
noBase: "none",
|
|
258
|
+
},
|
|
201
259
|
{
|
|
202
260
|
name: "flex-wrap",
|
|
203
261
|
properties: ["flex-wrap"],
|
|
@@ -205,7 +263,6 @@ export const UTILITIES = [
|
|
|
205
263
|
family: "flow",
|
|
206
264
|
noBase: "nowrap",
|
|
207
265
|
},
|
|
208
|
-
{ name: "shrink", properties: ["flex-shrink"], mode: "raw", family: "flow", noBase: "1" },
|
|
209
266
|
{
|
|
210
267
|
name: "grid-flow",
|
|
211
268
|
properties: ["grid-auto-flow"],
|
|
@@ -252,6 +309,8 @@ export const UTILITIES = [
|
|
|
252
309
|
},
|
|
253
310
|
{ name: "self", properties: ["align-self"], mode: "keyword", family: "flow", noBase: "auto" },
|
|
254
311
|
{ name: "flex", properties: ["flex"], mode: "raw", family: "flow", noBase: "0 1 auto" },
|
|
312
|
+
// after --flex, so its base beats the shorthand's
|
|
313
|
+
{ name: "shrink", properties: ["flex-shrink"], mode: "raw", family: "flow", noBase: "1" },
|
|
255
314
|
{ name: "basis", properties: ["flex-basis"], mode: "raw", family: "flow", noBase: "auto" },
|
|
256
315
|
{ name: "order", properties: ["order"], mode: "raw", family: "flow", noBase: "0" },
|
|
257
316
|
// a layout child's band (`layout-md`); any grid-column value works
|
|
@@ -261,7 +320,6 @@ export const UTILITIES = [
|
|
|
261
320
|
mode: "raw",
|
|
262
321
|
family: "flow",
|
|
263
322
|
noBase: "auto",
|
|
264
|
-
noBaseExclude: LAYOUT_CHILDREN,
|
|
265
323
|
},
|
|
266
324
|
// Tailwind's col-span / col-start / col-end (and row-*): span is a count,
|
|
267
325
|
// start and end are line numbers; start and end follow span so they combine
|
|
@@ -272,7 +330,6 @@ export const UTILITIES = [
|
|
|
272
330
|
family: "flow",
|
|
273
331
|
emit: "span",
|
|
274
332
|
noBase: "1",
|
|
275
|
-
noBaseExclude: LAYOUT_CHILDREN,
|
|
276
333
|
},
|
|
277
334
|
{
|
|
278
335
|
name: "col-start",
|
|
@@ -280,7 +337,6 @@ export const UTILITIES = [
|
|
|
280
337
|
mode: "raw",
|
|
281
338
|
family: "flow",
|
|
282
339
|
noBase: "auto",
|
|
283
|
-
noBaseExclude: LAYOUT_CHILDREN,
|
|
284
340
|
},
|
|
285
341
|
{
|
|
286
342
|
name: "col-end",
|
|
@@ -288,7 +344,6 @@ export const UTILITIES = [
|
|
|
288
344
|
mode: "raw",
|
|
289
345
|
family: "flow",
|
|
290
346
|
noBase: "auto",
|
|
291
|
-
noBaseExclude: LAYOUT_CHILDREN,
|
|
292
347
|
},
|
|
293
348
|
{
|
|
294
349
|
name: "row-span",
|
|
@@ -350,26 +405,24 @@ export const UTILITIES = [
|
|
|
350
405
|
family: "grid",
|
|
351
406
|
emit: "grid-fit",
|
|
352
407
|
},
|
|
353
|
-
// spacing: dual mode; gap
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
{
|
|
366
|
-
name: "pl",
|
|
408
|
+
// spacing: dual mode; padding and gap are on the no-base allowlist (the reset
|
|
409
|
+
// zeroes padding, so `--px--md: 8` alone pads from md)
|
|
410
|
+
...[
|
|
411
|
+
["p", "padding"],
|
|
412
|
+
["px", "padding-inline"],
|
|
413
|
+
["py", "padding-block"],
|
|
414
|
+
["pt", "padding-block-start"],
|
|
415
|
+
["pb", "padding-block-end"],
|
|
416
|
+
["pl", "padding-inline-start"],
|
|
417
|
+
["pr", "padding-inline-end"],
|
|
418
|
+
].map(([name, property]) => ({
|
|
419
|
+
name,
|
|
367
420
|
pseudo: true,
|
|
368
|
-
properties: [
|
|
421
|
+
properties: [property],
|
|
369
422
|
mode: "dual",
|
|
370
423
|
family: "spacing",
|
|
371
|
-
|
|
372
|
-
|
|
424
|
+
noBase: "0",
|
|
425
|
+
})),
|
|
373
426
|
{ name: "gap", properties: ["gap"], mode: "dual", family: "spacing", noBase: "0" },
|
|
374
427
|
{ name: "gap-x", properties: ["column-gap"], mode: "dual", family: "spacing", noBase: "0" },
|
|
375
428
|
{ name: "gap-y", properties: ["row-gap"], mode: "dual", family: "spacing", noBase: "0" },
|
|
@@ -556,6 +609,7 @@ export const UTILITIES = [
|
|
|
556
609
|
{ name: "whitespace", properties: ["white-space"], mode: "keyword", family: "typography" },
|
|
557
610
|
// color: states; bg-alpha feeds the bg emission
|
|
558
611
|
{ name: "text", properties: ["color"], mode: "raw", family: "color", pseudo: true },
|
|
612
|
+
// on the no-base allowlist: a plain element is transparent, so `--bg--hover` alone paints on hover
|
|
559
613
|
{
|
|
560
614
|
name: "bg",
|
|
561
615
|
properties: ["background-color"],
|
|
@@ -563,6 +617,7 @@ export const UTILITIES = [
|
|
|
563
617
|
family: "color",
|
|
564
618
|
emit: "bg",
|
|
565
619
|
pseudo: true,
|
|
620
|
+
noBase: "transparent",
|
|
566
621
|
},
|
|
567
622
|
{ name: "bg-alpha", properties: [], mode: "raw", family: "color", emit: "none" },
|
|
568
623
|
// gradients: the type utility carries the prelude (direction, shape, position,
|
|
@@ -722,22 +777,19 @@ export const UTILITIES = [
|
|
|
722
777
|
mode: "raw",
|
|
723
778
|
family: "box",
|
|
724
779
|
pseudo: true,
|
|
725
|
-
noBase: "0",
|
|
726
780
|
},
|
|
727
|
-
{ name: "overflow", properties: ["overflow"], mode: "keyword", family: "box"
|
|
781
|
+
{ name: "overflow", properties: ["overflow"], mode: "keyword", family: "box" },
|
|
728
782
|
{
|
|
729
783
|
name: "overflow-x",
|
|
730
784
|
properties: ["overflow-x"],
|
|
731
785
|
mode: "keyword",
|
|
732
786
|
family: "box",
|
|
733
|
-
noBase: "visible",
|
|
734
787
|
},
|
|
735
788
|
{
|
|
736
789
|
name: "overflow-y",
|
|
737
790
|
properties: ["overflow-y"],
|
|
738
791
|
mode: "keyword",
|
|
739
792
|
family: "box",
|
|
740
|
-
noBase: "visible",
|
|
741
793
|
},
|
|
742
794
|
{ name: "outline", pseudo: true, properties: ["outline"], mode: "raw", family: "box" },
|
|
743
795
|
{ name: "cursor", properties: ["cursor"], mode: "keyword", family: "box" },
|
|
@@ -749,7 +801,7 @@ export const UTILITIES = [
|
|
|
749
801
|
family: "box",
|
|
750
802
|
},
|
|
751
803
|
{ name: "visibility", pseudo: true, properties: ["visibility"], mode: "keyword", family: "box" },
|
|
752
|
-
{ name: "z", pseudo: true, properties: ["z-index"], mode: "raw", family: "box"
|
|
804
|
+
{ name: "z", pseudo: true, properties: ["z-index"], mode: "raw", family: "box" },
|
|
753
805
|
{ name: "object-fit", properties: ["object-fit"], mode: "keyword", family: "box" },
|
|
754
806
|
{ name: "object-position", properties: ["object-position"], mode: "raw", family: "box" },
|
|
755
807
|
// the divider between children for the divide-x / divide-y switches: the
|
package/src/base/utilities.ts
CHANGED
|
@@ -171,14 +171,10 @@ export interface Utility {
|
|
|
171
171
|
inherits?: true;
|
|
172
172
|
/**
|
|
173
173
|
* No-base allowlist: the CSS initial value as a literal. A utility with
|
|
174
|
-
* `noBase` applies a tier
|
|
174
|
+
* `noBase` applies a tier without a base value wherever no kit rule sets its
|
|
175
|
+
* property (the tier-only rule is in `@layer defaults`, which they beat).
|
|
175
176
|
*/
|
|
176
177
|
noBase?: string;
|
|
177
|
-
/**
|
|
178
|
-
* Extra selectors excluded from the no-base rule: elements whose
|
|
179
|
-
* placement chain a primitive owns, e.g. a layout's children for `--band`.
|
|
180
|
-
*/
|
|
181
|
-
noBaseExclude?: readonly string[];
|
|
182
178
|
/**
|
|
183
179
|
* Keywords the typed emission (the dual pair, or an integer's `repeat()`)
|
|
184
180
|
* cannot carry. A utility written with one of its keywords, at the base or
|
|
@@ -202,6 +198,37 @@ export interface Utility {
|
|
|
202
198
|
aliases?: Readonly<Record<string, string>>;
|
|
203
199
|
}
|
|
204
200
|
|
|
201
|
+
/**
|
|
202
|
+
* The utilities that compose into one `box-shadow` (ring and shadow): the
|
|
203
|
+
* composite's chains all end in a literal, so a tier alone works on them, like
|
|
204
|
+
* a no-base utility.
|
|
205
|
+
*/
|
|
206
|
+
export const BOX_SHADOW_COMPOSITE = [
|
|
207
|
+
"shadow",
|
|
208
|
+
"ring",
|
|
209
|
+
"ring-color",
|
|
210
|
+
"ring-offset",
|
|
211
|
+
"ring-offset-color",
|
|
212
|
+
] as const;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* The shorthands whose base a longhand's tier overrides, nearest first: `--p: 4;
|
|
216
|
+
* --px--md: 1` pads 4 below md and 1 inline from md. A shorthand's base is a
|
|
217
|
+
* base for its longhands' tiers.
|
|
218
|
+
*/
|
|
219
|
+
export const SHORTHAND_OF: Readonly<Record<string, readonly string[]>> = {
|
|
220
|
+
px: ["p"],
|
|
221
|
+
py: ["p"],
|
|
222
|
+
pt: ["py", "p"],
|
|
223
|
+
pb: ["py", "p"],
|
|
224
|
+
pl: ["px", "p"],
|
|
225
|
+
pr: ["px", "p"],
|
|
226
|
+
"gap-x": ["gap"],
|
|
227
|
+
"gap-y": ["gap"],
|
|
228
|
+
basis: ["flex"],
|
|
229
|
+
shrink: ["flex"],
|
|
230
|
+
};
|
|
231
|
+
|
|
205
232
|
/** Gradient types: `--bg-<type>` emits `<type>-gradient(<prelude>, <--bg-stops>)`. */
|
|
206
233
|
export const GRADIENT_TYPES = ["linear", "radial", "conic"] as const;
|
|
207
234
|
|
|
@@ -284,8 +311,6 @@ export const BORDER_SIDES = [
|
|
|
284
311
|
/** The four sizing keywords. Margin takes only `auto`. */
|
|
285
312
|
export const SIZING_KEYWORDS = ["auto", "fit-content", "min-content", "max-content"] as const;
|
|
286
313
|
export const MARGIN_KEYWORDS = ["auto"] as const;
|
|
287
|
-
/** A layout places its children; a tier-only column utility there keeps the band below the tier. */
|
|
288
|
-
const LAYOUT_CHILDREN = ["ui-layout > *", '[data-ui~="layout"] > *'] as const;
|
|
289
314
|
|
|
290
315
|
/**
|
|
291
316
|
* Track-list keywords `--grid-cols` / `--grid-rows` take besides a count. `none`
|
|
@@ -307,6 +332,37 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
307
332
|
family: "flow",
|
|
308
333
|
noBase: "static",
|
|
309
334
|
},
|
|
335
|
+
// anchor positioning: states and breakpoints, so the hovered (or open, or
|
|
336
|
+
// current) element can claim the anchor a toolbar or popover is tethered to.
|
|
337
|
+
// `normal` is position-anchor's initial value. Engines on the older draft
|
|
338
|
+
// don't know it, so the declaration is invalid at computed-value time and
|
|
339
|
+
// falls back to their initial value, `auto`.
|
|
340
|
+
{
|
|
341
|
+
name: "anchor-name",
|
|
342
|
+
properties: ["anchor-name"],
|
|
343
|
+
mode: "raw",
|
|
344
|
+
family: "flow",
|
|
345
|
+
tiers: "both",
|
|
346
|
+
noBase: "none",
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
name: "position-anchor",
|
|
350
|
+
properties: ["position-anchor"],
|
|
351
|
+
mode: "raw",
|
|
352
|
+
family: "flow",
|
|
353
|
+
tiers: "both",
|
|
354
|
+
noBase: "normal",
|
|
355
|
+
},
|
|
356
|
+
// where the tethered element sits on its anchor's 3×3 grid (`block-start
|
|
357
|
+
// span-inline-end`); a popover keeps its own area under a tier alone
|
|
358
|
+
{
|
|
359
|
+
name: "position-area",
|
|
360
|
+
properties: ["position-area"],
|
|
361
|
+
mode: "raw",
|
|
362
|
+
family: "flow",
|
|
363
|
+
tiers: "both",
|
|
364
|
+
noBase: "none",
|
|
365
|
+
},
|
|
310
366
|
{
|
|
311
367
|
name: "flex-wrap",
|
|
312
368
|
properties: ["flex-wrap"],
|
|
@@ -314,7 +370,6 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
314
370
|
family: "flow",
|
|
315
371
|
noBase: "nowrap",
|
|
316
372
|
},
|
|
317
|
-
{ name: "shrink", properties: ["flex-shrink"], mode: "raw", family: "flow", noBase: "1" },
|
|
318
373
|
{
|
|
319
374
|
name: "grid-flow",
|
|
320
375
|
properties: ["grid-auto-flow"],
|
|
@@ -361,6 +416,8 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
361
416
|
},
|
|
362
417
|
{ name: "self", properties: ["align-self"], mode: "keyword", family: "flow", noBase: "auto" },
|
|
363
418
|
{ name: "flex", properties: ["flex"], mode: "raw", family: "flow", noBase: "0 1 auto" },
|
|
419
|
+
// after --flex, so its base beats the shorthand's
|
|
420
|
+
{ name: "shrink", properties: ["flex-shrink"], mode: "raw", family: "flow", noBase: "1" },
|
|
364
421
|
{ name: "basis", properties: ["flex-basis"], mode: "raw", family: "flow", noBase: "auto" },
|
|
365
422
|
{ name: "order", properties: ["order"], mode: "raw", family: "flow", noBase: "0" },
|
|
366
423
|
// a layout child's band (`layout-md`); any grid-column value works
|
|
@@ -370,7 +427,6 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
370
427
|
mode: "raw",
|
|
371
428
|
family: "flow",
|
|
372
429
|
noBase: "auto",
|
|
373
|
-
noBaseExclude: LAYOUT_CHILDREN,
|
|
374
430
|
},
|
|
375
431
|
// Tailwind's col-span / col-start / col-end (and row-*): span is a count,
|
|
376
432
|
// start and end are line numbers; start and end follow span so they combine
|
|
@@ -381,7 +437,6 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
381
437
|
family: "flow",
|
|
382
438
|
emit: "span",
|
|
383
439
|
noBase: "1",
|
|
384
|
-
noBaseExclude: LAYOUT_CHILDREN,
|
|
385
440
|
},
|
|
386
441
|
{
|
|
387
442
|
name: "col-start",
|
|
@@ -389,7 +444,6 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
389
444
|
mode: "raw",
|
|
390
445
|
family: "flow",
|
|
391
446
|
noBase: "auto",
|
|
392
|
-
noBaseExclude: LAYOUT_CHILDREN,
|
|
393
447
|
},
|
|
394
448
|
{
|
|
395
449
|
name: "col-end",
|
|
@@ -397,7 +451,6 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
397
451
|
mode: "raw",
|
|
398
452
|
family: "flow",
|
|
399
453
|
noBase: "auto",
|
|
400
|
-
noBaseExclude: LAYOUT_CHILDREN,
|
|
401
454
|
},
|
|
402
455
|
{
|
|
403
456
|
name: "row-span",
|
|
@@ -459,26 +512,28 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
459
512
|
family: "grid",
|
|
460
513
|
emit: "grid-fit",
|
|
461
514
|
},
|
|
462
|
-
// spacing: dual mode; gap
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
name:
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
515
|
+
// spacing: dual mode; padding and gap are on the no-base allowlist (the reset
|
|
516
|
+
// zeroes padding, so `--px--md: 8` alone pads from md)
|
|
517
|
+
...(
|
|
518
|
+
[
|
|
519
|
+
["p", "padding"],
|
|
520
|
+
["px", "padding-inline"],
|
|
521
|
+
["py", "padding-block"],
|
|
522
|
+
["pt", "padding-block-start"],
|
|
523
|
+
["pb", "padding-block-end"],
|
|
524
|
+
["pl", "padding-inline-start"],
|
|
525
|
+
["pr", "padding-inline-end"],
|
|
526
|
+
] as const
|
|
527
|
+
).map(
|
|
528
|
+
([name, property]): Utility => ({
|
|
529
|
+
name,
|
|
530
|
+
pseudo: true,
|
|
531
|
+
properties: [property],
|
|
532
|
+
mode: "dual",
|
|
533
|
+
family: "spacing",
|
|
534
|
+
noBase: "0",
|
|
535
|
+
}),
|
|
536
|
+
),
|
|
482
537
|
{ name: "gap", properties: ["gap"], mode: "dual", family: "spacing", noBase: "0" },
|
|
483
538
|
{ name: "gap-x", properties: ["column-gap"], mode: "dual", family: "spacing", noBase: "0" },
|
|
484
539
|
{ name: "gap-y", properties: ["row-gap"], mode: "dual", family: "spacing", noBase: "0" },
|
|
@@ -665,6 +720,7 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
665
720
|
{ name: "whitespace", properties: ["white-space"], mode: "keyword", family: "typography" },
|
|
666
721
|
// color: states; bg-alpha feeds the bg emission
|
|
667
722
|
{ name: "text", properties: ["color"], mode: "raw", family: "color", pseudo: true },
|
|
723
|
+
// on the no-base allowlist: a plain element is transparent, so `--bg--hover` alone paints on hover
|
|
668
724
|
{
|
|
669
725
|
name: "bg",
|
|
670
726
|
properties: ["background-color"],
|
|
@@ -672,6 +728,7 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
672
728
|
family: "color",
|
|
673
729
|
emit: "bg",
|
|
674
730
|
pseudo: true,
|
|
731
|
+
noBase: "transparent",
|
|
675
732
|
},
|
|
676
733
|
{ name: "bg-alpha", properties: [], mode: "raw", family: "color", emit: "none" },
|
|
677
734
|
// gradients: the type utility carries the prelude (direction, shape, position,
|
|
@@ -835,22 +892,19 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
835
892
|
mode: "raw",
|
|
836
893
|
family: "box",
|
|
837
894
|
pseudo: true,
|
|
838
|
-
noBase: "0",
|
|
839
895
|
},
|
|
840
|
-
{ name: "overflow", properties: ["overflow"], mode: "keyword", family: "box"
|
|
896
|
+
{ name: "overflow", properties: ["overflow"], mode: "keyword", family: "box" },
|
|
841
897
|
{
|
|
842
898
|
name: "overflow-x",
|
|
843
899
|
properties: ["overflow-x"],
|
|
844
900
|
mode: "keyword",
|
|
845
901
|
family: "box",
|
|
846
|
-
noBase: "visible",
|
|
847
902
|
},
|
|
848
903
|
{
|
|
849
904
|
name: "overflow-y",
|
|
850
905
|
properties: ["overflow-y"],
|
|
851
906
|
mode: "keyword",
|
|
852
907
|
family: "box",
|
|
853
|
-
noBase: "visible",
|
|
854
908
|
},
|
|
855
909
|
{ name: "outline", pseudo: true, properties: ["outline"], mode: "raw", family: "box" },
|
|
856
910
|
{ name: "cursor", properties: ["cursor"], mode: "keyword", family: "box" },
|
|
@@ -862,7 +916,7 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
862
916
|
family: "box",
|
|
863
917
|
},
|
|
864
918
|
{ name: "visibility", pseudo: true, properties: ["visibility"], mode: "keyword", family: "box" },
|
|
865
|
-
{ name: "z", pseudo: true, properties: ["z-index"], mode: "raw", family: "box"
|
|
919
|
+
{ name: "z", pseudo: true, properties: ["z-index"], mode: "raw", family: "box" },
|
|
866
920
|
{ name: "object-fit", properties: ["object-fit"], mode: "keyword", family: "box" },
|
|
867
921
|
{ name: "object-position", properties: ["object-position"], mode: "raw", family: "box" },
|
|
868
922
|
// the divider between children for the divide-x / divide-y switches: the
|
package/src/head.d.ts
CHANGED
|
@@ -84,6 +84,12 @@ export interface HeadOptions {
|
|
|
84
84
|
fontDisplay?: "swap" | "optional" | false;
|
|
85
85
|
/** Include the inline theme-persistence script (last in head). Default `true`. */
|
|
86
86
|
theme?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* A CSP nonce for the two inline scripts (the import map and the theme
|
|
89
|
+
* script), so a strict `script-src 'nonce-…'` allows them. The page's own
|
|
90
|
+
* value, generated per response; never a constant.
|
|
91
|
+
*/
|
|
92
|
+
nonce?: string;
|
|
87
93
|
/**
|
|
88
94
|
* Local granular grain: the primitives this page uses, loaded file by file
|
|
89
95
|
* from `base` (base layers, the closure's stylesheets in cascade order, one
|
package/src/head.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"head.d.ts","sourceRoot":"","sources":["head.ts"],"names":[],"mappings":"AA6BA,wDAAwD;AACxD,UAAU,aAAa;IACrB,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;
|
|
1
|
+
{"version":3,"file":"head.d.ts","sourceRoot":"","sources":["head.ts"],"names":[],"mappings":"AA6BA,wDAAwD;AACxD,UAAU,aAAa;IACrB,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAwCD;;;;;;GAMG;AACH,iBAAS,MAAM,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAE1C;AAED;;;;;GAKG;AACH,QAAA,MAAM,gBAAgB,EAAE,SAAS,aAAa,EA+B7C,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,SAAS,EAAE,SAAS,aAAa,EAOtC,CAAC;AAwFF,iEAAiE;AACjE,MAAM,WAAW,cAAc;IAC7B,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED,+BAA+B;AAC/B,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,GAAG,CAAC,EAAE,cAAc,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