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