@unocss/preset-mini 0.55.1 → 0.55.2

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.
Files changed (56) hide show
  1. package/dist/colors.cjs +360 -6
  2. package/dist/{colors-dabdd21f.d.ts → colors.d.cts} +3 -2
  3. package/dist/colors.d.mts +354 -0
  4. package/dist/colors.d.ts +353 -2
  5. package/dist/colors.mjs +361 -1
  6. package/dist/index.cjs +12 -12
  7. package/dist/index.d.cts +69 -0
  8. package/dist/index.d.mts +69 -0
  9. package/dist/index.d.ts +6 -6
  10. package/dist/index.mjs +9 -10
  11. package/dist/rules.cjs +928 -48
  12. package/dist/rules.d.cts +133 -0
  13. package/dist/rules.d.mts +133 -0
  14. package/dist/rules.d.ts +1 -1
  15. package/dist/rules.mjs +891 -4
  16. package/dist/{default-1f25a0ae.d.ts → shared/preset-mini.024bdcea.d.ts} +1 -1
  17. package/dist/shared/preset-mini.0a9763df.d.mts +721 -0
  18. package/dist/shared/preset-mini.0fac4963.mjs +320 -0
  19. package/dist/shared/preset-mini.5bfee53b.cjs +344 -0
  20. package/dist/shared/preset-mini.5f54784f.d.mts +71 -0
  21. package/dist/shared/preset-mini.5f54784f.d.ts +71 -0
  22. package/dist/shared/preset-mini.aa3a264b.d.cts +67 -0
  23. package/dist/shared/{preset-mini.a21c5071.cjs → preset-mini.b4ad509c.cjs} +12 -8
  24. package/dist/shared/preset-mini.d69a12a5.d.cts +721 -0
  25. package/dist/{utilities-d496540e.d.ts → shared/preset-mini.e93c20db.d.ts} +1 -1
  26. package/dist/shared/{preset-mini.6c1c8016.mjs → preset-mini.f1fe435e.mjs} +13 -9
  27. package/dist/shared/preset-mini.fc26b619.d.mts +67 -0
  28. package/dist/theme.cjs +308 -34
  29. package/dist/theme.d.cts +264 -0
  30. package/dist/theme.d.mts +264 -0
  31. package/dist/theme.d.ts +5 -5
  32. package/dist/theme.mjs +284 -4
  33. package/dist/utils.cjs +81 -10
  34. package/dist/utils.d.cts +83 -0
  35. package/dist/utils.d.mts +83 -0
  36. package/dist/utils.d.ts +20 -20
  37. package/dist/utils.mjs +81 -3
  38. package/dist/variants.cjs +737 -33
  39. package/dist/variants.d.cts +46 -0
  40. package/dist/variants.d.mts +46 -0
  41. package/dist/variants.d.ts +4 -4
  42. package/dist/variants.mjs +714 -4
  43. package/package.json +3 -3
  44. package/dist/shared/preset-mini.0131b915.mjs +0 -704
  45. package/dist/shared/preset-mini.1c66bf79.mjs +0 -361
  46. package/dist/shared/preset-mini.74f9d55e.mjs +0 -80
  47. package/dist/shared/preset-mini.811eb23d.mjs +0 -681
  48. package/dist/shared/preset-mini.8dd73081.mjs +0 -452
  49. package/dist/shared/preset-mini.9d93761b.cjs +0 -729
  50. package/dist/shared/preset-mini.b8d9397e.cjs +0 -471
  51. package/dist/shared/preset-mini.ce5169f2.cjs +0 -730
  52. package/dist/shared/preset-mini.d778b487.cjs +0 -85
  53. package/dist/shared/preset-mini.de3bd9f7.mjs +0 -284
  54. package/dist/shared/preset-mini.e078d7da.cjs +0 -313
  55. package/dist/shared/preset-mini.f3fc54d2.cjs +0 -363
  56. /package/dist/{types-d991ba46.d.ts → shared/preset-mini.5f54784f.d.cts} +0 -0
package/dist/rules.mjs CHANGED
@@ -1,4 +1,891 @@
1
- export { E as alignments, B as appearance, q as appearances, b as bgColors, T as borderStyles, a as borders, m as boxShadows, R as boxShadowsBase, K as boxSizing, y as breaks, c as colorScheme, O as contains, e as contentVisibility, f as contents, n as cursors, d as displays, G as flexGridJustifiesAlignments, I as floats, l as fontSmoothings, k as fontStyles, U as handlerBorderStyle, H as insets, D as justifies, o as opacity, C as orders, A as outline, z as overflows, F as placements, s as pointerEvents, p as positions, u as resizes, S as ringBase, r as rings, i as textAligns, j as textColors, g as textDecorations, t as textOverflows, h as textTransforms, P as textWraps, Q as transformBase, M as transforms, L as transitions, w as userSelects, V as varEmpty, v as verticalAligns, x as whitespaces, N as willChange, J as zIndexes } from './shared/preset-mini.811eb23d.mjs';
2
- export { b as aspectRatio, c as containerParent, l as cssProperty, k as cssVariables, f as flex, e as fonts, g as gaps, a as grids, m as margins, p as paddings, q as questionMark, r as rules, s as sizes, d as svgUtilities, t as tabSizes, h as textIndents, j as textShadows, i as textStrokes } from './shared/preset-mini.8dd73081.mjs';
3
- import './shared/preset-mini.6c1c8016.mjs';
4
- import '@unocss/core';
1
+ import { g as globalKeywords, h, c as colorResolver, l as directionMap, a as hasParseableColor, o as cornerMap, p as parseColor, k as colorToString, j as colorOpacityToString, z as numberWithUnitRE, m as makeGlobalStaticRules, s as splitShorthand, b as colorableShadows, n as insetMap, u as resolveVerticalBreakpoints, t as resolveBreakpoints, r as directionSize } from './shared/preset-mini.f1fe435e.mjs';
2
+ import { warnOnce, toArray } from '@unocss/core';
3
+ import { d as displays, c as contentVisibility, a as contents, e as textOverflows, f as textTransforms, g as fontStyles, h as fontSmoothings, i as boxShadows, j as rings, k as cursors, l as appearances, p as pointerEvents, m as resizes, u as userSelects, w as whitespaces, n as breaks, o as transforms, q as contains, s as textWraps } from './shared/preset-mini.0fac4963.mjs';
4
+ export { b as boxShadowsBase, r as ringBase, t as transformBase, v as varEmpty } from './shared/preset-mini.0fac4963.mjs';
5
+
6
+ const verticalAlignAlias = {
7
+ "mid": "middle",
8
+ "base": "baseline",
9
+ "btm": "bottom",
10
+ "baseline": "baseline",
11
+ "top": "top",
12
+ "start": "top",
13
+ "middle": "middle",
14
+ "bottom": "bottom",
15
+ "end": "bottom",
16
+ "text-top": "text-top",
17
+ "text-bottom": "text-bottom",
18
+ "sub": "sub",
19
+ "super": "super",
20
+ ...Object.fromEntries(globalKeywords.map((x) => [x, x]))
21
+ };
22
+ const verticalAligns = [
23
+ [/^(?:vertical|align|v)-([-\w]+)$/, ([, v]) => ({ "vertical-align": verticalAlignAlias[v] }), { autocomplete: `(vertical|align|v)-(${Object.keys(verticalAlignAlias).join("|")})` }]
24
+ ];
25
+ const textAligns = ["center", "left", "right", "justify", "start", "end"].map((v) => [`text-${v}`, { "text-align": v }]);
26
+
27
+ const outline = [
28
+ // size
29
+ [/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ?? h.bracket.cssvar.global.px(d) }), { autocomplete: "outline-(width|size)-<num>" }],
30
+ // color
31
+ [/^outline-(?:color-)?(.+)$/, colorResolver("outline-color", "outline-color"), { autocomplete: "outline-$colors" }],
32
+ // offset
33
+ [/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ?? h.bracket.cssvar.global.px(d) }), { autocomplete: "outline-(offset)-<num>" }],
34
+ // style
35
+ ["outline", { "outline-style": "solid" }],
36
+ ...["auto", "dashed", "dotted", "double", "hidden", "solid", "groove", "ridge", "inset", "outset", ...globalKeywords].map((v) => [`outline-${v}`, { "outline-style": v }]),
37
+ ["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }]
38
+ ];
39
+ const appearance = [
40
+ ["appearance-none", {
41
+ "-webkit-appearance": "none",
42
+ "appearance": "none"
43
+ }]
44
+ ];
45
+ function willChangeProperty(prop) {
46
+ return h.properties.auto.global(prop) ?? {
47
+ contents: "contents",
48
+ scroll: "scroll-position"
49
+ }[prop];
50
+ }
51
+ const willChange = [
52
+ [/^will-change-(.+)/, ([, p]) => ({ "will-change": willChangeProperty(p) })]
53
+ ];
54
+
55
+ const borderStyles = ["solid", "dashed", "dotted", "double", "hidden", "none", "groove", "ridge", "inset", "outset", ...globalKeywords];
56
+ const borders = [
57
+ // compound
58
+ [/^(?:border|b)()(?:-(.+))?$/, handlerBorder, { autocomplete: "(border|b)-<directions>" }],
59
+ [/^(?:border|b)-([xy])(?:-(.+))?$/, handlerBorder],
60
+ [/^(?:border|b)-([rltbse])(?:-(.+))?$/, handlerBorder],
61
+ [/^(?:border|b)-(block|inline)(?:-(.+))?$/, handlerBorder],
62
+ [/^(?:border|b)-([bi][se])(?:-(.+))?$/, handlerBorder],
63
+ // size
64
+ [/^(?:border|b)-()(?:width|size)-(.+)$/, handlerBorderSize, { autocomplete: ["(border|b)-<num>", "(border|b)-<directions>-<num>"] }],
65
+ [/^(?:border|b)-([xy])-(?:width|size)-(.+)$/, handlerBorderSize],
66
+ [/^(?:border|b)-([rltbse])-(?:width|size)-(.+)$/, handlerBorderSize],
67
+ [/^(?:border|b)-(block|inline)-(?:width|size)-(.+)$/, handlerBorderSize],
68
+ [/^(?:border|b)-([bi][se])-(?:width|size)-(.+)$/, handlerBorderSize],
69
+ // colors
70
+ [/^(?:border|b)-()(?:color-)?(.+)$/, handlerBorderColor, { autocomplete: ["(border|b)-$colors", "(border|b)-<directions>-$colors"] }],
71
+ [/^(?:border|b)-([xy])-(?:color-)?(.+)$/, handlerBorderColor],
72
+ [/^(?:border|b)-([rltbse])-(?:color-)?(.+)$/, handlerBorderColor],
73
+ [/^(?:border|b)-(block|inline)-(?:color-)?(.+)$/, handlerBorderColor],
74
+ [/^(?:border|b)-([bi][se])-(?:color-)?(.+)$/, handlerBorderColor],
75
+ // opacity
76
+ [/^(?:border|b)-()op(?:acity)?-?(.+)$/, handlerBorderOpacity, { autocomplete: "(border|b)-(op|opacity)-<percent>" }],
77
+ [/^(?:border|b)-([xy])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
78
+ [/^(?:border|b)-([rltbse])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
79
+ [/^(?:border|b)-(block|inline)-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
80
+ [/^(?:border|b)-([bi][se])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
81
+ // radius
82
+ [/^(?:border-|b-)?(?:rounded|rd)()(?:-(.+))?$/, handlerRounded, { autocomplete: ["(border|b)-(rounded|rd)", "(border|b)-(rounded|rd)-<num>", "(rounded|rd)", "(rounded|rd)-<num>"] }],
83
+ [/^(?:border-|b-)?(?:rounded|rd)-([rltbse])(?:-(.+))?$/, handlerRounded],
84
+ [/^(?:border-|b-)?(?:rounded|rd)-([rltb]{2})(?:-(.+))?$/, handlerRounded],
85
+ [/^(?:border-|b-)?(?:rounded|rd)-([bise][se])(?:-(.+))?$/, handlerRounded],
86
+ [/^(?:border-|b-)?(?:rounded|rd)-([bi][se]-[bi][se])(?:-(.+))?$/, handlerRounded],
87
+ // style
88
+ [/^(?:border|b)-(?:style-)?()(.+)$/, handlerBorderStyle, { autocomplete: ["(border|b)-style", `(border|b)-(${borderStyles.join("|")})`, "(border|b)-<directions>-style", `(border|b)-<directions>-(${borderStyles.join("|")})`, `(border|b)-<directions>-style-(${borderStyles.join("|")})`, `(border|b)-style-(${borderStyles.join("|")})`] }],
89
+ [/^(?:border|b)-([xy])-(?:style-)?(.+)$/, handlerBorderStyle],
90
+ [/^(?:border|b)-([rltbse])-(?:style-)?(.+)$/, handlerBorderStyle],
91
+ [/^(?:border|b)-(block|inline)-(?:style-)?(.+)$/, handlerBorderStyle],
92
+ [/^(?:border|b)-([bi][se])-(?:style-)?(.+)$/, handlerBorderStyle]
93
+ ];
94
+ function borderColorResolver(direction) {
95
+ return ([, body], theme) => {
96
+ const data = parseColor(body, theme);
97
+ if (!data)
98
+ return;
99
+ const { alpha, color, cssColor } = data;
100
+ if (cssColor) {
101
+ if (alpha != null) {
102
+ return {
103
+ [`border${direction}-color`]: colorToString(cssColor, alpha)
104
+ };
105
+ }
106
+ if (direction === "") {
107
+ return {
108
+ "--un-border-opacity": colorOpacityToString(cssColor),
109
+ "border-color": colorToString(cssColor, "var(--un-border-opacity)")
110
+ };
111
+ } else {
112
+ return {
113
+ // Separate this return since if `direction` is an empty string, the first key will be overwritten by the second.
114
+ "--un-border-opacity": colorOpacityToString(cssColor),
115
+ [`--un-border${direction}-opacity`]: "var(--un-border-opacity)",
116
+ [`border${direction}-color`]: colorToString(cssColor, `var(--un-border${direction}-opacity)`)
117
+ };
118
+ }
119
+ } else if (color) {
120
+ return {
121
+ [`border${direction}-color`]: colorToString(color, alpha)
122
+ };
123
+ }
124
+ };
125
+ }
126
+ function handlerBorder(m, ctx) {
127
+ return handlerBorderSize(m, ctx);
128
+ }
129
+ function handlerBorderSize([, a = "", b], { theme }) {
130
+ const v = theme.lineWidth?.[b || "DEFAULT"] ?? h.bracket.cssvar.global.px(b || "1");
131
+ if (a in directionMap && v != null)
132
+ return directionMap[a].map((i) => [`border${i}-width`, v]);
133
+ }
134
+ function handlerBorderColor([, a = "", c], { theme }) {
135
+ if (a in directionMap && hasParseableColor(c, theme)) {
136
+ return Object.assign(
137
+ {},
138
+ ...directionMap[a].map((i) => borderColorResolver(i)(["", c], theme))
139
+ );
140
+ }
141
+ }
142
+ function handlerBorderOpacity([, a = "", opacity]) {
143
+ const v = h.bracket.percent.cssvar(opacity);
144
+ if (a in directionMap && v != null)
145
+ return directionMap[a].map((i) => [`--un-border${i}-opacity`, v]);
146
+ }
147
+ function handlerRounded([, a = "", s], { theme }) {
148
+ const v = theme.borderRadius?.[s || "DEFAULT"] || h.bracket.cssvar.global.fraction.rem(s || "1");
149
+ if (a in cornerMap && v != null)
150
+ return cornerMap[a].map((i) => [`border${i}-radius`, v]);
151
+ }
152
+ function handlerBorderStyle([, a = "", s]) {
153
+ if (borderStyles.includes(s) && a in directionMap)
154
+ return directionMap[a].map((i) => [`border${i}-style`, s]);
155
+ }
156
+
157
+ const opacity = [
158
+ [/^op(?:acity)?-?(.+)$/, ([, d]) => ({ opacity: h.bracket.percent.cssvar(d) })]
159
+ ];
160
+ const textColors = [
161
+ [/^(?:color|c)-(.+)$/, colorResolver("color", "text"), { autocomplete: "(color|c)-$colors" }],
162
+ // auto detection and fallback to font-size if the content looks like a size
163
+ [/^text-(.+)$/, colorResolver("color", "text", (css) => !css.color?.toString().match(numberWithUnitRE)), { autocomplete: "text-$colors" }],
164
+ [/^(?:text|color|c)-(.+)$/, ([, v]) => globalKeywords.includes(v) ? { color: v } : void 0, { autocomplete: `(text|color|c)-(${globalKeywords.join("|")})` }],
165
+ [/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-text-opacity": h.bracket.percent.cssvar(opacity2) }), { autocomplete: "(text|color|c)-(op|opacity)-<percent>" }]
166
+ ];
167
+ const bgColors = [
168
+ [/^bg-(.+)$/, colorResolver("background-color", "bg"), { autocomplete: "bg-$colors" }],
169
+ [/^bg-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-bg-opacity": h.bracket.percent.cssvar(opacity2) }), { autocomplete: "bg-(op|opacity)-<percent>" }]
170
+ ];
171
+ const colorScheme = [
172
+ [/^color-scheme-(\w+)$/, ([, v]) => ({ "color-scheme": v })]
173
+ ];
174
+
175
+ const containerParent = [
176
+ [/^@container(?:\/(\w+))?(?:-(normal))?$/, ([, l, v]) => {
177
+ warnOnce("The container query rule is experimental and may not follow semver.");
178
+ return {
179
+ "container-type": v ?? "inline-size",
180
+ "container-name": l
181
+ };
182
+ }]
183
+ ];
184
+
185
+ const decorationStyles = ["solid", "double", "dotted", "dashed", "wavy", ...globalKeywords];
186
+ const textDecorations = [
187
+ [/^(?:decoration-)?(underline|overline|line-through)$/, ([, s]) => ({ "text-decoration-line": s }), { autocomplete: "decoration-(underline|overline|line-through)" }],
188
+ // size
189
+ [/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? h.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
190
+ [/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s }), { autocomplete: "(underline|decoration)-(auto|from-font)" }],
191
+ // colors
192
+ [/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
193
+ const result = colorResolver("text-decoration-color", "line")(match, ctx);
194
+ if (result) {
195
+ return {
196
+ "-webkit-text-decoration-color": result["text-decoration-color"],
197
+ ...result
198
+ };
199
+ }
200
+ }, { autocomplete: "(underline|decoration)-$colors" }],
201
+ [/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "(underline|decoration)-(op|opacity)-<percent>" }],
202
+ // offset
203
+ [/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? h.auto.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
204
+ // style
205
+ ...decorationStyles.map((v) => [`underline-${v}`, { "text-decoration-style": v }]),
206
+ ...decorationStyles.map((v) => [`decoration-${v}`, { "text-decoration-style": v }]),
207
+ ["no-underline", { "text-decoration": "none" }],
208
+ ["decoration-none", { "text-decoration": "none" }]
209
+ ];
210
+
211
+ const transitionPropertyGroup = {
212
+ all: "all",
213
+ colors: ["color", "background-color", "border-color", "outline-color", "text-decoration-color", "fill", "stroke"].join(","),
214
+ none: "none",
215
+ opacity: "opacity",
216
+ shadow: "box-shadow",
217
+ transform: "transform"
218
+ };
219
+ function transitionProperty(prop) {
220
+ return h.properties(prop) ?? transitionPropertyGroup[prop];
221
+ }
222
+ const transitions = [
223
+ // transition
224
+ [/^transition(?:-([a-z-]+(?:,[a-z-]+)*))?(?:-(\d+))?$/, ([, prop, d], { theme }) => {
225
+ const p = prop != null ? transitionProperty(prop) : [transitionPropertyGroup.colors, "opacity", "box-shadow", "transform", "filter", "backdrop-filter"].join(",");
226
+ if (p) {
227
+ const duration = theme.duration?.[d || "DEFAULT"] ?? h.time(d || "150");
228
+ return {
229
+ "transition-property": p,
230
+ "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)",
231
+ "transition-duration": duration
232
+ };
233
+ }
234
+ }, { autocomplete: `transition-(${Object.keys(transitionPropertyGroup).join("|")})` }],
235
+ // timings
236
+ [
237
+ /^(?:transition-)?duration-(.+)$/,
238
+ ([, d], { theme }) => ({ "transition-duration": theme.duration?.[d || "DEFAULT"] ?? h.bracket.cssvar.time(d) }),
239
+ { autocomplete: ["transition-duration-$duration", "duration-$duration"] }
240
+ ],
241
+ [
242
+ /^(?:transition-)?delay-(.+)$/,
243
+ ([, d], { theme }) => ({ "transition-delay": theme.duration?.[d || "DEFAULT"] ?? h.bracket.cssvar.time(d) }),
244
+ { autocomplete: ["transition-delay-$duration", "delay-$duration"] }
245
+ ],
246
+ [
247
+ /^(?:transition-)?ease(?:-(.+))?$/,
248
+ ([, d], { theme }) => ({ "transition-timing-function": theme.easing?.[d || "DEFAULT"] ?? h.bracket.cssvar(d) }),
249
+ { autocomplete: ["transition-ease-(linear|in|out|in-out|DEFAULT)", "ease-(linear|in|out|in-out|DEFAULT)"] }
250
+ ],
251
+ // props
252
+ [
253
+ /^(?:transition-)?property-(.+)$/,
254
+ ([, v]) => ({ "transition-property": h.bracket.global(v) || transitionProperty(v) }),
255
+ { autocomplete: [`transition-property-(${[...globalKeywords, ...Object.keys(transitionPropertyGroup)].join("|")})`] }
256
+ ],
257
+ // none
258
+ ["transition-none", { transition: "none" }],
259
+ ...makeGlobalStaticRules("transition")
260
+ ];
261
+
262
+ const flex = [
263
+ // display
264
+ ["flex", { display: "flex" }],
265
+ ["inline-flex", { display: "inline-flex" }],
266
+ ["flex-inline", { display: "inline-flex" }],
267
+ // flex
268
+ [/^flex-(.*)$/, ([, d]) => ({ flex: h.bracket(d) != null ? h.bracket(d).split(" ").map((e) => h.cssvar.fraction(e) ?? e).join(" ") : h.cssvar.fraction(d) })],
269
+ ["flex-1", { flex: "1 1 0%" }],
270
+ ["flex-auto", { flex: "1 1 auto" }],
271
+ ["flex-initial", { flex: "0 1 auto" }],
272
+ ["flex-none", { flex: "none" }],
273
+ // shrink/grow/basis
274
+ [/^(?:flex-)?shrink(?:-(.*))?$/, ([, d = ""]) => ({ "flex-shrink": h.bracket.cssvar.number(d) ?? 1 }), { autocomplete: ["flex-shrink-<num>", "shrink-<num>"] }],
275
+ [/^(?:flex-)?grow(?:-(.*))?$/, ([, d = ""]) => ({ "flex-grow": h.bracket.cssvar.number(d) ?? 1 }), { autocomplete: ["flex-grow-<num>", "grow-<num>"] }],
276
+ [/^(?:flex-)?basis-(.+)$/, ([, d], { theme }) => ({ "flex-basis": theme.spacing?.[d] ?? h.bracket.cssvar.auto.fraction.rem(d) }), { autocomplete: ["flex-basis-$spacing", "basis-$spacing"] }],
277
+ // directions
278
+ ["flex-row", { "flex-direction": "row" }],
279
+ ["flex-row-reverse", { "flex-direction": "row-reverse" }],
280
+ ["flex-col", { "flex-direction": "column" }],
281
+ ["flex-col-reverse", { "flex-direction": "column-reverse" }],
282
+ // wraps
283
+ ["flex-wrap", { "flex-wrap": "wrap" }],
284
+ ["flex-wrap-reverse", { "flex-wrap": "wrap-reverse" }],
285
+ ["flex-nowrap", { "flex-wrap": "nowrap" }]
286
+ ];
287
+
288
+ function handleLineHeight(s, theme) {
289
+ return theme.lineHeight?.[s] || h.bracket.cssvar.global.rem(s);
290
+ }
291
+ const fonts = [
292
+ // size
293
+ [
294
+ /^text-(.+)$/,
295
+ ([, s = "base"], { theme }) => {
296
+ const [size, leading] = splitShorthand(s, "length");
297
+ const sizePairs = toArray(theme.fontSize?.[size]);
298
+ const lineHeight = leading ? handleLineHeight(leading, theme) : void 0;
299
+ if (sizePairs?.[0]) {
300
+ const [fontSize2, height] = sizePairs;
301
+ return {
302
+ "font-size": fontSize2,
303
+ "line-height": lineHeight ?? height ?? "1"
304
+ };
305
+ }
306
+ const fontSize = h.bracketOfLength.rem(size);
307
+ if (lineHeight && fontSize) {
308
+ return {
309
+ "font-size": fontSize,
310
+ "line-height": lineHeight
311
+ };
312
+ }
313
+ return { "font-size": h.bracketOfLength.rem(s) };
314
+ },
315
+ { autocomplete: "text-$fontSize" }
316
+ ],
317
+ [/^(?:text|font)-size-(.+)$/, ([, s], { theme }) => {
318
+ const themed = toArray(theme.fontSize?.[s]);
319
+ const size = themed?.[0] ?? h.bracket.cssvar.global.rem(s);
320
+ if (size != null)
321
+ return { "font-size": size };
322
+ }, { autocomplete: "text-size-$fontSize" }],
323
+ // weights
324
+ [
325
+ /^(?:font|fw)-?([^-]+)$/,
326
+ ([, s], { theme }) => ({ "font-weight": theme.fontWeight?.[s] || h.bracket.global.number(s) }),
327
+ {
328
+ autocomplete: [
329
+ "(font|fw)-(100|200|300|400|500|600|700|800|900)",
330
+ "(font|fw)-$fontWeight"
331
+ ]
332
+ }
333
+ ],
334
+ // leadings
335
+ [
336
+ /^(?:font-)?(?:leading|lh|line-height)-(.+)$/,
337
+ ([, s], { theme }) => ({ "line-height": handleLineHeight(s, theme) }),
338
+ { autocomplete: "(leading|lh|line-height)-$lineHeight" }
339
+ ],
340
+ // synthesis
341
+ ["font-synthesis-weight", { "font-synthesis": "weight" }],
342
+ ["font-synthesis-style", { "font-synthesis": "style" }],
343
+ ["font-synthesis-small-caps", { "font-synthesis": "small-caps" }],
344
+ ["font-synthesis-none", { "font-synthesis": "none" }],
345
+ [/^font-synthesis-(.+)$/, ([, s]) => ({ "font-synthesis": h.bracket.cssvar.global(s) })],
346
+ // tracking
347
+ [
348
+ /^(?:font-)?tracking-(.+)$/,
349
+ ([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || h.bracket.cssvar.global.rem(s) }),
350
+ { autocomplete: "tracking-$letterSpacing" }
351
+ ],
352
+ // word-spacing
353
+ [
354
+ /^(?:font-)?word-spacing-(.+)$/,
355
+ ([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] || h.bracket.cssvar.global.rem(s) }),
356
+ { autocomplete: "word-spacing-$wordSpacing" }
357
+ ],
358
+ // family
359
+ [
360
+ /^font-(.+)$/,
361
+ ([, d], { theme }) => ({ "font-family": theme.fontFamily?.[d] || h.bracket.cssvar.global(d) }),
362
+ { autocomplete: "font-$fontFamily" }
363
+ ]
364
+ ];
365
+ const tabSizes = [
366
+ [/^tab(?:-(.+))?$/, ([, s]) => {
367
+ const v = h.bracket.cssvar.global.number(s || "4");
368
+ if (v != null) {
369
+ return {
370
+ "-moz-tab-size": v,
371
+ "-o-tab-size": v,
372
+ "tab-size": v
373
+ };
374
+ }
375
+ }]
376
+ ];
377
+ const textIndents = [
378
+ [/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] || h.bracket.cssvar.global.fraction.rem(s) }), { autocomplete: "indent-$textIndent" }]
379
+ ];
380
+ const textStrokes = [
381
+ // widths
382
+ [/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => ({ "-webkit-text-stroke-width": theme.textStrokeWidth?.[s || "DEFAULT"] || h.bracket.cssvar.px(s) }), { autocomplete: "text-stroke-$textStrokeWidth" }],
383
+ // colors
384
+ [/^text-stroke-(.+)$/, colorResolver("-webkit-text-stroke-color", "text-stroke"), { autocomplete: "text-stroke-$colors" }],
385
+ [/^text-stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-stroke-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "text-stroke-(op|opacity)-<percent>" }]
386
+ ];
387
+ const textShadows = [
388
+ [/^text-shadow(?:-(.+))?$/, ([, s], { theme }) => {
389
+ const v = theme.textShadow?.[s || "DEFAULT"];
390
+ if (v != null) {
391
+ return {
392
+ "--un-text-shadow": colorableShadows(v, "--un-text-shadow-color").join(","),
393
+ "text-shadow": "var(--un-text-shadow)"
394
+ };
395
+ }
396
+ return { "text-shadow": h.bracket.cssvar.global(s) };
397
+ }, { autocomplete: "text-shadow-$textShadow" }],
398
+ // colors
399
+ [/^text-shadow-color-(.+)$/, colorResolver("--un-text-shadow-color", "text-shadow"), { autocomplete: "text-shadow-color-$colors" }],
400
+ [/^text-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-shadow-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "text-shadow-color-(op|opacity)-<percent>" }]
401
+ ];
402
+
403
+ const directions = {
404
+ "": "",
405
+ "x": "column-",
406
+ "y": "row-"
407
+ };
408
+ function handleGap([, d = "", s], { theme }) {
409
+ const v = theme.spacing?.[s] ?? h.bracket.cssvar.global.rem(s);
410
+ if (v != null) {
411
+ return {
412
+ [`${directions[d]}gap`]: v
413
+ };
414
+ }
415
+ }
416
+ const gaps = [
417
+ [/^(?:flex-|grid-)?gap-?()(.+)$/, handleGap, { autocomplete: ["gap-$spacing", "gap-<num>"] }],
418
+ [/^(?:flex-|grid-)?gap-([xy])-?(.+)$/, handleGap, { autocomplete: ["gap-(x|y)-$spacing", "gap-(x|y)-<num>"] }]
419
+ ];
420
+
421
+ function rowCol(s) {
422
+ return s.replace("col", "column");
423
+ }
424
+ function rowColTheme(s) {
425
+ return s[0] === "r" ? "Row" : "Column";
426
+ }
427
+ function autoDirection(c, theme, prop) {
428
+ const v = theme[`gridAuto${rowColTheme(c)}`]?.[prop];
429
+ if (v != null)
430
+ return v;
431
+ switch (prop) {
432
+ case "min":
433
+ return "min-content";
434
+ case "max":
435
+ return "max-content";
436
+ case "fr":
437
+ return "minmax(0,1fr)";
438
+ }
439
+ return h.bracket.cssvar.auto.rem(prop);
440
+ }
441
+ const grids = [
442
+ // displays
443
+ ["grid", { display: "grid" }],
444
+ ["inline-grid", { display: "inline-grid" }],
445
+ // global
446
+ [/^(?:grid-)?(row|col)-(.+)$/, ([, c, v], { theme }) => ({
447
+ [`grid-${rowCol(c)}`]: theme[`grid${rowColTheme(c)}`]?.[v] ?? h.bracket.cssvar.auto(v)
448
+ })],
449
+ // span
450
+ [/^(?:grid-)?(row|col)-span-(.+)$/, ([, c, s]) => {
451
+ if (s === "full")
452
+ return { [`grid-${rowCol(c)}`]: "1/-1" };
453
+ const v = h.bracket.number(s);
454
+ if (v != null)
455
+ return { [`grid-${rowCol(c)}`]: `span ${v}/span ${v}` };
456
+ }, { autocomplete: ["grid-(row|col)-span-<num>", "(row|col)-span-<num>"] }],
457
+ // starts & ends
458
+ [/^(?:grid-)?(row|col)-start-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-start`]: h.bracket.cssvar(v) ?? v })],
459
+ [/^(?:grid-)?(row|col)-end-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]: h.bracket.cssvar(v) ?? v }), { autocomplete: ["grid-(row|col)-(start|end)-<num>"] }],
460
+ // auto flows
461
+ [/^(?:grid-)?auto-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({ [`grid-auto-${rowCol(c)}`]: autoDirection(c, theme, v) }), { autocomplete: ["grid-auto-(rows|cols)-<num>"] }],
462
+ // grid-auto-flow, auto-flow: uno
463
+ // grid-flow: wind
464
+ [/^(?:grid-auto-flow|auto-flow|grid-flow)-(.+)$/, ([, v]) => ({ "grid-auto-flow": h.bracket.cssvar(v) })],
465
+ [/^(?:grid-auto-flow|auto-flow|grid-flow)-(row|col|dense|row-dense|col-dense)$/, ([, v]) => ({ "grid-auto-flow": rowCol(v).replace("-", " ") }), { autocomplete: ["(grid-auto-flow|auto-flow|grid-flow)-(row|col|dense|row-dense|col-dense)"] }],
466
+ // templates
467
+ [/^grid-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({
468
+ [`grid-template-${rowCol(c)}`]: theme[`gridTemplate${rowColTheme(c)}`]?.[v] ?? h.bracket.cssvar(v)
469
+ })],
470
+ [/^grid-(rows|cols)-minmax-([\w.-]+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(auto-fill,minmax(${d},1fr))` })],
471
+ [/^grid-(rows|cols)-(\d+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(${d},minmax(0,1fr))` }), { autocomplete: ["grid-(rows|cols)-<num>", "grid-(rows|cols)-none"] }],
472
+ // areas
473
+ [/^grid-area(s)?-(.+)$/, ([, s, v]) => {
474
+ if (s != null)
475
+ return { "grid-template-areas": h.cssvar(v) ?? v.split("-").map((s2) => `"${h.bracket(s2)}"`).join(" ") };
476
+ return { "grid-area": h.bracket.cssvar(v) };
477
+ }],
478
+ // template none
479
+ ["grid-rows-none", { "grid-template-rows": "none" }],
480
+ ["grid-cols-none", { "grid-template-columns": "none" }]
481
+ ];
482
+
483
+ const overflowValues = [
484
+ "auto",
485
+ "hidden",
486
+ "clip",
487
+ "visible",
488
+ "scroll",
489
+ "overlay",
490
+ ...globalKeywords
491
+ ];
492
+ const overflows = [
493
+ [/^(?:overflow|of)-(.+)$/, ([, v]) => overflowValues.includes(v) ? { overflow: v } : void 0, { autocomplete: [`(overflow|of)-(${overflowValues.join("|")})`, `(overflow|of)-(x|y)-(${overflowValues.join("|")})`] }],
494
+ [/^(?:overflow|of)-([xy])-(.+)$/, ([, d, v]) => overflowValues.includes(v) ? { [`overflow-${d}`]: v } : void 0]
495
+ ];
496
+
497
+ const positions = [
498
+ [/^(?:position-|pos-)?(relative|absolute|fixed|sticky)$/, ([, v]) => ({ position: v }), {
499
+ autocomplete: [
500
+ "(position|pos)-<position>",
501
+ "(position|pos)-<globalKeyword>",
502
+ "<position>"
503
+ ]
504
+ }],
505
+ [/^(?:position-|pos-)([-\w]+)$/, ([, v]) => globalKeywords.includes(v) ? { position: v } : void 0],
506
+ [/^(?:position-|pos-)?(static)$/, ([, v]) => ({ position: v })]
507
+ ];
508
+ const justifies = [
509
+ // contents
510
+ ["justify-start", { "justify-content": "flex-start" }],
511
+ ["justify-end", { "justify-content": "flex-end" }],
512
+ ["justify-center", { "justify-content": "center" }],
513
+ ["justify-between", { "justify-content": "space-between" }],
514
+ ["justify-around", { "justify-content": "space-around" }],
515
+ ["justify-evenly", { "justify-content": "space-evenly" }],
516
+ ["justify-stretch", { "justify-content": "stretch" }],
517
+ ...makeGlobalStaticRules("justify", "justify-content"),
518
+ // items
519
+ ["justify-items-start", { "justify-items": "start" }],
520
+ ["justify-items-end", { "justify-items": "end" }],
521
+ ["justify-items-center", { "justify-items": "center" }],
522
+ ["justify-items-stretch", { "justify-items": "stretch" }],
523
+ ...makeGlobalStaticRules("justify-items"),
524
+ // selfs
525
+ ["justify-self-auto", { "justify-self": "auto" }],
526
+ ["justify-self-start", { "justify-self": "start" }],
527
+ ["justify-self-end", { "justify-self": "end" }],
528
+ ["justify-self-center", { "justify-self": "center" }],
529
+ ["justify-self-stretch", { "justify-self": "stretch" }],
530
+ ...makeGlobalStaticRules("justify-self")
531
+ ];
532
+ const orders = [
533
+ [/^order-(.+)$/, ([, v]) => ({ order: h.bracket.cssvar.number(v) })],
534
+ ["order-first", { order: "-9999" }],
535
+ ["order-last", { order: "9999" }],
536
+ ["order-none", { order: "0" }]
537
+ ];
538
+ const alignments = [
539
+ // contents
540
+ ["content-center", { "align-content": "center" }],
541
+ ["content-start", { "align-content": "flex-start" }],
542
+ ["content-end", { "align-content": "flex-end" }],
543
+ ["content-between", { "align-content": "space-between" }],
544
+ ["content-around", { "align-content": "space-around" }],
545
+ ["content-evenly", { "align-content": "space-evenly" }],
546
+ ...makeGlobalStaticRules("content", "align-content"),
547
+ // items
548
+ ["items-start", { "align-items": "flex-start" }],
549
+ ["items-end", { "align-items": "flex-end" }],
550
+ ["items-center", { "align-items": "center" }],
551
+ ["items-baseline", { "align-items": "baseline" }],
552
+ ["items-stretch", { "align-items": "stretch" }],
553
+ ...makeGlobalStaticRules("items", "align-items"),
554
+ // selfs
555
+ ["self-auto", { "align-self": "auto" }],
556
+ ["self-start", { "align-self": "flex-start" }],
557
+ ["self-end", { "align-self": "flex-end" }],
558
+ ["self-center", { "align-self": "center" }],
559
+ ["self-stretch", { "align-self": "stretch" }],
560
+ ["self-baseline", { "align-self": "baseline" }],
561
+ ...makeGlobalStaticRules("self", "align-self")
562
+ ];
563
+ const placements = [
564
+ // contents
565
+ ["place-content-center", { "place-content": "center" }],
566
+ ["place-content-start", { "place-content": "start" }],
567
+ ["place-content-end", { "place-content": "end" }],
568
+ ["place-content-between", { "place-content": "space-between" }],
569
+ ["place-content-around", { "place-content": "space-around" }],
570
+ ["place-content-evenly", { "place-content": "space-evenly" }],
571
+ ["place-content-stretch", { "place-content": "stretch" }],
572
+ ...makeGlobalStaticRules("place-content"),
573
+ // items
574
+ ["place-items-start", { "place-items": "start" }],
575
+ ["place-items-end", { "place-items": "end" }],
576
+ ["place-items-center", { "place-items": "center" }],
577
+ ["place-items-stretch", { "place-items": "stretch" }],
578
+ ...makeGlobalStaticRules("place-items"),
579
+ // selfs
580
+ ["place-self-auto", { "place-self": "auto" }],
581
+ ["place-self-start", { "place-self": "start" }],
582
+ ["place-self-end", { "place-self": "end" }],
583
+ ["place-self-center", { "place-self": "center" }],
584
+ ["place-self-stretch", { "place-self": "stretch" }],
585
+ ...makeGlobalStaticRules("place-self")
586
+ ];
587
+ const flexGridJustifiesAlignments = [...justifies, ...alignments].flatMap(([k, v]) => [
588
+ [`flex-${k}`, v],
589
+ [`grid-${k}`, v]
590
+ ]);
591
+ function handleInsetValue(v, { theme }) {
592
+ return theme.spacing?.[v] ?? h.bracket.cssvar.global.auto.fraction.rem(v);
593
+ }
594
+ function handleInsetValues([, d, v], ctx) {
595
+ const r = handleInsetValue(v, ctx);
596
+ if (r != null && d in insetMap)
597
+ return insetMap[d].map((i) => [i.slice(1), r]);
598
+ }
599
+ const insets = [
600
+ [
601
+ /^(?:position-|pos-)?inset-(.+)$/,
602
+ ([, v], ctx) => ({ inset: handleInsetValue(v, ctx) }),
603
+ {
604
+ autocomplete: [
605
+ "(position|pos)-inset-<directions>-$spacing",
606
+ "(position|pos)-inset-(block|inline)-$spacing",
607
+ "(position|pos)-inset-(bs|be|is|ie)-$spacing",
608
+ "(position|pos)-(top|left|right|bottom)-$spacing"
609
+ ]
610
+ }
611
+ ],
612
+ [/^(?:position-|pos-)?(start|end)-(.+)$/, handleInsetValues],
613
+ [/^(?:position-|pos-)?inset-([xy])-(.+)$/, handleInsetValues],
614
+ [/^(?:position-|pos-)?inset-([rltbse])-(.+)$/, handleInsetValues],
615
+ [/^(?:position-|pos-)?inset-(block|inline)-(.+)$/, handleInsetValues],
616
+ [/^(?:position-|pos-)?inset-([bi][se])-(.+)$/, handleInsetValues],
617
+ [/^(?:position-|pos-)?(top|left|right|bottom)-(.+)$/, ([, d, v], ctx) => ({ [d]: handleInsetValue(v, ctx) })]
618
+ ];
619
+ const floats = [
620
+ // floats
621
+ ["float-left", { float: "left" }],
622
+ ["float-right", { float: "right" }],
623
+ ["float-none", { float: "none" }],
624
+ ...makeGlobalStaticRules("float"),
625
+ // clears
626
+ ["clear-left", { clear: "left" }],
627
+ ["clear-right", { clear: "right" }],
628
+ ["clear-both", { clear: "both" }],
629
+ ["clear-none", { clear: "none" }],
630
+ ...makeGlobalStaticRules("clear")
631
+ ];
632
+ const zIndexes = [
633
+ [/^(?:position-|pos-)?z([\d.]+)$/, ([, v]) => ({ "z-index": h.number(v) })],
634
+ [/^(?:position-|pos-)?z-(.+)$/, ([, v]) => ({ "z-index": h.bracket.cssvar.global.auto.number(v) }), { autocomplete: "z-<num>" }]
635
+ ];
636
+ const boxSizing = [
637
+ ["box-border", { "box-sizing": "border-box" }],
638
+ ["box-content", { "box-sizing": "content-box" }],
639
+ ...makeGlobalStaticRules("box", "box-sizing")
640
+ ];
641
+
642
+ const sizeMapping = {
643
+ h: "height",
644
+ w: "width",
645
+ inline: "inline-size",
646
+ block: "block-size"
647
+ };
648
+ function getPropName(minmax, hw) {
649
+ return `${minmax || ""}${sizeMapping[hw]}`;
650
+ }
651
+ function getSizeValue(minmax, hw, theme, prop) {
652
+ const str = getPropName(minmax, hw).replace(/-(\w)/g, (_, p) => p.toUpperCase());
653
+ const v = theme[str]?.[prop];
654
+ if (v != null)
655
+ return v;
656
+ switch (prop) {
657
+ case "fit":
658
+ case "max":
659
+ case "min":
660
+ return `${prop}-content`;
661
+ }
662
+ return h.bracket.cssvar.global.auto.fraction.rem(prop);
663
+ }
664
+ const sizes = [
665
+ [/^(?:size-)?(min-|max-)?([wh])-?(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
666
+ [/^(?:size-)?(min-|max-)?(block|inline)-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) }), {
667
+ autocomplete: [
668
+ "(w|h)-$width|height|maxWidth|maxHeight|minWidth|minHeight|inlineSize|blockSize|maxInlineSize|maxBlockSize|minInlineSize|minBlockSize",
669
+ "(block|inline)-$width|height|maxWidth|maxHeight|minWidth|minHeight|inlineSize|blockSize|maxInlineSize|maxBlockSize|minInlineSize|minBlockSize",
670
+ "(max|min)-(w|h|block|inline)",
671
+ "(max|min)-(w|h|block|inline)-$width|height|maxWidth|maxHeight|minWidth|minHeight|inlineSize|blockSize|maxInlineSize|maxBlockSize|minInlineSize|minBlockSize",
672
+ "(w|h)-full",
673
+ "(max|min)-(w|h)-full"
674
+ ]
675
+ }],
676
+ [/^(?:size-)?(min-|max-)?(h)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]: resolveVerticalBreakpoints(context)?.[s] })],
677
+ [/^(?:size-)?(min-|max-)?(w)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]: resolveBreakpoints(context)?.[s] }), {
678
+ autocomplete: [
679
+ "(w|h)-screen",
680
+ "(min|max)-(w|h)-screen",
681
+ "h-screen-$verticalBreakpoints",
682
+ "(min|max)-h-screen-$verticalBreakpoints",
683
+ "w-screen-$breakpoints",
684
+ "(min|max)-w-screen-$breakpoints"
685
+ ]
686
+ }]
687
+ ];
688
+ function getAspectRatio(prop) {
689
+ if (/^\d+\/\d+$/.test(prop))
690
+ return prop;
691
+ switch (prop) {
692
+ case "square":
693
+ return "1/1";
694
+ case "video":
695
+ return "16/9";
696
+ }
697
+ return h.bracket.cssvar.global.auto.number(prop);
698
+ }
699
+ const aspectRatio = [
700
+ [/^(?:size-)?aspect-(?:ratio-)?(.+)$/, ([, d]) => ({ "aspect-ratio": getAspectRatio(d) }), { autocomplete: ["aspect-(square|video|ratio)", "aspect-ratio-(square|video)"] }]
701
+ ];
702
+
703
+ const paddings = [
704
+ [/^pa?()-?(-?.+)$/, directionSize("padding"), { autocomplete: ["(m|p)<num>", "(m|p)-<num>"] }],
705
+ [/^p-?xy()()$/, directionSize("padding"), { autocomplete: "(m|p)-(xy)" }],
706
+ [/^p-?([xy])(?:-?(-?.+))?$/, directionSize("padding")],
707
+ [/^p-?([rltbse])(?:-?(-?.+))?$/, directionSize("padding"), { autocomplete: "(m|p)<directions>-<num>" }],
708
+ [/^p-(block|inline)(?:-(-?.+))?$/, directionSize("padding"), { autocomplete: "(m|p)-(block|inline)-<num>" }],
709
+ [/^p-?([bi][se])(?:-?(-?.+))?$/, directionSize("padding"), { autocomplete: "(m|p)-(bs|be|is|ie)-<num>" }]
710
+ ];
711
+ const margins = [
712
+ [/^ma?()-?(-?.+)$/, directionSize("margin")],
713
+ [/^m-?xy()()$/, directionSize("margin")],
714
+ [/^m-?([xy])(?:-?(-?.+))?$/, directionSize("margin")],
715
+ [/^m-?([rltbse])(?:-?(-?.+))?$/, directionSize("margin")],
716
+ [/^m-(block|inline)(?:-(-?.+))?$/, directionSize("margin")],
717
+ [/^m-?([bi][se])(?:-?(-?.+))?$/, directionSize("margin")]
718
+ ];
719
+
720
+ const variablesAbbrMap = {
721
+ backface: "backface-visibility",
722
+ break: "word-break",
723
+ case: "text-transform",
724
+ content: "align-content",
725
+ fw: "font-weight",
726
+ items: "align-items",
727
+ justify: "justify-content",
728
+ select: "user-select",
729
+ self: "align-self",
730
+ vertical: "vertical-align",
731
+ visible: "visibility",
732
+ whitespace: "white-space",
733
+ ws: "white-space"
734
+ };
735
+ const cssVariables = [
736
+ [/^(.+?)-(\$.+)$/, ([, name, varname]) => {
737
+ const prop = variablesAbbrMap[name];
738
+ if (prop)
739
+ return { [prop]: h.cssvar(varname) };
740
+ }]
741
+ ];
742
+ const cssProperty = [
743
+ [/^\[(.*)\]$/, ([_, body]) => {
744
+ if (!body.includes(":"))
745
+ return;
746
+ const [prop, ...rest] = body.split(":");
747
+ const value = rest.join(":");
748
+ if (!isURI(body) && prop.match(/^[a-z-]+$/) && isValidCSSBody(value)) {
749
+ const parsed = h.bracket(`[${value}]`);
750
+ if (parsed)
751
+ return { [prop]: parsed };
752
+ }
753
+ }]
754
+ ];
755
+ function isValidCSSBody(body) {
756
+ let i = 0;
757
+ function findUntil(c) {
758
+ while (i < body.length) {
759
+ i += 1;
760
+ const char = body[i];
761
+ if (char === c)
762
+ return true;
763
+ }
764
+ return false;
765
+ }
766
+ for (i = 0; i < body.length; i++) {
767
+ const c = body[i];
768
+ if ("\"`'".includes(c)) {
769
+ if (!findUntil(c))
770
+ return false;
771
+ } else if (c === "(") {
772
+ if (!findUntil(")"))
773
+ return false;
774
+ } else if ("[]{}:".includes(c)) {
775
+ return false;
776
+ }
777
+ }
778
+ return true;
779
+ }
780
+ function isURI(declaration) {
781
+ if (!declaration.includes("://"))
782
+ return false;
783
+ try {
784
+ return new URL(declaration).host !== "";
785
+ } catch (err) {
786
+ return false;
787
+ }
788
+ }
789
+
790
+ const questionMark = [
791
+ [
792
+ /^(where|\?)$/,
793
+ (_, { constructCSS, generator }) => {
794
+ if (generator.userConfig.envMode === "dev")
795
+ return `@keyframes __un_qm{0%{box-shadow:inset 4px 4px #ff1e90, inset -4px -4px #ff1e90}100%{box-shadow:inset 8px 8px #3399ff, inset -8px -8px #3399ff}}
796
+ ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
797
+ }
798
+ ]
799
+ ];
800
+
801
+ const svgUtilities = [
802
+ // fills
803
+ [/^fill-(.+)$/, colorResolver("fill", "fill"), { autocomplete: "fill-$colors" }],
804
+ [/^fill-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-fill-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "fill-(op|opacity)-<percent>" }],
805
+ ["fill-none", { fill: "none" }],
806
+ // stroke size
807
+ [/^stroke-(?:width-|size-)?(.+)$/, ([, s], { theme }) => ({ "stroke-width": theme.lineWidth?.[s] ?? h.bracket.cssvar.fraction.px.number(s) }), { autocomplete: ["stroke-width-$lineWidth", "stroke-size-$lineWidth"] }],
808
+ // stroke dash
809
+ [/^stroke-dash-(.+)$/, ([, s]) => ({ "stroke-dasharray": h.bracket.cssvar.number(s) }), { autocomplete: "stroke-dash-<num>" }],
810
+ [/^stroke-offset-(.+)$/, ([, s], { theme }) => ({ "stroke-dashoffset": theme.lineWidth?.[s] ?? h.bracket.cssvar.px.numberWithUnit(s) }), { autocomplete: "stroke-offset-$lineWidth" }],
811
+ // stroke colors
812
+ [/^stroke-(.+)$/, colorResolver("stroke", "stroke"), { autocomplete: "stroke-$colors" }],
813
+ [/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "stroke-(op|opacity)-<percent>" }],
814
+ // line cap
815
+ ["stroke-cap-square", { "stroke-linecap": "square" }],
816
+ ["stroke-cap-round", { "stroke-linecap": "round" }],
817
+ ["stroke-cap-auto", { "stroke-linecap": "butt" }],
818
+ // line join
819
+ ["stroke-join-arcs", { "stroke-linejoin": "arcs" }],
820
+ ["stroke-join-bevel", { "stroke-linejoin": "bevel" }],
821
+ ["stroke-join-clip", { "stroke-linejoin": "miter-clip" }],
822
+ ["stroke-join-round", { "stroke-linejoin": "round" }],
823
+ ["stroke-join-auto", { "stroke-linejoin": "miter" }],
824
+ // none
825
+ ["stroke-none", { stroke: "none" }]
826
+ ];
827
+
828
+ const rules = [
829
+ cssVariables,
830
+ cssProperty,
831
+ paddings,
832
+ margins,
833
+ displays,
834
+ opacity,
835
+ bgColors,
836
+ colorScheme,
837
+ svgUtilities,
838
+ borders,
839
+ contentVisibility,
840
+ contents,
841
+ fonts,
842
+ tabSizes,
843
+ textIndents,
844
+ textOverflows,
845
+ textDecorations,
846
+ textStrokes,
847
+ textShadows,
848
+ textTransforms,
849
+ textAligns,
850
+ textColors,
851
+ fontStyles,
852
+ fontSmoothings,
853
+ boxShadows,
854
+ rings,
855
+ flex,
856
+ grids,
857
+ gaps,
858
+ positions,
859
+ sizes,
860
+ aspectRatio,
861
+ cursors,
862
+ appearances,
863
+ pointerEvents,
864
+ resizes,
865
+ verticalAligns,
866
+ userSelects,
867
+ whitespaces,
868
+ breaks,
869
+ overflows,
870
+ outline,
871
+ appearance,
872
+ orders,
873
+ justifies,
874
+ alignments,
875
+ placements,
876
+ flexGridJustifiesAlignments,
877
+ insets,
878
+ floats,
879
+ zIndexes,
880
+ boxSizing,
881
+ transitions,
882
+ transforms,
883
+ willChange,
884
+ containerParent,
885
+ contains,
886
+ textWraps,
887
+ // should be the last
888
+ questionMark
889
+ ].flat(1);
890
+
891
+ export { alignments, appearance, appearances, aspectRatio, bgColors, borderStyles, borders, boxShadows, boxSizing, breaks, colorScheme, containerParent, contains, contentVisibility, contents, cssProperty, cssVariables, cursors, displays, flex, flexGridJustifiesAlignments, floats, fontSmoothings, fontStyles, fonts, gaps, grids, handlerBorderStyle, insets, justifies, margins, opacity, orders, outline, overflows, paddings, placements, pointerEvents, positions, questionMark, resizes, rings, rules, sizes, svgUtilities, tabSizes, textAligns, textColors, textDecorations, textIndents, textOverflows, textShadows, textStrokes, textTransforms, textWraps, transforms, transitions, userSelects, verticalAligns, whitespaces, willChange, zIndexes };