@unocss/preset-mini 0.35.4 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,9 @@
1
1
  'use strict';
2
2
 
3
+ const index = require('./index.cjs');
3
4
  const utilities = require('./utilities.cjs');
4
5
  const core = require('@unocss/core');
6
+ const transform = require('./transform.cjs');
5
7
 
6
8
  const verticalAlignAlias = {
7
9
  "mid": "middle",
@@ -19,14 +21,14 @@ const verticalAlignAlias = {
19
21
  const verticalAligns = [
20
22
  [/^(?:vertical|align|v)-(.+)$/, ([, v]) => ({ "vertical-align": verticalAlignAlias[v] }), { autocomplete: `(vertical|align|v)-(${Object.keys(verticalAlignAlias).join("|")})` }]
21
23
  ];
22
- const textAligns = ["center", "left", "right", "justify", "start", "end", ...utilities.globalKeywords].map((v) => [`text-${v}`, { "text-align": v }]);
24
+ const textAligns = ["center", "left", "right", "justify", "start", "end", ...index.globalKeywords].map((v) => [`text-${v}`, { "text-align": v }]);
23
25
 
24
26
  const outline = [
25
- [/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) }), { autocomplete: "outline-(width|size)-<num>" }],
27
+ [/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ?? index.handler.bracket.cssvar.px(d) }), { autocomplete: "outline-(width|size)-<num>" }],
26
28
  [/^outline-(?:color-)?(.+)$/, utilities.colorResolver("outline-color", "outline-color"), { autocomplete: "outline-$colors" }],
27
- [/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) }), { autocomplete: "outline-(offset)-<num>" }],
29
+ [/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ?? index.handler.bracket.cssvar.px(d) }), { autocomplete: "outline-(offset)-<num>" }],
28
30
  ["outline", { "outline-style": "solid" }],
29
- ...["auto", "dashed", "dotted", "double", "hidden", "solid", "groove", "ridge", "inset", "outset", ...utilities.globalKeywords].map((v) => [`outline-${v}`, { "outline-style": v }]),
31
+ ...["auto", "dashed", "dotted", "double", "hidden", "solid", "groove", "ridge", "inset", "outset", ...index.globalKeywords].map((v) => [`outline-${v}`, { "outline-style": v }]),
30
32
  ["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }]
31
33
  ];
32
34
  const appearance = [
@@ -36,7 +38,7 @@ const appearance = [
36
38
  }]
37
39
  ];
38
40
  const willChangeProperty = (prop) => {
39
- return utilities.handler.properties.auto.global(prop) ?? {
41
+ return index.handler.properties.auto.global(prop) ?? {
40
42
  contents: "contents",
41
43
  scroll: "scroll-position"
42
44
  }[prop];
@@ -45,7 +47,7 @@ const willChange = [
45
47
  [/^will-change-(.+)/, ([, p]) => ({ "will-change": willChangeProperty(p) })]
46
48
  ];
47
49
 
48
- const borderStyles = ["solid", "dashed", "dotted", "double", "hidden", "none", "groove", "ridge", "inset", "outset", ...utilities.globalKeywords];
50
+ const borderStyles = ["solid", "dashed", "dotted", "double", "hidden", "none", "groove", "ridge", "inset", "outset", ...index.globalKeywords];
49
51
  const borders = [
50
52
  [/^(?:border|b)()(?:-(.+))?$/, handlerBorder, { autocomplete: "(border|b)-<directions>" }],
51
53
  [/^(?:border|b)-([xy])(?:-(.+))?$/, handlerBorder],
@@ -118,40 +120,40 @@ function handlerBorder(m, ctx) {
118
120
  }
119
121
  }
120
122
  function handlerBorderSize([, a = "", b], { theme }) {
121
- const v = theme.lineWidth?.[b || "DEFAULT"] ?? utilities.handler.bracket.cssvar.px(b || "1");
122
- if (a in utilities.directionMap && v != null)
123
- return utilities.directionMap[a].map((i) => [`border${i}-width`, v]);
123
+ const v = theme.lineWidth?.[b || "DEFAULT"] ?? index.handler.bracket.cssvar.px(b || "1");
124
+ if (a in index.directionMap && v != null)
125
+ return index.directionMap[a].map((i) => [`border${i}-width`, v]);
124
126
  }
125
127
  function handlerBorderColor([, a = "", c], { theme }) {
126
- if (a in utilities.directionMap && utilities.hasParseableColor(c, theme)) {
127
- return Object.assign({}, ...utilities.directionMap[a].map((i) => borderColorResolver(i)(["", c], theme)));
128
+ if (a in index.directionMap && utilities.hasParseableColor(c, theme)) {
129
+ return Object.assign({}, ...index.directionMap[a].map((i) => borderColorResolver(i)(["", c], theme)));
128
130
  }
129
131
  }
130
132
  function handlerBorderOpacity([, a = "", opacity]) {
131
- const v = utilities.handler.bracket.percent(opacity);
132
- if (a in utilities.directionMap && v != null)
133
- return utilities.directionMap[a].map((i) => [`--un-border${i}-opacity`, v]);
133
+ const v = index.handler.bracket.percent(opacity);
134
+ if (a in index.directionMap && v != null)
135
+ return index.directionMap[a].map((i) => [`--un-border${i}-opacity`, v]);
134
136
  }
135
137
  function handlerRounded([, a = "", s], { theme }) {
136
- const v = theme.borderRadius?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.fraction.rem(s || "1");
137
- if (a in utilities.cornerMap && v != null)
138
- return utilities.cornerMap[a].map((i) => [`border${i}-radius`, v]);
138
+ const v = theme.borderRadius?.[s || "DEFAULT"] || index.handler.bracket.cssvar.fraction.rem(s || "1");
139
+ if (a in index.cornerMap && v != null)
140
+ return index.cornerMap[a].map((i) => [`border${i}-radius`, v]);
139
141
  }
140
142
  function handlerBorderStyle([, a = "", s]) {
141
- if (borderStyles.includes(s) && a in utilities.directionMap)
142
- return utilities.directionMap[a].map((i) => [`border${i}-style`, s]);
143
+ if (borderStyles.includes(s) && a in index.directionMap)
144
+ return index.directionMap[a].map((i) => [`border${i}-style`, s]);
143
145
  }
144
146
 
145
147
  const opacity = [
146
- [/^op(?:acity)?-?(.+)$/, ([, d]) => ({ opacity: utilities.handler.bracket.percent.cssvar(d) })]
148
+ [/^op(?:acity)?-?(.+)$/, ([, d]) => ({ opacity: index.handler.bracket.percent.cssvar(d) })]
147
149
  ];
148
150
  const textColors = [
149
151
  [/^(?:text|color|c)-(.+)$/, utilities.colorResolver("color", "text"), { autocomplete: "(text|color|c)-$colors" }],
150
- [/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-text-opacity": utilities.handler.bracket.percent(opacity2) }), { autocomplete: "(text|color|c)-(op|opacity)-<percent>" }]
152
+ [/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-text-opacity": index.handler.bracket.percent(opacity2) }), { autocomplete: "(text|color|c)-(op|opacity)-<percent>" }]
151
153
  ];
152
154
  const bgColors = [
153
155
  [/^bg-(.+)$/, utilities.colorResolver("background-color", "bg"), { autocomplete: "bg-$colors" }],
154
- [/^bg-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-bg-opacity": utilities.handler.bracket.percent(opacity2) }), { autocomplete: "bg-(op|opacity)-<percent>" }]
156
+ [/^bg-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-bg-opacity": index.handler.bracket.percent(opacity2) }), { autocomplete: "bg-(op|opacity)-<percent>" }]
155
157
  ];
156
158
 
157
159
  const transitionPropertyGroup = {
@@ -163,13 +165,13 @@ const transitionPropertyGroup = {
163
165
  transform: "transform"
164
166
  };
165
167
  const transitionProperty = (prop) => {
166
- return utilities.handler.properties(prop) ?? transitionPropertyGroup[prop];
168
+ return index.handler.properties(prop) ?? transitionPropertyGroup[prop];
167
169
  };
168
170
  const transitions = [
169
171
  [/^transition(?:-([a-z-]+(?:,[a-z-]+)*))?(?:-(\d+))?$/, ([, prop, d], { theme }) => {
170
172
  const p = prop != null ? transitionProperty(prop) : [transitionPropertyGroup.colors, "opacity", "box-shadow", "transform", "filter", "backdrop-filter"].join(",");
171
173
  if (p) {
172
- const duration = theme.duration?.[d || "DEFAULT"] ?? utilities.handler.time(d || "150");
174
+ const duration = theme.duration?.[d || "DEFAULT"] ?? index.handler.time(d || "150");
173
175
  return {
174
176
  "transition-property": p,
175
177
  "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)",
@@ -179,23 +181,23 @@ const transitions = [
179
181
  }, { autocomplete: `transition-(${Object.keys(transitionPropertyGroup).join("|")})` }],
180
182
  [
181
183
  /^(?:transition-)?duration-(.+)$/,
182
- ([, d], { theme }) => ({ "transition-duration": theme.duration?.[d || "DEFAULT"] ?? utilities.handler.bracket.cssvar.time(d) }),
184
+ ([, d], { theme }) => ({ "transition-duration": theme.duration?.[d || "DEFAULT"] ?? index.handler.bracket.cssvar.time(d) }),
183
185
  { autocomplete: ["transition-duration-$duration", "duration-$duration"] }
184
186
  ],
185
187
  [
186
188
  /^(?:transition-)?delay-(.+)$/,
187
- ([, d], { theme }) => ({ "transition-delay": theme.duration?.[d || "DEFAULT"] ?? utilities.handler.bracket.cssvar.time(d) }),
189
+ ([, d], { theme }) => ({ "transition-delay": theme.duration?.[d || "DEFAULT"] ?? index.handler.bracket.cssvar.time(d) }),
188
190
  { autocomplete: ["transition-delay-$duration", "delay-$duration"] }
189
191
  ],
190
192
  [
191
193
  /^(?:transition-)?ease(?:-(.+))?$/,
192
- ([, d], { theme }) => ({ "transition-timing-function": theme.easing?.[d || "DEFAULT"] ?? utilities.handler.bracket.cssvar(d) }),
194
+ ([, d], { theme }) => ({ "transition-timing-function": theme.easing?.[d || "DEFAULT"] ?? index.handler.bracket.cssvar(d) }),
193
195
  { autocomplete: ["transition-ease-(linear|in|out|in-out|DEFAULT)", "ease-(linear|in|out|in-out|DEFAULT)"] }
194
196
  ],
195
197
  [
196
198
  /^(?:transition-)?property-(.+)$/,
197
- ([, v]) => ({ "transition-property": utilities.handler.global(v) || transitionProperty(v) }),
198
- { autocomplete: [`transition-property-(${[...utilities.globalKeywords, ...Object.keys(transitionPropertyGroup)].join("|")})`] }
199
+ ([, v]) => ({ "transition-property": index.handler.global(v) || transitionProperty(v) }),
200
+ { autocomplete: [`transition-property-(${[...index.globalKeywords, ...Object.keys(transitionPropertyGroup)].join("|")})`] }
199
201
  ],
200
202
  ["transition-none", { transition: "none" }]
201
203
  ];
@@ -204,7 +206,7 @@ const flex = [
204
206
  ["flex", { display: "flex" }],
205
207
  ["inline-flex", { display: "inline-flex" }],
206
208
  ["flex-inline", { display: "inline-flex" }],
207
- [/^flex-(.*)$/, ([, d]) => ({ flex: utilities.handler.bracket(d) != null ? utilities.handler.bracket(d).split(" ").map((e) => utilities.handler.cssvar.fraction(e) ?? e).join(" ") : utilities.handler.cssvar.fraction(d) })],
209
+ [/^flex-(.*)$/, ([, d]) => ({ flex: index.handler.bracket(d) != null ? index.handler.bracket(d).split(" ").map((e) => index.handler.cssvar.fraction(e) ?? e).join(" ") : index.handler.cssvar.fraction(d) })],
208
210
  ["flex-1", { flex: "1 1 0%" }],
209
211
  ["flex-auto", { flex: "1 1 auto" }],
210
212
  ["flex-initial", { flex: "0 1 auto" }],
@@ -213,7 +215,7 @@ const flex = [
213
215
  [/^(?:flex-)?shrink-0$/, () => ({ "flex-shrink": 0 })],
214
216
  [/^(?:flex-)?grow$/, () => ({ "flex-grow": 1 })],
215
217
  [/^(?:flex-)?grow-0$/, () => ({ "flex-grow": 0 })],
216
- [/^(?:flex-)?basis-(.+)$/, ([, d], { theme }) => ({ "flex-basis": theme.spacing?.[d] ?? utilities.handler.bracket.cssvar.auto.fraction.rem(d) })],
218
+ [/^(?:flex-)?basis-(.+)$/, ([, d], { theme }) => ({ "flex-basis": theme.spacing?.[d] ?? index.handler.bracket.cssvar.auto.fraction.rem(d) })],
217
219
  ["flex-row", { "flex-direction": "row" }],
218
220
  ["flex-row-reverse", { "flex-direction": "row-reverse" }],
219
221
  ["flex-col", { "flex-direction": "column" }],
@@ -237,7 +239,7 @@ const weightMap = {
237
239
  const fonts = [
238
240
  [
239
241
  /^font-(.+)$/,
240
- ([, d], { theme }) => ({ "font-family": theme.fontFamily?.[d] || utilities.handler.bracket.cssvar.global(d) }),
242
+ ([, d], { theme }) => ({ "font-family": theme.fontFamily?.[d] || index.handler.bracket.cssvar.global(d) }),
241
243
  { autocomplete: "font-$fontFamily" }
242
244
  ],
243
245
  [
@@ -251,24 +253,24 @@ const fonts = [
251
253
  "line-height": height
252
254
  };
253
255
  }
254
- return { "font-size": utilities.handler.bracketOfLength.rem(s) };
256
+ return { "font-size": index.handler.bracketOfLength.rem(s) };
255
257
  },
256
258
  { autocomplete: "text-$fontSize" }
257
259
  ],
258
260
  [/^text-size-(.+)$/, ([, s], { theme }) => {
259
261
  const themed = core.toArray(theme.fontSize?.[s]);
260
- const size = themed?.[0] ?? utilities.handler.bracket.cssvar.rem(s);
262
+ const size = themed?.[0] ?? index.handler.bracket.cssvar.rem(s);
261
263
  if (size != null)
262
264
  return { "font-size": size };
263
265
  }, { autocomplete: "text-size-$fontSize" }],
264
266
  [
265
267
  /^(?:font|fw)-?([^-]+)$/,
266
- ([, s]) => ({ "font-weight": weightMap[s] || utilities.handler.global.number(s) }),
268
+ ([, s]) => ({ "font-weight": weightMap[s] || index.handler.global.number(s) }),
267
269
  { autocomplete: `(font|fw)-(100|200|300|400|500|600|700|800|900|${Object.keys(weightMap).join("|")})` }
268
270
  ],
269
271
  [
270
272
  /^(?:font-)?(?:leading|lh)-(.+)$/,
271
- ([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] || utilities.handler.bracket.cssvar.global.rem(s) }),
273
+ ([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] || index.handler.bracket.cssvar.global.rem(s) }),
272
274
  { autocomplete: "(leading|lh)-$lineHeight" }
273
275
  ],
274
276
  [
@@ -278,18 +280,18 @@ const fonts = [
278
280
  ],
279
281
  [
280
282
  /^(?:font-)?tracking-(.+)$/,
281
- ([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || utilities.handler.bracket.cssvar.global.rem(s) }),
283
+ ([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || index.handler.bracket.cssvar.global.rem(s) }),
282
284
  { autocomplete: "tracking-$letterSpacing" }
283
285
  ],
284
286
  [
285
287
  /^(?:font-)?word-spacing-(.+)$/,
286
- ([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] || utilities.handler.bracket.cssvar.global.rem(s) }),
288
+ ([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] || index.handler.bracket.cssvar.global.rem(s) }),
287
289
  { autocomplete: "word-spacing-$wordSpacing" }
288
290
  ]
289
291
  ];
290
292
  const tabSizes = [
291
293
  [/^tab(?:-(.+))?$/, ([, s]) => {
292
- const v = utilities.handler.bracket.cssvar.global.number(s || "4");
294
+ const v = index.handler.bracket.cssvar.global.number(s || "4");
293
295
  if (v != null) {
294
296
  return {
295
297
  "-moz-tab-size": v,
@@ -300,12 +302,12 @@ const tabSizes = [
300
302
  }]
301
303
  ];
302
304
  const textIndents = [
303
- [/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.global.fraction.rem(s) }), { autocomplete: "indent-$textIndent" }]
305
+ [/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] || index.handler.bracket.cssvar.global.fraction.rem(s) }), { autocomplete: "indent-$textIndent" }]
304
306
  ];
305
307
  const textStrokes = [
306
- [/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => ({ "-webkit-text-stroke-width": theme.textStrokeWidth?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.px(s) }), { autocomplete: "text-stroke-$textStrokeWidth" }],
308
+ [/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => ({ "-webkit-text-stroke-width": theme.textStrokeWidth?.[s || "DEFAULT"] || index.handler.bracket.cssvar.px(s) }), { autocomplete: "text-stroke-$textStrokeWidth" }],
307
309
  [/^text-stroke-(.+)$/, utilities.colorResolver("-webkit-text-stroke-color", "text-stroke"), { autocomplete: "text-stroke-$colors" }],
308
- [/^text-stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-stroke-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "text-stroke-(op|opacity)-<percent>" }]
310
+ [/^text-stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-stroke-opacity": index.handler.bracket.percent(opacity) }), { autocomplete: "text-stroke-(op|opacity)-<percent>" }]
309
311
  ];
310
312
  const textShadows = [
311
313
  [/^text-shadow(?:-(.+))?$/, ([, s], { theme }) => {
@@ -316,10 +318,10 @@ const textShadows = [
316
318
  "text-shadow": "var(--un-text-shadow)"
317
319
  };
318
320
  }
319
- return { "text-shadow": utilities.handler.bracket.cssvar(s) };
321
+ return { "text-shadow": index.handler.bracket.cssvar(s) };
320
322
  }, { autocomplete: "text-shadow-$textShadow" }],
321
323
  [/^text-shadow-color-(.+)$/, utilities.colorResolver("--un-text-shadow-color", "text-shadow"), { autocomplete: "text-shadow-color-$colors" }],
322
- [/^text-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-shadow-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "text-shadow-color-(op|opacity)-<percent>" }]
324
+ [/^text-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-shadow-opacity": index.handler.bracket.percent(opacity) }), { autocomplete: "text-shadow-color-(op|opacity)-<percent>" }]
323
325
  ];
324
326
 
325
327
  const directions = {
@@ -328,7 +330,7 @@ const directions = {
328
330
  "y": "row-"
329
331
  };
330
332
  const handleGap = ([, d = "", s], { theme }) => {
331
- const v = theme.spacing?.[s] ?? utilities.handler.bracket.cssvar.rem(s);
333
+ const v = theme.spacing?.[s] ?? index.handler.bracket.cssvar.rem(s);
332
334
  if (v != null) {
333
335
  return {
334
336
  [`grid-${directions[d]}gap`]: v,
@@ -355,28 +357,28 @@ const autoDirection = (c, theme, prop) => {
355
357
  case "fr":
356
358
  return "minmax(0,1fr)";
357
359
  }
358
- return utilities.handler.bracket.cssvar.auto.rem(prop);
360
+ return index.handler.bracket.cssvar.auto.rem(prop);
359
361
  };
360
362
  const grids = [
361
363
  ["grid", { display: "grid" }],
362
364
  ["inline-grid", { display: "inline-grid" }],
363
365
  [/^(?:grid-)?(row|col)-(.+)$/, ([, c, v], { theme }) => ({
364
- [`grid-${rowCol(c)}`]: theme[`grid${rowColTheme(c)}`]?.[v] ?? utilities.handler.bracket.cssvar.auto(v)
366
+ [`grid-${rowCol(c)}`]: theme[`grid${rowColTheme(c)}`]?.[v] ?? index.handler.bracket.cssvar.auto(v)
365
367
  })],
366
368
  [/^(?:grid-)?(row|col)-span-(.+)$/, ([, c, s]) => {
367
369
  if (s === "full")
368
370
  return { [`grid-${rowCol(c)}`]: "1/-1" };
369
- const v = utilities.handler.bracket.number(s);
371
+ const v = index.handler.bracket.number(s);
370
372
  if (v != null)
371
373
  return { [`grid-${rowCol(c)}`]: `span ${v}/span ${v}` };
372
374
  }, { autocomplete: ["grid-(row|col)-span-<num>", "(row|col)-span-<num>"] }],
373
- [/^(?:grid-)?(row|col)-start-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-start`]: utilities.handler.bracket.cssvar(v) ?? v })],
374
- [/^(?:grid-)?(row|col)-end-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]: utilities.handler.bracket.cssvar(v) ?? v })],
375
+ [/^(?:grid-)?(row|col)-start-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-start`]: index.handler.bracket.cssvar(v) ?? v })],
376
+ [/^(?:grid-)?(row|col)-end-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]: index.handler.bracket.cssvar(v) ?? v })],
375
377
  [/^(?:grid-)?auto-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({ [`grid-auto-${rowCol(c)}`]: autoDirection(c, theme, v) })],
376
- [/^(?:grid-auto-flow|auto-flow|grid-flow)-(.+)$/, ([, v]) => ({ "grid-auto-flow": utilities.handler.bracket.cssvar(v) })],
378
+ [/^(?:grid-auto-flow|auto-flow|grid-flow)-(.+)$/, ([, v]) => ({ "grid-auto-flow": index.handler.bracket.cssvar(v) })],
377
379
  [/^(?:grid-auto-flow|auto-flow|grid-flow)-(row|col|dense|row-dense|col-dense)$/, ([, v]) => ({ "grid-auto-flow": rowCol(v).replace("-", " ") })],
378
380
  [/^grid-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({
379
- [`grid-template-${rowCol(c)}`]: theme[`gridTemplate${rowColTheme(c)}`]?.[v] ?? utilities.handler.bracket.cssvar(v)
381
+ [`grid-template-${rowCol(c)}`]: theme[`gridTemplate${rowColTheme(c)}`]?.[v] ?? index.handler.bracket.cssvar(v)
380
382
  })],
381
383
  [/^grid-(rows|cols)-minmax-([\w.-]+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(auto-fill,minmax(${d},1fr))` })],
382
384
  [/^grid-(rows|cols)-(\d+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(${d},minmax(0,1fr))` })],
@@ -418,7 +420,7 @@ const justifies = [
418
420
  ["justify-self-stretch", { "justify-self": "stretch" }]
419
421
  ];
420
422
  const orders = [
421
- [/^order-(.+)$/, ([, v]) => ({ order: utilities.handler.bracket.cssvar.number(v) })],
423
+ [/^order-(.+)$/, ([, v]) => ({ order: index.handler.bracket.cssvar.number(v) })],
422
424
  ["order-first", { order: "-9999" }],
423
425
  ["order-last", { order: "9999" }],
424
426
  ["order-none", { order: "0" }]
@@ -461,12 +463,12 @@ const placements = [
461
463
  ["place-self-stretch", { "place-self": "stretch" }]
462
464
  ];
463
465
  function handleInsetValue(v, { theme }) {
464
- return theme.spacing?.[v] ?? utilities.handler.bracket.cssvar.auto.fraction.rem(v);
466
+ return theme.spacing?.[v] ?? index.handler.bracket.cssvar.auto.fraction.rem(v);
465
467
  }
466
468
  function handleInsetValues([, d, v], ctx) {
467
469
  const r = handleInsetValue(v, ctx);
468
- if (r != null && d in utilities.insetMap)
469
- return utilities.insetMap[d].map((i) => [i.slice(1), r]);
470
+ if (r != null && d in index.insetMap)
471
+ return index.insetMap[d].map((i) => [i.slice(1), r]);
470
472
  }
471
473
  const insets = [
472
474
  [
@@ -497,8 +499,8 @@ const floats = [
497
499
  ["clear-none", { clear: "none" }]
498
500
  ];
499
501
  const zIndexes = [
500
- [/^z([\d.]+)$/, ([, v]) => ({ "z-index": utilities.handler.number(v) })],
501
- [/^z-(.+)$/, ([, v]) => ({ "z-index": utilities.handler.bracket.cssvar.auto.number(v) }), { autocomplete: "z-<num>" }]
502
+ [/^z([\d.]+)$/, ([, v]) => ({ "z-index": index.handler.number(v) })],
503
+ [/^z-(.+)$/, ([, v]) => ({ "z-index": index.handler.bracket.cssvar.auto.number(v) }), { autocomplete: "z-<num>" }]
502
504
  ];
503
505
  const boxSizing = [
504
506
  ["box-border", { "box-sizing": "border-box" }],
@@ -514,7 +516,7 @@ const displays = [
514
516
  ["flow-root", { display: "flow-root" }],
515
517
  ["list-item", { display: "list-item" }],
516
518
  ["hidden", { display: "none" }],
517
- [/^display-(.+)$/, ([, c]) => ({ display: utilities.handler.bracket.cssvar(c) || c })]
519
+ [/^display-(.+)$/, ([, c]) => ({ display: index.handler.bracket.cssvar(c) || c })]
518
520
  ];
519
521
  const appearances = [
520
522
  ["visible", { visibility: "visible" }],
@@ -523,7 +525,7 @@ const appearances = [
523
525
  ["backface-hidden", { "backface-visibility": "hidden" }]
524
526
  ];
525
527
  const cursors = [
526
- [/^cursor-(.+)$/, ([, c]) => ({ cursor: utilities.handler.bracket.cssvar(c) || c })]
528
+ [/^cursor-(.+)$/, ([, c]) => ({ cursor: index.handler.bracket.cssvar(c) || c })]
527
529
  ];
528
530
  const pointerEvents = [
529
531
  ["pointer-events-auto", { "pointer-events": "auto" }],
@@ -546,7 +548,7 @@ const whitespaces = [
546
548
  ];
547
549
  const contents = [
548
550
  [/^content-(.+)$/, ([, v]) => {
549
- const c = utilities.handler.bracket.cssvar(v);
551
+ const c = index.handler.bracket.cssvar(v);
550
552
  return { content: c == null ? `"${v}"` : c };
551
553
  }],
552
554
  ["content-empty", { content: '""' }],
@@ -593,7 +595,7 @@ const fontSmoothings = [
593
595
 
594
596
  const rings = [
595
597
  [/^ring(?:-(.+))?$/, ([, d], { theme }) => {
596
- const value = theme.ringWidth?.[d || "DEFAULT"] ?? utilities.handler.px(d || "1");
598
+ const value = theme.ringWidth?.[d || "DEFAULT"] ?? index.handler.px(d || "1");
597
599
  if (value) {
598
600
  return [
599
601
  {
@@ -613,13 +615,13 @@ const rings = [
613
615
  ];
614
616
  }
615
617
  }, { autocomplete: "ring-$ringWidth" }],
616
- [/^ring-(?:width-|size-)(.+)$/, ([, d], { theme }) => ({ "--un-ring-width": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) }), { autocomplete: "ring-(width|size)-$lineWidth" }],
618
+ [/^ring-(?:width-|size-)(.+)$/, ([, d], { theme }) => ({ "--un-ring-width": theme.lineWidth?.[d] ?? index.handler.bracket.cssvar.px(d) }), { autocomplete: "ring-(width|size)-$lineWidth" }],
617
619
  ["ring-offset", { "--un-ring-offset-width": "1px" }],
618
- [/^ring-offset-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "--un-ring-offset-width": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) }), { autocomplete: "ring-offset-(width|size)-$lineWidth" }],
620
+ [/^ring-offset-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "--un-ring-offset-width": theme.lineWidth?.[d] ?? index.handler.bracket.cssvar.px(d) }), { autocomplete: "ring-offset-(width|size)-$lineWidth" }],
619
621
  [/^ring-(.+)$/, utilities.colorResolver("--un-ring-color", "ring"), { autocomplete: "ring-$colors" }],
620
- [/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "ring-(op|opacity)-<percent>" }],
622
+ [/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": index.handler.bracket.percent(opacity) }), { autocomplete: "ring-(op|opacity)-<percent>" }],
621
623
  [/^ring-offset-(.+)$/, utilities.colorResolver("--un-ring-offset-color", "ring-offset"), { autocomplete: "ring-offset-$colors" }],
622
- [/^ring-offset-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-offset-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "ring-offset-(op|opacity)-<percent>" }],
624
+ [/^ring-offset-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-offset-opacity": index.handler.bracket.percent(opacity) }), { autocomplete: "ring-offset-(op|opacity)-<percent>" }],
623
625
  ["ring-inset", { "--un-ring-inset": "inset" }]
624
626
  ];
625
627
 
@@ -641,7 +643,7 @@ const boxShadows = [
641
643
  }
642
644
  }, { autocomplete: "shadow-$boxShadow" }],
643
645
  [/^shadow-(.+)$/, utilities.colorResolver("--un-shadow-color", "shadow"), { autocomplete: "shadow-$colors" }],
644
- [/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "shadow-(op|opacity)-<percent>" }],
646
+ [/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": index.handler.bracket.percent(opacity) }), { autocomplete: "shadow-(op|opacity)-<percent>" }],
645
647
  ["shadow-inset", { "--un-shadow-inset": "inset" }]
646
648
  ];
647
649
 
@@ -665,7 +667,7 @@ function getSizeValue(minmax, hw, theme, prop) {
665
667
  case "min":
666
668
  return `${prop}-content`;
667
669
  }
668
- return utilities.handler.bracket.cssvar.auto.fraction.rem(prop);
670
+ return index.handler.bracket.cssvar.auto.fraction.rem(prop);
669
671
  }
670
672
  const sizes = [
671
673
  [
@@ -700,7 +702,7 @@ function getAspectRatio(prop) {
700
702
  case "video":
701
703
  return "16/9";
702
704
  }
703
- return utilities.handler.bracket.cssvar.auto.number(prop);
705
+ return index.handler.bracket.cssvar.auto.number(prop);
704
706
  }
705
707
  const aspectRatio = [
706
708
  [/^aspect-(?:ratio-)?(.+)$/, ([, d]) => ({ "aspect-ratio": getAspectRatio(d) }), { autocomplete: ["aspect-(square|video)", "aspect-ratio-(square|video)"] }]
@@ -723,153 +725,6 @@ const margins = [
723
725
  [/^m-?([bi][se])(?:-?(-?.+))?$/, utilities.directionSize("margin")]
724
726
  ];
725
727
 
726
- const transformGpu = {
727
- "--un-transform": [
728
- "translate3d(var(--un-translate-x), var(--un-translate-y), var(--un-translate-z))",
729
- "rotate(var(--un-rotate))",
730
- "rotateX(var(--un-rotate-x))",
731
- "rotateY(var(--un-rotate-y))",
732
- "rotateZ(var(--un-rotate-z))",
733
- "skewX(var(--un-skew-x))",
734
- "skewY(var(--un-skew-y))",
735
- "scaleX(var(--un-scale-x))",
736
- "scaleY(var(--un-scale-y))",
737
- "scaleZ(var(--un-scale-z))"
738
- ].join(" ")
739
- };
740
- const transformCpu = {
741
- "--un-transform": [
742
- "translateX(var(--un-translate-x))",
743
- "translateY(var(--un-translate-y))",
744
- "translateZ(var(--un-translate-z))",
745
- "rotate(var(--un-rotate))",
746
- "rotateX(var(--un-rotate-x))",
747
- "rotateY(var(--un-rotate-y))",
748
- "rotateZ(var(--un-rotate-z))",
749
- "skewX(var(--un-skew-x))",
750
- "skewY(var(--un-skew-y))",
751
- "scaleX(var(--un-scale-x))",
752
- "scaleY(var(--un-scale-y))",
753
- "scaleZ(var(--un-scale-z))"
754
- ].join(" ")
755
- };
756
- const transformBase = {
757
- "--un-rotate": 0,
758
- "--un-rotate-x": 0,
759
- "--un-rotate-y": 0,
760
- "--un-rotate-z": 0,
761
- "--un-scale-x": 1,
762
- "--un-scale-y": 1,
763
- "--un-scale-z": 1,
764
- "--un-skew-x": 0,
765
- "--un-skew-y": 0,
766
- "--un-translate-x": 0,
767
- "--un-translate-y": 0,
768
- "--un-translate-z": 0,
769
- ...transformCpu,
770
- [core.CONTROL_SHORTCUT_NO_MERGE]: "",
771
- [utilities.CONTROL_MINI_NO_NEGATIVE]: ""
772
- };
773
- const transforms = [
774
- [/^(?:transform-)?origin-(.+)$/, ([, s]) => ({ "transform-origin": utilities.positionMap[s] ?? utilities.handler.bracket.cssvar(s) }), { autocomplete: [`transform-origin-(${Object.keys(utilities.positionMap).join("|")})`, `origin-(${Object.keys(utilities.positionMap).join("|")})`] }],
775
- [/^(?:transform-)?perspect(?:ive)?-(.+)$/, ([, s]) => {
776
- const v = utilities.handler.bracket.cssvar.px.numberWithUnit(s);
777
- if (v != null) {
778
- return {
779
- "-webkit-perspective": v,
780
- "perspective": v
781
- };
782
- }
783
- }],
784
- [/^(?:transform-)?perspect(?:ive)?-origin-(.+)$/, ([, s]) => {
785
- const v = utilities.handler.bracket.cssvar(s) ?? (s.length >= 3 ? utilities.positionMap[s] : void 0);
786
- if (v != null) {
787
- return {
788
- "-webkit-perspective-origin": v,
789
- "perspective-origin": v
790
- };
791
- }
792
- }],
793
- [/^(?:transform-)?translate-()(.+)$/, handleTranslate],
794
- [/^(?:transform-)?translate-([xyz])-(.+)$/, handleTranslate],
795
- [/^(?:transform-)?rotate-()(.+)$/, handleRotate],
796
- [/^(?:transform-)?rotate-([xyz])-(.+)$/, handleRotate],
797
- [/^(?:transform-)?skew-([xy])-(.+)$/, handleSkew],
798
- [/^(?:transform-)?scale-()(.+)$/, handleScale],
799
- [/^(?:transform-)?scale-([xyz])-(.+)$/, handleScale],
800
- [/^(?:transform-)?preserve-3d$/, () => ({ "transform-style": "preserve-3d" })],
801
- [/^(?:transform-)?preserve-flat$/, () => ({ "transform-style": "flat" })],
802
- [/^transform$/, () => [
803
- transformBase,
804
- { transform: "var(--un-transform)" }
805
- ]],
806
- ["transform-gpu", transformGpu],
807
- ["transform-cpu", transformCpu],
808
- ["transform-none", { transform: "none" }]
809
- ];
810
- function handleTranslate([, d, b], { theme }) {
811
- const v = theme.spacing?.[b] ?? utilities.handler.bracket.cssvar.fraction.rem(b);
812
- if (v != null) {
813
- return [
814
- transformBase,
815
- [
816
- ...utilities.xyzMap[d].map((i) => [`--un-translate${i}`, v]),
817
- ["transform", "var(--un-transform)"]
818
- ]
819
- ];
820
- }
821
- }
822
- function handleScale([, d, b]) {
823
- const v = utilities.handler.bracket.cssvar.fraction.percent(b);
824
- if (v != null) {
825
- return [
826
- transformBase,
827
- [
828
- ...utilities.xyzMap[d].map((i) => [`--un-scale${i}`, v]),
829
- ["transform", "var(--un-transform)"]
830
- ]
831
- ];
832
- }
833
- }
834
- function handleRotate([, d = "", b]) {
835
- const v = utilities.handler.bracket.cssvar.degree(b);
836
- if (v != null) {
837
- if (d) {
838
- return [
839
- transformBase,
840
- {
841
- "--un-rotate": 0,
842
- [`--un-rotate-${d}`]: v,
843
- "transform": "var(--un-transform)"
844
- }
845
- ];
846
- } else {
847
- return [
848
- transformBase,
849
- {
850
- "--un-rotate-x": 0,
851
- "--un-rotate-y": 0,
852
- "--un-rotate-z": 0,
853
- "--un-rotate": v,
854
- "transform": "var(--un-transform)"
855
- }
856
- ];
857
- }
858
- }
859
- }
860
- function handleSkew([, d, b]) {
861
- const v = utilities.handler.bracket.cssvar.degree(b);
862
- if (v != null) {
863
- return [
864
- transformBase,
865
- {
866
- [`--un-skew-${d}`]: v,
867
- transform: "var(--un-transform)"
868
- }
869
- ];
870
- }
871
- }
872
-
873
728
  const variablesAbbrMap = {
874
729
  backface: "backface-visibility",
875
730
  break: "word-break",
@@ -889,11 +744,11 @@ const cssVariables = [
889
744
  [/^(.+?)-(\$.+)$/, ([, name, varname]) => {
890
745
  const prop = variablesAbbrMap[name];
891
746
  if (prop)
892
- return { [prop]: utilities.handler.cssvar(varname) };
747
+ return { [prop]: index.handler.cssvar(varname) };
893
748
  }]
894
749
  ];
895
750
  const cssProperty = [
896
- [/^\[([\w_-]+):([^'"]+)\]$/, ([, prop, value]) => ({ [prop]: utilities.handler.bracket(`[${value}]`) })]
751
+ [/^\[([\w_-]+):([^'"]+)\]$/, ([, prop, value]) => ({ [prop]: index.handler.bracket(`[${value}]`) })]
897
752
  ];
898
753
 
899
754
  const questionMark = [
@@ -907,10 +762,10 @@ ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
907
762
  ]
908
763
  ];
909
764
 
910
- const decorationStyles = ["solid", "double", "dotted", "dashed", "wavy", ...utilities.globalKeywords];
765
+ const decorationStyles = ["solid", "double", "dotted", "dashed", "wavy", ...index.globalKeywords];
911
766
  const textDecorations = [
912
767
  [/^(?:decoration-)?(underline|overline|line-through)$/, ([, s]) => ({ "text-decoration-line": s }), { autocomplete: "decoration-(underline|overline|line-through)" }],
913
- [/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? utilities.handler.bracket.cssvar.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
768
+ [/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? index.handler.bracket.cssvar.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
914
769
  [/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s }), { autocomplete: "(underline|decoration)-(auto|from-font)" }],
915
770
  [/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
916
771
  const result = utilities.colorResolver("text-decoration-color", "line")(match, ctx);
@@ -921,8 +776,8 @@ const textDecorations = [
921
776
  };
922
777
  }
923
778
  }, { autocomplete: "(underline|decoration)-$colors" }],
924
- [/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "(underline|decoration)-(op|opacity)-<percent>" }],
925
- [/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? utilities.handler.auto.bracket.cssvar.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
779
+ [/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": index.handler.bracket.percent(opacity) }), { autocomplete: "(underline|decoration)-(op|opacity)-<percent>" }],
780
+ [/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? index.handler.auto.bracket.cssvar.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
926
781
  ...decorationStyles.map((v) => [`underline-${v}`, { "text-decoration-style": v }]),
927
782
  ...decorationStyles.map((v) => [`decoration-${v}`, { "text-decoration-style": v }]),
928
783
  ["no-underline", { "text-decoration": "none" }],
@@ -931,13 +786,13 @@ const textDecorations = [
931
786
 
932
787
  const svgUtilities = [
933
788
  [/^fill-(.+)$/, utilities.colorResolver("fill", "fill"), { autocomplete: "fill-$colors" }],
934
- [/^fill-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-fill-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "fill-(op|opacity)-<percent>" }],
789
+ [/^fill-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-fill-opacity": index.handler.bracket.percent(opacity) }), { autocomplete: "fill-(op|opacity)-<percent>" }],
935
790
  ["fill-none", { fill: "none" }],
936
- [/^stroke-(?:width-|size-)?(.+)$/, ([, s], { theme }) => ({ "stroke-width": theme.lineWidth?.[s] ?? utilities.handler.bracket.cssvar.fraction.px.number(s) }), { autocomplete: ["stroke-width-$lineWidth", "stroke-size-$lineWidth"] }],
937
- [/^stroke-dash-(.+)$/, ([, s]) => ({ "stroke-dasharray": utilities.handler.bracket.cssvar.number(s) }), { autocomplete: "stroke-dash-<num>" }],
938
- [/^stroke-offset-(.+)$/, ([, s], { theme }) => ({ "stroke-dashoffset": theme.lineWidth?.[s] ?? utilities.handler.bracket.cssvar.px.numberWithUnit(s) }), { autocomplete: "stroke-offset-$lineWidth" }],
791
+ [/^stroke-(?:width-|size-)?(.+)$/, ([, s], { theme }) => ({ "stroke-width": theme.lineWidth?.[s] ?? index.handler.bracket.cssvar.fraction.px.number(s) }), { autocomplete: ["stroke-width-$lineWidth", "stroke-size-$lineWidth"] }],
792
+ [/^stroke-dash-(.+)$/, ([, s]) => ({ "stroke-dasharray": index.handler.bracket.cssvar.number(s) }), { autocomplete: "stroke-dash-<num>" }],
793
+ [/^stroke-offset-(.+)$/, ([, s], { theme }) => ({ "stroke-dashoffset": theme.lineWidth?.[s] ?? index.handler.bracket.cssvar.px.numberWithUnit(s) }), { autocomplete: "stroke-offset-$lineWidth" }],
939
794
  [/^stroke-(.+)$/, utilities.colorResolver("stroke", "stroke"), { autocomplete: "stroke-$colors" }],
940
- [/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "stroke-(op|opacity)-<percent>" }],
795
+ [/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity": index.handler.bracket.percent(opacity) }), { autocomplete: "stroke-(op|opacity)-<percent>" }],
941
796
  ["stroke-cap-square", { "stroke-linecap": "square" }],
942
797
  ["stroke-cap-round", { "stroke-linecap": "round" }],
943
798
  ["stroke-cap-auto", { "stroke-linecap": "butt" }],
@@ -1000,7 +855,7 @@ const rules = [
1000
855
  zIndexes,
1001
856
  boxSizing,
1002
857
  transitions,
1003
- transforms,
858
+ transform.transforms,
1004
859
  willChange,
1005
860
  questionMark
1006
861
  ].flat(1);
@@ -1052,7 +907,6 @@ exports.textOverflows = textOverflows;
1052
907
  exports.textShadows = textShadows;
1053
908
  exports.textStrokes = textStrokes;
1054
909
  exports.textTransforms = textTransforms;
1055
- exports.transforms = transforms;
1056
910
  exports.transitions = transitions;
1057
911
  exports.userSelects = userSelects;
1058
912
  exports.varEmpty = varEmpty;