@unocss/preset-mini 0.16.4 → 0.17.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.
@@ -1,5 +1,5 @@
1
- import { hex2rgba, toArray } from '@unocss/core';
2
- import { h as handler, d as directionMap, c as cornerMap, a as capitalize, b as directionSize, x as xyzMap } from './utilities.mjs';
1
+ import { c as colorResolver$1, h as handler, d as directionMap, a as cornerMap, p as parseColor, b as capitalize, e as directionSize, x as xyzMap } from './utilities.mjs';
2
+ import { toArray } from '@unocss/core';
3
3
  import { C as CONTROL_BYPASS_PSEUDO_CLASS } from './pseudo.mjs';
4
4
 
5
5
  const verticalAlignAlias = {
@@ -17,222 +17,10 @@ const textAligns = [
17
17
  ["text-justify", { "text-align": "justify" }]
18
18
  ];
19
19
 
20
- const parseColorUtil = (body, theme) => {
21
- const [main, opacity2] = body.split(/(?:\/|:)/);
22
- const colors = main.replace(/([a-z])([0-9])/g, "$1-$2").split(/-/g);
23
- const [name] = colors;
24
- if (!name)
25
- return;
26
- let color;
27
- const bracket = handler.bracket(main);
28
- const bracketOrMain = bracket || main;
29
- if (bracketOrMain.startsWith("#"))
30
- color = bracketOrMain.slice(1);
31
- if (bracketOrMain.startsWith("hex-"))
32
- color = bracketOrMain.slice(4);
33
- color = color || bracket;
34
- let no = "DEFAULT";
35
- if (!color) {
36
- let colorData = theme.colors?.[name];
37
- if (colorData) {
38
- [, no = no] = colors;
39
- } else {
40
- if (colors.slice(-1)[0].match(/^\d+$/))
41
- no = colors.pop();
42
- colorData = theme.colors?.[colors.join("-").replace(/(-[a-z])/g, (n) => n.slice(1).toUpperCase())];
43
- }
44
- if (typeof colorData === "string")
45
- color = colorData;
46
- else if (no && colorData)
47
- color = colorData[no];
48
- }
49
- return {
50
- opacity: opacity2,
51
- name,
52
- no,
53
- color,
54
- rgba: hex2rgba(color)
55
- };
56
- };
57
- const colorResolver$1 = (attribute, varName) => ([, body], { theme }) => {
58
- const data = parseColorUtil(body, theme);
59
- if (!data)
60
- return;
61
- const { opacity: opacity2, color, rgba } = data;
62
- if (!color)
63
- return;
64
- const a = opacity2 ? opacity2[0] === "[" ? handler.bracket.percent(opacity2) : parseFloat(opacity2) / 100 : rgba?.[3];
65
- if (rgba) {
66
- if (a != null && !Number.isNaN(a)) {
67
- rgba[3] = typeof a === "string" && !a.includes("%") ? parseFloat(a) : a;
68
- return {
69
- [attribute]: `rgba(${rgba.join(",")})`
70
- };
71
- } else {
72
- return {
73
- [`--un-${varName}-opacity`]: 1,
74
- [attribute]: `rgba(${rgba.slice(0, 3).join(",")},var(--un-${varName}-opacity))`
75
- };
76
- }
77
- } else {
78
- return {
79
- [attribute]: color.replace("%alpha", `${a || 1}`)
80
- };
81
- }
82
- };
83
- const opacity = [
84
- [/^op(?:acity)?-?(.+)$/, ([, d]) => ({ opacity: handler.bracket.percent.cssvar(d) })]
85
- ];
86
- const textColors = [
87
- [/^(?:text|color|c)-(.+)$/, colorResolver$1("color", "text")],
88
- [/^(?:text|color|c)-op(?:acity)?-?(.+)$/m, ([, opacity2]) => ({ "--un-text-opacity": handler.bracket.percent.cssvar(opacity2) })]
89
- ];
90
- const bgColors = [
91
- [/^bg-(.+)$/, colorResolver$1("background-color", "bg")],
92
- [/^bg-op(?:acity)?-?(.+)$/m, ([, opacity2]) => ({ "--un-bg-opacity": handler.bracket.percent(opacity2) })]
93
- ];
94
- const borderColors = [
95
- [/^(?:border|b)-(.+)$/, colorResolver$1("border-color", "border")],
96
- [/^(?:border|b)-op(?:acity)?-?(.+)$/m, ([, opacity2]) => ({ "--un-border-opacity": handler.bracket.percent(opacity2) })]
97
- ];
98
- const ringColors = [
99
- [/^ring-(.+)$/, colorResolver$1("--un-ring-color", "ring")],
100
- [/^ring-op(?:acity)?-?(.+)$/m, ([, opacity2]) => ({ "--un-ring-opacity": handler.bracket.percent(opacity2) })]
101
- ];
102
- const ringOffsetColors = [
103
- [/^ring-offset-(.+)$/, colorResolver$1("--un-ring-offset-color", "ring-offset")],
104
- [/^ring-offset-op(?:acity)?-?(.+)$/m, ([, opacity2]) => ({ "--un-ring-offset-opacity": handler.bracket.percent(opacity2) })]
105
- ];
106
-
107
- const cssBasicProps = [
108
- "color",
109
- "border-color",
110
- "background-color",
111
- "flex-grow",
112
- "flex",
113
- "flex-shrink",
114
- "caret-color",
115
- "font",
116
- "gap",
117
- "opacity",
118
- "visibility",
119
- "z-index",
120
- "font-weight",
121
- "zoom",
122
- "text-shadow",
123
- "transform",
124
- "box-shadow"
125
- ];
126
- const cssPositionProps = [
127
- "backround-position",
128
- "left",
129
- "right",
130
- "top",
131
- "bottom",
132
- "object-position"
133
- ];
134
- const cssSizeProps = [
135
- "max-height",
136
- "min-height",
137
- "max-width",
138
- "min-width",
139
- "height",
140
- "width",
141
- "border-width",
142
- "margin",
143
- "padding",
144
- "outline-width",
145
- "outline-offset",
146
- "font-size",
147
- "line-height",
148
- "text-indent",
149
- "vertical-align",
150
- "border-spacing",
151
- "letter-spacing",
152
- "word-spacing"
153
- ];
154
- const cssEnhanceProps = ["stroke", "filter", "backdrop-filter", "fill", "mask", "mask-size", "mask-border", "clip-path", "clip"];
155
- const cssProps = [
156
- ...cssBasicProps,
157
- ...cssPositionProps,
158
- ...cssSizeProps,
159
- ...cssEnhanceProps
160
- ];
161
- const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
162
- const displays = [
163
- ["inline", { display: "inline" }],
164
- ["block", { display: "block" }],
165
- ["inline-block", { display: "inline-block" }],
166
- ["contents", { display: "contents" }],
167
- ["flow-root", { display: "flow-root" }],
168
- ["list-item", { display: "list-item" }],
169
- ["hidden", { display: "none" }]
170
- ];
171
- const appearances = [
172
- ["visible", { visibility: "visible" }],
173
- ["invisible", { visibility: "hidden" }],
174
- ["backface-visible", { "backface-visibility": "visible" }],
175
- ["backface-hidden", { "backface-visibility": "hidden" }]
176
- ];
177
- const cursors = [
178
- [/^cursor-(.+)$/, ([, c]) => ({ cursor: c })]
179
- ];
180
- const pointerEvents = [
181
- ["pointer-events-none", { "pointer-events": "none" }],
182
- ["pointer-events-auto", { "pointer-events": "auto" }]
183
- ];
184
- const resizes = [
185
- ["resize-none", { resize: "none" }],
186
- ["resize-x", { resize: "horizontal" }],
187
- ["resize-y", { resize: "vertical" }],
188
- ["resize", { resize: "both" }]
189
- ];
190
- const userSelects = [
191
- [/^select-(none|text|all|auto)$/, ([, v]) => ({ "user-select": v })]
192
- ];
193
- const whitespaces = [
194
- [/^(?:whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap)$/, ([, v]) => ({ "white-space": v })]
195
- ];
196
- const contents = [
197
- ["content-empty", { content: '""' }]
198
- ];
199
- const breaks = [
200
- ["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }],
201
- ["break-word", { "overflow-wrap": "break-word" }],
202
- ["break-all", { "word-break": "break-all" }]
203
- ];
204
- const textOverflows = [
205
- ["truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
206
- ["text-ellipsis", { "text-overflow": "ellipsis" }],
207
- ["text-clip", { "text-overflow": "clip" }]
208
- ];
209
- const textTransforms = [
210
- ["case-upper", { "text-transform": "uppercase" }],
211
- ["case-lower", { "text-transform": "lowercase" }],
212
- ["case-capital", { "text-transform": "capitalize" }],
213
- ["case-normal", { "text-transform": "none" }]
214
- ];
215
- const fontStyles = [
216
- ["italic", { "font-style": "italic" }],
217
- ["not-italic", { "font-style": "normal" }]
218
- ];
219
- const fontSmoothings = [
220
- ["antialiased", {
221
- "-webkit-font-smoothing": "antialiased",
222
- "-moz-osx-font-smoothing": "grayscale",
223
- "font-smoothing": "grayscale"
224
- }],
225
- ["subpixel-antialiased", {
226
- "-webkit-font-smoothing": "auto",
227
- "-moz-osx-font-smoothing": "auto",
228
- "font-smoothing": "auto"
229
- }]
230
- ];
231
-
232
- const outlineStyle = ["none", "auto", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset", "inherit", "initial", "revert", "unset"];
20
+ const outlineStyle = ["auto", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset", "inherit", "initial", "revert", "unset"];
233
21
  const parseOutlineSize = (s) => {
234
22
  const propName = ["width", "offset"].find((item) => s.startsWith(item)) || "width";
235
- const size = handler.bracket.fraction.rem(s.replace(/^(offset\-|width\-|size\-)/, ""));
23
+ const size = handler.bracket.fraction.auto.rem(s.replace(/^(offset\-|width\-|size\-)/, ""));
236
24
  if (size) {
237
25
  return {
238
26
  [`outline-${propName}`]: size
@@ -240,18 +28,11 @@ const parseOutlineSize = (s) => {
240
28
  }
241
29
  };
242
30
  const outline = [
243
- ["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }],
244
31
  ["outline", { "outline-style": "solid" }],
245
32
  [
246
33
  /^outline-(.+)$/,
247
34
  (match, config) => {
248
35
  const [, d] = match;
249
- if (d === "none") {
250
- return {
251
- "outline": "2px solid transparent",
252
- "outline-offset": "2px"
253
- };
254
- }
255
36
  if (outlineStyle.includes(d)) {
256
37
  return {
257
38
  "outline-style": d
@@ -267,7 +48,8 @@ const outline = [
267
48
  if (sizeSheet)
268
49
  return sizeSheet;
269
50
  }
270
- ]
51
+ ],
52
+ ["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }]
271
53
  ];
272
54
  const appearance = [
273
55
  ["appearance-none", {
@@ -290,18 +72,8 @@ const placeholder = [
290
72
  }
291
73
  ]
292
74
  ];
293
- const cssPropsStr = cssProps.join(", ");
294
- const validateProperty$1 = (prop) => {
295
- if (prop && !cssProps.includes(prop))
296
- return;
297
- return prop || cssPropsStr;
298
- };
299
75
  const willChange = [
300
- [/^will-change-(.*)/, ([, p]) => {
301
- const w = validateProperty$1(p) || handler.global(p);
302
- if (w)
303
- return { "will-change": w };
304
- }]
76
+ [/^will-change-(.+)/, ([, p]) => ({ "will-change": handler.properties.global(p) })]
305
77
  ];
306
78
 
307
79
  const borders = [
@@ -319,8 +91,8 @@ const borders = [
319
91
  ["border-double", { "border-style": "double" }],
320
92
  ["border-none", { "border-style": "none" }],
321
93
  [/^(?:border-)?(?:rounded|rd)$/, handlerRounded],
322
- [/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?$/, handlerRounded],
323
- [/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?(?:-([^-]+))?$/, handlerRounded]
94
+ [/^(?:border-)?(?:rounded|rd)(?:-(.+))?$/, handlerRounded],
95
+ [/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?(?:-(.+))?$/, handlerRounded]
324
96
  ];
325
97
  function handlerBorder(m) {
326
98
  const borderSizes = handlerBorderSize(m);
@@ -334,64 +106,71 @@ function handlerBorder(m) {
334
106
  function handlerBorderSize([, a, b]) {
335
107
  const [d, s = "1"] = directionMap[a] ? [a, b] : ["", a];
336
108
  const v = handler.bracket.px(s);
337
- if (v != null) {
338
- return [
339
- ...directionMap[d].map((i) => [`border${i}-width`, v])
340
- ];
341
- }
109
+ if (v !== void 0)
110
+ return directionMap[d].map((i) => [`border${i}-width`, v]);
342
111
  }
343
112
  function handlerBorderColor([, a, c], ctx) {
344
- if (c !== void 0) {
345
- const ofColor = colorResolver$1("border-color", "border")(["", c], ctx);
346
- if (ofColor) {
347
- const borders2 = directionMap[directionMap[a] ? a : ""].map((i) => colorResolver$1(`border${i}-color`, "border")(["", c], ctx));
348
- const borderObject = {};
349
- Object.assign(borderObject, ...borders2);
350
- return borderObject;
351
- }
113
+ if (c !== void 0 && colorResolver$1("border-color", "border")(["", c], ctx)) {
114
+ return Object.assign({}, ...directionMap[directionMap[a] ? a : ""].map((i) => colorResolver$1(`border${i}-color`, "border")(["", c], ctx)));
352
115
  }
353
116
  }
354
117
  function handlerRounded([, a, b], { theme }) {
355
118
  const [d, s = "DEFAULT"] = cornerMap[a] ? [a, b] : ["", a];
356
- const v = theme.borderRadius?.[s] || handler.bracket.fraction.rem(s);
357
- if (v != null)
119
+ const v = theme.borderRadius?.[s] || handler.auto.rem.fraction.bracket.cssvar(s);
120
+ if (v !== void 0)
358
121
  return cornerMap[d].map((i) => [`border${i}-radius`, v]);
359
122
  }
360
123
 
361
- const transitionSwitchProps = ["all", "none"];
362
- const transitionPropsStr = cssProps.join(", ");
363
- const validateProperty = (prop) => {
364
- if (prop && ![...cssProps, ...transitionSwitchProps].includes(prop))
365
- return;
366
- return prop || transitionPropsStr;
124
+ const opacity = [
125
+ [/^op(?:acity)?-?(.+)$/, ([, d]) => ({ opacity: handler.bracket.percent.cssvar(d) })]
126
+ ];
127
+ const textColors = [
128
+ [/^(?:text|color|c)-(.+)$/, colorResolver$1("color", "text")],
129
+ [/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-text-opacity": handler.bracket.percent.cssvar(opacity2) })]
130
+ ];
131
+ const bgColors = [
132
+ [/^bg-(.+)$/, colorResolver$1("background-color", "bg")],
133
+ [/^bg-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-bg-opacity": handler.bracket.percent(opacity2) })]
134
+ ];
135
+ const borderColors = [
136
+ [/^(?:border|b)-(.+)$/, colorResolver$1("border-color", "border")],
137
+ [/^(?:border|b)-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-border-opacity": handler.bracket.percent(opacity2) })]
138
+ ];
139
+ const ringColors = [
140
+ [/^ring-(.+)$/, colorResolver$1("--un-ring-color", "ring")],
141
+ [/^ring-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-ring-opacity": handler.bracket.percent(opacity2) })]
142
+ ];
143
+ const ringOffsetColors = [
144
+ [/^ring-offset-(.+)$/, colorResolver$1("--un-ring-offset-color", "ring-offset")],
145
+ [/^ring-offset-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-ring-offset-opacity": handler.bracket.percent(opacity2) })]
146
+ ];
147
+
148
+ const transitionProperty = (prop) => {
149
+ return handler.properties(prop) || (prop === "all" ? prop : void 0);
367
150
  };
368
151
  const transitions = [
369
- [/^transition(?:-([a-z-]+))?(?:-(\d+))?$/, ([, prop, duration = "150"]) => {
370
- const transitionProperty = validateProperty(prop);
371
- if (!transitionProperty)
372
- return;
373
- return {
374
- "transition-property": transitionProperty,
375
- "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)",
376
- "transition-duration": `${duration}ms`
377
- };
378
- }],
379
- [/^duration-(\d+)$/, ([, duration = "150"]) => {
380
- return {
381
- "transition-duration": `${duration}ms`
382
- };
152
+ [/^transition(?:-([a-z-]+(?:,[a-z-]+)*))?(?:-(\d+))?$/, ([, prop = "all", duration = "150"]) => {
153
+ const p = transitionProperty(prop);
154
+ if (p) {
155
+ return {
156
+ "transition-property": p,
157
+ "transition-timing-function": "cubic-bezier(0.4,0,0.2,1)",
158
+ "transition-duration": `${duration}ms`
159
+ };
160
+ }
383
161
  }],
162
+ [/^duration-(\d+)$/, ([, duration = "150"]) => ({ "transition-duration": `${duration}ms` })],
384
163
  ["ease", { "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)" }],
164
+ ["ease-linear", { "transition-timing-function": "linear" }],
385
165
  ["ease-in", { "transition-timing-function": "cubic-bezier(0.4, 0, 1, 1)" }],
386
166
  ["ease-out", { "transition-timing-function": "cubic-bezier(0, 0, 0.2, 1)" }],
387
167
  ["ease-in-out", { "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)" }],
388
168
  [/^transition-delay-(\d+)$/, ([, v]) => ({ "transition-delay": `${v}ms` })],
389
169
  [/^transition-duration-(\d+)$/, ([, v]) => ({ "transition-duration": `${v}ms` })],
390
- [/^(?:transition-)?property-([a-z-]+)$/, ([, v]) => {
391
- const transitionProperty = validateProperty(v);
392
- if (transitionProperty)
393
- return { "transition-property": transitionProperty };
394
- }]
170
+ [/^(?:transition-)?property-(.+)$/, ([, v]) => ({ "transition-property": handler.global(v) || transitionProperty(v) })],
171
+ ["transition-property-none", { "transition-property": "none" }],
172
+ ["property-none", { "transition-property": "none" }],
173
+ ["transition-none", { transition: "none" }]
395
174
  ];
396
175
 
397
176
  const flex = [
@@ -437,7 +216,7 @@ const fonts = [
437
216
  }
438
217
  }],
439
218
  [/^text-(.+)$/, ([, s = "base"], { theme }) => {
440
- const size = handler.bracket.rem(s);
219
+ const size = handler.bracket.auto.rem(s);
441
220
  if (size)
442
221
  return { "font-size": size };
443
222
  const themed = toArray(theme.fontSize?.[s]);
@@ -450,7 +229,7 @@ const fonts = [
450
229
  }
451
230
  }],
452
231
  [/^text-size-(.+)$/, ([, s]) => {
453
- const raw = handler.bracket.rem(s);
232
+ const raw = handler.bracket.auto.rem(s);
454
233
  if (raw)
455
234
  return { "font-size": raw };
456
235
  }],
@@ -460,17 +239,17 @@ const fonts = [
460
239
  return { "font-weight": v };
461
240
  }],
462
241
  [/^(?:leading|lh)-([^-]+)$/, ([, s], { theme }) => {
463
- const v = theme.lineHeight?.[s] || handler.bracket.rem(s);
242
+ const v = theme.lineHeight?.[s] || handler.bracket.auto.rem(s);
464
243
  if (v !== null)
465
244
  return { "line-height": v };
466
245
  }],
467
246
  [/^tracking-([^-]+)$/, ([, s], { theme }) => {
468
- const v = theme.letterSpacing?.[s] || handler.bracket.rem(s);
247
+ const v = theme.letterSpacing?.[s] || handler.bracket.auto.rem(s);
469
248
  if (v !== null)
470
249
  return { "letter-spacing": v };
471
250
  }],
472
251
  [/^word-spacing-([^-]+)$/, ([, s], { theme }) => {
473
- const v = theme.wordSpacing?.[s] || handler.bracket.rem(s);
252
+ const v = theme.wordSpacing?.[s] || handler.bracket.auto.rem(s);
474
253
  if (v !== null)
475
254
  return { "word-spacing": v };
476
255
  }]
@@ -490,7 +269,7 @@ const tabSizes = [
490
269
  ];
491
270
  const textIndents = [
492
271
  [/^indent(?:-(.+))?$/, ([, s], { theme }) => {
493
- const v = theme.textIndent?.[s || "DEFAULT"] || handler.bracket.cssvar.fraction.rem(s);
272
+ const v = theme.textIndent?.[s || "DEFAULT"] || handler.bracket.cssvar.fraction.auto.rem(s);
494
273
  if (v != null)
495
274
  return { "text-indent": v };
496
275
  }]
@@ -502,7 +281,7 @@ const textStrokes = [
502
281
  return { "-webkit-text-stroke-width": v };
503
282
  }],
504
283
  [/^text-stroke-(.+)$/, colorResolver$1("-webkit-text-stroke-color", "text-stroke")],
505
- [/^text-stroke-op(?:acity)?-?(.+)$/m, ([, opacity]) => ({ "--un-text-stroke-opacity": handler.bracket.percent(opacity) })]
284
+ [/^text-stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-stroke-opacity": handler.bracket.percent(opacity) })]
506
285
  ];
507
286
  const textShadows = [
508
287
  [/^text-shadow(?:-(.+))?$/, ([, s], { theme }) => {
@@ -514,7 +293,7 @@ const textShadows = [
514
293
 
515
294
  const gaps = [
516
295
  [/^(?:flex-|grid-)?gap-([^-]+)$/, ([, s]) => {
517
- const v = handler.bracket.rem(s);
296
+ const v = handler.bracket.auto.rem(s);
518
297
  if (v != null) {
519
298
  return {
520
299
  "grid-gap": v,
@@ -523,7 +302,7 @@ const gaps = [
523
302
  }
524
303
  }],
525
304
  [/^(?:flex-|grid-)?gap-x-([^-]+)$/, ([, s]) => {
526
- const v = handler.bracket.rem(s);
305
+ const v = handler.bracket.auto.rem(s);
527
306
  if (v != null) {
528
307
  return {
529
308
  "grid-column-gap": v,
@@ -532,7 +311,7 @@ const gaps = [
532
311
  }
533
312
  }],
534
313
  [/^(?:flex-|grid-)?gap-y-([^-]+)$/, ([, s]) => {
535
- const v = handler.bracket.rem(s);
314
+ const v = handler.bracket.auto.rem(s);
536
315
  if (v != null) {
537
316
  return {
538
317
  "grid-row-gap": v,
@@ -542,7 +321,7 @@ const gaps = [
542
321
  }]
543
322
  ];
544
323
 
545
- const calSize = (s, theme) => toArray(theme.fontSize?.[s] || handler.bracket.rem(s))[0];
324
+ const calSize = (s, theme) => toArray(theme.fontSize?.[s] || handler.bracket.auto.rem(s))[0];
546
325
  const autoDirection = (selector, theme) => {
547
326
  if (selector === "min")
548
327
  return "min-content";
@@ -555,10 +334,10 @@ const autoDirection = (selector, theme) => {
555
334
  const grids = [
556
335
  ["grid", { display: "grid" }],
557
336
  ["inline-grid", { display: "inline-grid" }],
558
- [/^(?:grid-)?col-start-([\w.-]+)$/, ([, v]) => ({ "grid-column-start": `${v}` })],
559
- [/^(?:grid-)?col-end-([\w.]+)$/, ([, v]) => ({ "grid-column-end": `${v}` })],
560
- [/^(?:grid-)?row-start-([\w.-]+)$/, ([, v]) => ({ "grid-row-start": `${v}` })],
561
- [/^(?:grid-)?row-end-([\w.-]+)$/, ([, v]) => ({ "grid-row-end": `${v}` })],
337
+ [/^(?:grid-)?col-start-([\w.-]+)$/, ([, v]) => ({ "grid-column-start": v })],
338
+ [/^(?:grid-)?col-end-([\w.]+)$/, ([, v]) => ({ "grid-column-end": v })],
339
+ [/^(?:grid-)?row-start-([\w.-]+)$/, ([, v]) => ({ "grid-row-start": v })],
340
+ [/^(?:grid-)?row-end-([\w.-]+)$/, ([, v]) => ({ "grid-row-end": v })],
562
341
  [/^(?:grid-)?(row|col)-(.+)$/, ([, d, v]) => {
563
342
  const key = d === "row" ? "grid-row" : "grid-column";
564
343
  let raw = handler.bracket(v);
@@ -575,11 +354,11 @@ const grids = [
575
354
  return { [key]: `span ${raw}/span ${raw}` };
576
355
  }
577
356
  }],
578
- [/^(?:grid-)?auto-cols-([\w.-]+)$/, ([, v], { theme }) => ({ "grid-auto-columns": `${autoDirection(v, theme)}` })],
579
- [/^(?:grid-)?auto-flow-([\w.-]+)$/, ([, v]) => ({ "grid-auto-flow": `${v.replace("col", "column").split("-").join(" ")}` })],
580
- [/^(?:grid-)?auto-rows-([\w.-]+)$/, ([, v], { theme }) => ({ "grid-auto-rows": `${autoDirection(v, theme)}` })],
581
- [/^grid-cols-minmax-([\w.-]+)$/, ([, d]) => ({ "grid-template-columns": `repeat(auto-fill, minmax(${d}, 1fr))` })],
582
- [/^grid-rows-minmax-([\w.-]+)$/, ([, d]) => ({ "grid-template-rows": `repeat(auto-fill, minmax(${d}, 1fr))` })],
357
+ [/^(?:grid-)?auto-cols-([\w.-]+)$/, ([, v], { theme }) => ({ "grid-auto-columns": autoDirection(v, theme) })],
358
+ [/^(?:grid-)?auto-flow-([\w.-]+)$/, ([, v]) => ({ "grid-auto-flow": v.replace("col", "column").split("-").join(" ") })],
359
+ [/^(?:grid-)?auto-rows-([\w.-]+)$/, ([, v], { theme }) => ({ "grid-auto-rows": autoDirection(v, theme) })],
360
+ [/^grid-cols-minmax-([\w.-]+)$/, ([, d]) => ({ "grid-template-columns": `repeat(auto-fill,minmax(${d},1fr))` })],
361
+ [/^grid-rows-minmax-([\w.-]+)$/, ([, d]) => ({ "grid-template-rows": `repeat(auto-fill,minmax(${d},1fr))` })],
583
362
  [/^grid-cols-(\d+)$/, ([, d]) => ({ "grid-template-columns": `repeat(${d},minmax(0,1fr))` })],
584
363
  [/^grid-rows-(\d+)$/, ([, d]) => ({ "grid-template-rows": `repeat(${d},minmax(0,1fr))` })],
585
364
  [/^grid-cols-\[(.+)\]$/, ([, v]) => ({ "grid-template-columns": v.replace(/,/g, " ") })],
@@ -616,7 +395,8 @@ const justifies = [
616
395
  ...basicSet.map((i) => [`justify-self-${i}`, { "justify-self": i }])
617
396
  ];
618
397
  const orders = [
619
- [/^order-(.+)$/, ([, v]) => ({ order: { first: "-9999", last: "9999", none: "0" }[v] || handler.bracket.number(v) })]
398
+ [/^order-(.+)$/, ([, v]) => ({ order: { first: "-9999", last: "9999" }[v] || handler.bracket.number(v) })],
399
+ ["order-none", { order: "0" }]
620
400
  ];
621
401
  const alignments = [
622
402
  ["content-start", { "align-content": "flex-start" }],
@@ -634,7 +414,7 @@ const alignments = [
634
414
  ["self-start", { "align-self": "flex-start" }],
635
415
  ["self-end", { "align-self": "flex-end" }],
636
416
  ["self-center", { "align-self": "center" }],
637
- ["self-stretch", { "align-items": "stretch" }]
417
+ ["self-stretch", { "align-self": "stretch" }]
638
418
  ];
639
419
  const placements = [
640
420
  ["place-content-start", { "place-content": "start" }],
@@ -648,7 +428,7 @@ const placements = [
648
428
  ...basicSet.map((i) => [`place-self-${i}`, { "place-self": i }])
649
429
  ];
650
430
  function handleInsetValue(v) {
651
- return { auto: "auto", full: "100%" }[v] ?? handler.bracket.fraction.cssvar.rem(v);
431
+ return { auto: "auto", full: "100%" }[v] ?? handler.bracket.fraction.cssvar.auto.rem(v);
652
432
  }
653
433
  const insets = [
654
434
  [/^(top|left|right|bottom|inset)-(.+)$/, ([, d, v]) => ({ [d]: handleInsetValue(v) })],
@@ -659,8 +439,10 @@ const insets = [
659
439
  }]
660
440
  ];
661
441
  const floats = [
662
- [/^float-(left|right|none)$/, ([, value]) => ({ float: value })],
663
- [/^clear-(left|right|both|none)$/, ([, value]) => ({ clear: value })]
442
+ [/^float-(left|right)$/, ([, value]) => ({ float: value })],
443
+ ["float-none", { float: "none" }],
444
+ [/^clear-(left|right|both)$/, ([, value]) => ({ clear: value })],
445
+ ["clear-none", { clear: "none" }]
664
446
  ];
665
447
  const zIndexes = [
666
448
  ["z-auto", { "z-index": "auto" }],
@@ -675,12 +457,84 @@ const boxSizing = [
675
457
  ]
676
458
  ];
677
459
 
460
+ const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
461
+ const displays = [
462
+ ["inline", { display: "inline" }],
463
+ ["block", { display: "block" }],
464
+ ["inline-block", { display: "inline-block" }],
465
+ ["contents", { display: "contents" }],
466
+ ["flow-root", { display: "flow-root" }],
467
+ ["list-item", { display: "list-item" }],
468
+ ["hidden", { display: "none" }]
469
+ ];
470
+ const appearances = [
471
+ ["visible", { visibility: "visible" }],
472
+ ["invisible", { visibility: "hidden" }],
473
+ ["backface-visible", { "backface-visibility": "visible" }],
474
+ ["backface-hidden", { "backface-visibility": "hidden" }]
475
+ ];
476
+ const cursors = [
477
+ [/^cursor-(.+)$/, ([, c]) => ({ cursor: c })]
478
+ ];
479
+ const pointerEvents = [
480
+ ["pointer-events-auto", { "pointer-events": "auto" }],
481
+ ["pointer-events-none", { "pointer-events": "none" }]
482
+ ];
483
+ const resizes = [
484
+ ["resize-x", { resize: "horizontal" }],
485
+ ["resize-y", { resize: "vertical" }],
486
+ ["resize", { resize: "both" }],
487
+ ["resize-none", { resize: "none" }]
488
+ ];
489
+ const userSelects = [
490
+ [/^select-(text|all|auto)$/, ([, v]) => ({ "user-select": v })],
491
+ ["select-none", { "user-select": "none" }]
492
+ ];
493
+ const whitespaces = [
494
+ [/^(?:whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap)$/, ([, v]) => ({ "white-space": v })]
495
+ ];
496
+ const contents = [
497
+ ["content-empty", { content: '""' }]
498
+ ];
499
+ const breaks = [
500
+ ["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }],
501
+ ["break-word", { "overflow-wrap": "break-word" }],
502
+ ["break-all", { "word-break": "break-all" }]
503
+ ];
504
+ const textOverflows = [
505
+ ["truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
506
+ ["text-ellipsis", { "text-overflow": "ellipsis" }],
507
+ ["text-clip", { "text-overflow": "clip" }]
508
+ ];
509
+ const textTransforms = [
510
+ ["case-upper", { "text-transform": "uppercase" }],
511
+ ["case-lower", { "text-transform": "lowercase" }],
512
+ ["case-capital", { "text-transform": "capitalize" }],
513
+ ["case-normal", { "text-transform": "none" }]
514
+ ];
515
+ const fontStyles = [
516
+ ["italic", { "font-style": "italic" }],
517
+ ["not-italic", { "font-style": "normal" }]
518
+ ];
519
+ const fontSmoothings = [
520
+ ["antialiased", {
521
+ "-webkit-font-smoothing": "antialiased",
522
+ "-moz-osx-font-smoothing": "grayscale",
523
+ "font-smoothing": "grayscale"
524
+ }],
525
+ ["subpixel-antialiased", {
526
+ "-webkit-font-smoothing": "auto",
527
+ "-moz-osx-font-smoothing": "auto",
528
+ "font-smoothing": "auto"
529
+ }]
530
+ ];
531
+
678
532
  const rings = [
679
533
  [/^ring-?(.*)$/, ([, d]) => {
680
534
  const value = handler.px(d || "1");
681
535
  if (value) {
682
536
  return {
683
- "--un-ring-inset": "var(--un-empty, )",
537
+ "--un-ring-inset": varEmpty,
684
538
  "--un-ring-offset-width": "0px",
685
539
  "--un-ring-offset-color": "#fff",
686
540
  "--un-ring-color": "rgba(59, 130, 246, .5)",
@@ -691,13 +545,11 @@ const rings = [
691
545
  };
692
546
  }
693
547
  }],
694
- [/^ring-offset-?(.*)$/, ([, d]) => {
548
+ ["ring-offset", { "--un-ring-offset-width": "1px" }],
549
+ [/^ring-offset-(.+)$/, ([, d]) => {
695
550
  const value = handler.px(d || "1");
696
- if (value) {
697
- return {
698
- "--un-ring-offset-width": value
699
- };
700
- }
551
+ if (value)
552
+ return { "--un-ring-offset-width": value };
701
553
  }],
702
554
  ["ring-inset", { "--un-ring-inset": "inset" }],
703
555
  ...ringColors,
@@ -705,7 +557,7 @@ const rings = [
705
557
  ];
706
558
 
707
559
  const colorResolver = (body, theme) => {
708
- const data = parseColorUtil(body, theme);
560
+ const data = parseColor(body, theme);
709
561
  if (!data)
710
562
  return;
711
563
  const { color, rgba } = data;
@@ -723,7 +575,7 @@ const colorResolver = (body, theme) => {
723
575
  };
724
576
  const boxShadows = [
725
577
  [/^shadow-?(.*)$/, ([, d], { theme }) => {
726
- const value = theme?.boxShadow?.[d || "DEFAULT"];
578
+ const value = theme.boxShadow?.[d || "DEFAULT"];
727
579
  if (value) {
728
580
  return {
729
581
  "--un-shadow-color": "0,0,0",
@@ -748,7 +600,7 @@ function getThemeValue(minmax, hw, theme, prop) {
748
600
  }
749
601
  const sizes = [
750
602
  [/^(?:(min|max)-)?(w|h)-(.+)$/, ([, m, w, s], { theme }) => {
751
- const v = getThemeValue(m, w, theme, s) || handler.bracket.cssvar.fraction.rem(s);
603
+ const v = getThemeValue(m, w, theme, s) || handler.bracket.cssvar.fraction.auto.rem(s);
752
604
  if (v != null)
753
605
  return { [getPropName(m, w)]: v };
754
606
  }],
@@ -821,7 +673,7 @@ const transforms = [
821
673
  ["origin-top-left", { "transform-origin": "top left" }]
822
674
  ];
823
675
  function handleTranslate([, d, b]) {
824
- const v = handler.bracket.fraction.rem(b);
676
+ const v = handler.bracket.fraction.auto.rem(b);
825
677
  if (v != null) {
826
678
  return [
827
679
  transformBase,
@@ -919,13 +771,11 @@ ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
919
771
  const textDecorations = [
920
772
  ["underline", { "text-decoration": "underline" }],
921
773
  ["line-through", { "text-decoration": "line-through" }],
922
- ["no-underline", { "text-decoration": "none" }],
923
774
  ["decoration-underline", { "text-decoration": "underline" }],
924
775
  ["decoration-line-through", { "text-decoration": "line-through" }],
925
- ["decoration-none", { "text-decoration": "none" }],
926
776
  [/^(?:underline|decoration)-(solid|double|dotted|dashed|wavy)$/, ([, d]) => ({ "text-decoration-style": d })],
927
777
  [/^(?:underline|decoration)-([^-]+)$/, ([, s]) => ({ "text-decoration-thickness": ["auto", "from-font"].includes(s) ? s : handler.bracket.px(s) })],
928
- [/^decoration-(.*)$/, ([, d]) => ({ "text-decoration-thickness": handler.bracket.px(d) })],
778
+ [/^decoration-(.+)$/, ([, d]) => ({ "text-decoration-thickness": handler.bracket.px(d) })],
929
779
  [/^underline-offset-([^-]+)$/, ([, s]) => {
930
780
  const v = s === "auto" ? s : handler.bracket.px(s);
931
781
  if (v != null)
@@ -940,12 +790,14 @@ const textDecorations = [
940
790
  };
941
791
  }
942
792
  }],
943
- [/^(?:underline|decoration)-op(?:acity)?-?(.+)$/m, ([, opacity]) => ({ "--un-line-opacity": handler.bracket.percent(opacity) })]
793
+ [/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": handler.bracket.percent(opacity) })],
794
+ ["no-underline", { "text-decoration": "none" }],
795
+ ["decoration-none", { "text-decoration": "none" }]
944
796
  ];
945
797
 
946
798
  const svgUtilities = [
947
799
  [/^fill-(.+)$/, colorResolver$1("fill", "fill")],
948
- [/^fill-op(?:acity)?-?(.+)$/m, ([, opacity]) => ({ "--un-fill-opacity": handler.bracket.percent(opacity) })],
800
+ [/^fill-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-fill-opacity": handler.bracket.percent(opacity) })],
949
801
  ["fill-none", { fill: "none" }],
950
802
  [/^stroke-(?:size-|width-)?(.+)$/, ([, s]) => {
951
803
  const v = handler.bracket.fraction.px.number(s);
@@ -953,7 +805,7 @@ const svgUtilities = [
953
805
  return { "stroke-width": v };
954
806
  }],
955
807
  [/^stroke-(.+)$/, colorResolver$1("stroke", "stroke")],
956
- [/^stroke-op(?:acity)?-?(.+)$/m, ([, opacity]) => ({ "--un-stroke-opacity": handler.bracket.percent(opacity) })],
808
+ [/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity": handler.bracket.percent(opacity) })],
957
809
  ["stroke-none", { stroke: "none" }]
958
810
  ];
959
811
 
@@ -1014,4 +866,4 @@ const rules = [
1014
866
  questionMark
1015
867
  ].flat(1);
1016
868
 
1017
- export { transitions as $, floats as A, zIndexes as B, boxSizing as C, questionMark as D, rings as E, boxShadows as F, sizes as G, aspectRatio as H, paddings as I, margins as J, cssProps as K, varEmpty as L, displays as M, appearances as N, cursors as O, pointerEvents as P, resizes as Q, userSelects as R, whitespaces as S, contents as T, breaks as U, textOverflows as V, textTransforms as W, fontStyles as X, fontSmoothings as Y, svgUtilities as Z, transforms as _, appearance as a, fonts as a0, tabSizes as a1, textIndents as a2, textStrokes as a3, textShadows as a4, cssVariables as a5, textDecorations as a6, borders as b, parseColorUtil as c, colorResolver$1 as d, opacity as e, textColors as f, bgColors as g, borderColors as h, ringColors as i, ringOffsetColors as j, flex as k, gaps as l, grids as m, overflows as n, outline as o, placeholder as p, positions as q, rules as r, justifies as s, textAligns as t, orders as u, verticalAligns as v, willChange as w, alignments as x, placements as y, insets as z };
869
+ export { textIndents as $, boxSizing as A, questionMark as B, rings as C, boxShadows as D, sizes as E, aspectRatio as F, paddings as G, margins as H, varEmpty as I, displays as J, appearances as K, cursors as L, pointerEvents as M, resizes as N, userSelects as O, whitespaces as P, contents as Q, breaks as R, textOverflows as S, textTransforms as T, fontStyles as U, fontSmoothings as V, svgUtilities as W, transforms as X, transitions as Y, fonts as Z, tabSizes as _, appearance as a, textStrokes as a0, textShadows as a1, cssVariables as a2, textDecorations as a3, borders as b, opacity as c, textColors as d, bgColors as e, borderColors as f, ringColors as g, ringOffsetColors as h, flex as i, gaps as j, grids as k, overflows as l, positions as m, justifies as n, outline as o, placeholder as p, orders as q, rules as r, alignments as s, textAligns as t, placements as u, verticalAligns as v, willChange as w, insets as x, floats as y, zIndexes as z };