@unocss/preset-mini 0.57.7 → 0.58.1

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