@unocss/preset-mini 0.62.3 → 0.63.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.
package/dist/index.d.mts CHANGED
@@ -2,8 +2,8 @@ import * as _unocss_core from '@unocss/core';
2
2
  import { Preflight, PresetOptions, Postprocessor } from '@unocss/core';
3
3
  import { T as Theme } from './shared/preset-mini.Cde3ndkA.mjs';
4
4
  export { a as ThemeAnimation } from './shared/preset-mini.Cde3ndkA.mjs';
5
- export { t as theme } from './shared/preset-mini.Cnier7ov.mjs';
6
5
  export { colors } from './colors.mjs';
6
+ export { t as theme } from './shared/preset-mini.Cnier7ov.mjs';
7
7
  export { p as parseColor } from './shared/preset-mini.XtClvIKE.mjs';
8
8
  import '@unocss/rule-utils';
9
9
 
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@ import * as _unocss_core from '@unocss/core';
2
2
  import { Preflight, PresetOptions, Postprocessor } from '@unocss/core';
3
3
  import { T as Theme } from './shared/preset-mini.Cde3ndkA.js';
4
4
  export { a as ThemeAnimation } from './shared/preset-mini.Cde3ndkA.js';
5
- export { t as theme } from './shared/preset-mini.BooHsK52.js';
6
5
  export { colors } from './colors.js';
6
+ export { t as theme } from './shared/preset-mini.BooHsK52.js';
7
7
  export { p as parseColor } from './shared/preset-mini.DChc_8j2.js';
8
8
  import '@unocss/rule-utils';
9
9
 
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  import { entriesToCss, toArray, definePreset } from '@unocss/core';
2
2
  import { extractorArbitraryVariants } from '@unocss/extractor-arbitrary-variants';
3
- import { g as globalKeywords } from './shared/preset-mini.k49jxnhJ.mjs';
4
- export { k as parseColor } from './shared/preset-mini.k49jxnhJ.mjs';
5
- import { t as theme } from './shared/preset-mini.MvpFhrjh.mjs';
6
- import { r as rules } from './shared/preset-mini.BV8O2jOP.mjs';
7
- import { j as variants } from './shared/preset-mini.BcAMrOfV.mjs';
3
+ import { g as globalKeywords } from './shared/preset-mini.Cay6Ue29.mjs';
4
+ export { k as parseColor } from './shared/preset-mini.Cay6Ue29.mjs';
5
+ import { t as theme } from './shared/preset-mini.DyJsPAde.mjs';
6
+ import { r as rules } from './shared/preset-mini.DNbMiFEc.mjs';
7
+ import { j as variants } from './shared/preset-mini.DsZi5feL.mjs';
8
8
  export { colors } from './colors.mjs';
9
9
  import '@unocss/rule-utils';
10
- import './shared/preset-mini.DKJ8kHBp.mjs';
10
+ import './shared/preset-mini.Cw_oISCI.mjs';
11
11
 
12
12
  const preflights = [
13
13
  {
package/dist/rules.mjs CHANGED
@@ -1,5 +1,5 @@
1
- export { s as alignments, a as appearance, E as aspectRatio, e as bgColors, b as borderStyles, c as borders, B as boxSizing, f as colorScheme, g as containerParent, P as cssProperty, O as cssVariables, j as flex, x as flexGridJustifiesAlignments, z as floats, J as fonts, k as gaps, l as grids, h as handlerBorderStyle, y as insets, n as justifies, G as margins, d as opacity, q as orders, o as outline, m as overflows, F as paddings, u as placements, p as positions, C as questionMark, r as rules, D as sizes, H as svgUtilities, K as tabSizes, t as textAligns, i as textDecorations, L as textIndents, N as textShadows, M as textStrokes, I as transitions, v as verticalAligns, w as willChange, A as zIndexes } from './shared/preset-mini.BV8O2jOP.mjs';
2
- export { e as appearances, c as boxShadows, b as boxShadowsBase, k as breaks, g as contains, i as contentVisibility, j as contents, f as cursors, d as displays, o as fontSmoothings, n as fontStyles, p as pointerEvents, h as resizes, r as ringBase, a as rings, l as textOverflows, m as textTransforms, t as textWraps, q as transformBase, s as transforms, u as userSelects, v as varEmpty, w as whitespaces } from './shared/preset-mini.DKJ8kHBp.mjs';
3
- import './shared/preset-mini.k49jxnhJ.mjs';
1
+ export { s as alignments, a as appearance, E as aspectRatio, e as bgColors, b as borderStyles, c as borders, B as boxSizing, f as colorScheme, g as containerParent, P as cssProperty, O as cssVariables, j as flex, x as flexGridJustifiesAlignments, z as floats, J as fonts, k as gaps, l as grids, h as handlerBorderStyle, y as insets, n as justifies, G as margins, d as opacity, q as orders, o as outline, m as overflows, F as paddings, u as placements, p as positions, C as questionMark, r as rules, D as sizes, H as svgUtilities, K as tabSizes, t as textAligns, i as textDecorations, L as textIndents, N as textShadows, M as textStrokes, I as transitions, v as verticalAligns, w as willChange, A as zIndexes } from './shared/preset-mini.DNbMiFEc.mjs';
2
+ export { e as appearances, c as boxShadows, b as boxShadowsBase, k as breaks, g as contains, i as contentVisibility, j as contents, f as cursors, d as displays, o as fontSmoothings, n as fontStyles, p as pointerEvents, h as resizes, r as ringBase, a as rings, l as textOverflows, m as textTransforms, t as textWraps, q as transformBase, s as transforms, u as userSelects, v as varEmpty, w as whitespaces } from './shared/preset-mini.Cw_oISCI.mjs';
3
+ import './shared/preset-mini.Cay6Ue29.mjs';
4
4
  import '@unocss/core';
5
5
  import '@unocss/rule-utils';
@@ -124,7 +124,7 @@ const unitOnlyMap = {
124
124
  lvh: 100,
125
125
  lvw: 100
126
126
  };
127
- const bracketTypeRe = /^\[(color|length|size|position|quoted|string):/i;
127
+ const bracketTypeRe = /^\[(color|image|length|size|position|quoted|string):/i;
128
128
  const splitComma = /,(?![^()]*\))/g;
129
129
 
130
130
  const cssProps = [
@@ -584,4 +584,4 @@ function transformXYZ(d, v, name) {
584
584
  return values.map((v2, i) => [`--un-${name}-${xyzArray[i]}`, v2]);
585
585
  }
586
586
 
587
- export { CONTROL_MINI_NO_NEGATIVE as C, xyzArray as a, cssMathFnRE as b, cornerMap as c, directionMap as d, cssVarFnRE as e, h as f, globalKeywords as g, handler as h, insetMap as i, directionSize as j, parseColor as k, colorResolver as l, colorableShadows as m, hasParseableColor as n, resolveVerticalBreakpoints as o, positionMap as p, makeGlobalStaticRules as q, resolveBreakpoints as r, splitShorthand as s, isCSSMathFn as t, isSize as u, valueHandlers as v, transformXYZ as w, xyzMap as x };
587
+ export { CONTROL_MINI_NO_NEGATIVE as C, h as a, xyzArray as b, cornerMap as c, directionMap as d, cssMathFnRE as e, cssVarFnRE as f, globalKeywords as g, handler as h, insetMap as i, directionSize as j, parseColor as k, colorResolver as l, colorableShadows as m, hasParseableColor as n, resolveVerticalBreakpoints as o, positionMap as p, makeGlobalStaticRules as q, resolveBreakpoints as r, splitShorthand as s, isCSSMathFn as t, isSize as u, valueHandlers as v, transformXYZ as w, xyzMap as x };
@@ -1,4 +1,4 @@
1
- import { f as h, q as makeGlobalStaticRules, g as globalKeywords, l as colorResolver, t as isCSSMathFn, n as hasParseableColor, m as colorableShadows, p as positionMap, w as transformXYZ } from './preset-mini.k49jxnhJ.mjs';
1
+ import { a as h, q as makeGlobalStaticRules, g as globalKeywords, l as colorResolver, t as isCSSMathFn, n as hasParseableColor, m as colorableShadows, p as positionMap, w as transformXYZ } from './preset-mini.Cay6Ue29.mjs';
2
2
 
3
3
  const cursorValues = ["auto", "default", "none", "context-menu", "help", "pointer", "progress", "wait", "cell", "crosshair", "text", "vertical-text", "alias", "copy", "move", "no-drop", "not-allowed", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out"];
4
4
  const containValues = ["none", "strict", "content", "size", "inline-size", "layout", "style", "paint"];
@@ -1,7 +1,7 @@
1
- import { g as globalKeywords, f as h, t as isCSSMathFn, l as colorResolver, d as directionMap, n as hasParseableColor, c as cornerMap, k as parseColor, u as isSize, q as makeGlobalStaticRules, m as colorableShadows, s as splitShorthand, i as insetMap, r as resolveBreakpoints, j as directionSize } from './preset-mini.k49jxnhJ.mjs';
1
+ import { g as globalKeywords, a as h, t as isCSSMathFn, l as colorResolver, d as directionMap, n as hasParseableColor, c as cornerMap, k as parseColor, u as isSize, q as makeGlobalStaticRules, i as insetMap, r as resolveBreakpoints, j as directionSize, m as colorableShadows, s as splitShorthand } from './preset-mini.Cay6Ue29.mjs';
2
2
  import { colorToString, colorOpacityToString } from '@unocss/rule-utils';
3
3
  import { warnOnce, toArray } from '@unocss/core';
4
- import { g as contains, p as pointerEvents, e as appearances, d as displays, s as transforms, f as cursors, u as userSelects, h as resizes, l as textOverflows, w as whitespaces, k as breaks, t as textWraps, m as textTransforms, n as fontStyles, o as fontSmoothings, c as boxShadows, a as rings, i as contentVisibility, j as contents } from './preset-mini.DKJ8kHBp.mjs';
4
+ import { g as contains, p as pointerEvents, e as appearances, d as displays, s as transforms, f as cursors, u as userSelects, h as resizes, l as textOverflows, w as whitespaces, k as breaks, t as textWraps, m as textTransforms, n as fontStyles, o as fontSmoothings, c as boxShadows, a as rings, i as contentVisibility, j as contents } from './preset-mini.Cw_oISCI.mjs';
5
5
 
6
6
  const verticalAlignAlias = {
7
7
  "mid": "middle",
@@ -191,6 +191,7 @@ const bgUrlRE = /^\[url\(.+\)\]$/;
191
191
  const bgLengthRE = /^\[(?:length|size):.+\]$/;
192
192
  const bgPositionRE = /^\[position:.+\]$/;
193
193
  const bgGradientRE = /^\[(?:linear|conic|radial)-gradient\(.+\)\]$/;
194
+ const bgImageRE = /^\[image:.+\]$/;
194
195
  const bgColors = [
195
196
  [/^bg-(.+)$/, (...args) => {
196
197
  const d = args[0][1];
@@ -200,8 +201,13 @@ const bgColors = [
200
201
  return { "background-size": h.bracketOfLength(d).split(" ").map((e) => h.fraction.auto.px.cssvar(e) ?? e).join(" ") };
201
202
  if ((isSize(d) || bgPositionRE.test(d)) && h.bracketOfPosition(d) != null)
202
203
  return { "background-position": h.bracketOfPosition(d).split(" ").map((e) => h.position.fraction.auto.px.cssvar(e) ?? e).join(" ") };
203
- if (bgGradientRE.test(d))
204
- return { "background-image": h.bracket(d) };
204
+ if (bgGradientRE.test(d) || bgImageRE.test(d)) {
205
+ const s = h.bracket(d);
206
+ if (s) {
207
+ const url = s.startsWith("http") ? `url(${s})` : h.cssvar(s);
208
+ return { "background-image": url ?? s };
209
+ }
210
+ }
205
211
  return colorResolver("background-color", "bg", "backgroundColor")(...args);
206
212
  }, { autocomplete: "bg-$colors" }],
207
213
  [/^bg-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-bg-opacity": h.bracket.percent.cssvar(opacity2) }), { autocomplete: "bg-(op|opacity)-<percent>" }]
@@ -252,92 +258,6 @@ function handleColorOrWidth$1(match, ctx) {
252
258
  }
253
259
  }
254
260
 
255
- function resolveTransitionProperty(prop, theme) {
256
- let p;
257
- if (h.cssvar(prop) != null) {
258
- p = h.cssvar(prop);
259
- } else {
260
- if (prop.startsWith("[") && prop.endsWith("]")) {
261
- prop = prop.slice(1, -1);
262
- }
263
- const props = prop.split(",").map((p2) => theme.transitionProperty?.[p2] ?? h.properties(p2));
264
- if (props.every(Boolean)) {
265
- p = props.join(",");
266
- }
267
- }
268
- return p;
269
- }
270
- const transitions = [
271
- // transition
272
- [
273
- /^transition(?:-(\D+?))?(?:-(\d+))?$/,
274
- ([, prop, d], { theme }) => {
275
- if (!prop && !d) {
276
- return {
277
- "transition-property": theme.transitionProperty?.DEFAULT,
278
- "transition-timing-function": theme.easing?.DEFAULT,
279
- "transition-duration": theme.duration?.DEFAULT ?? h.time("150")
280
- };
281
- } else if (prop != null) {
282
- const p = resolveTransitionProperty(prop, theme);
283
- const duration = theme.duration?.[d || "DEFAULT"] ?? h.time(d || "150");
284
- if (p) {
285
- return {
286
- "transition-property": p,
287
- "transition-timing-function": theme.easing?.DEFAULT,
288
- "transition-duration": duration
289
- };
290
- }
291
- } else if (d != null) {
292
- return {
293
- "transition-property": theme.transitionProperty?.DEFAULT,
294
- "transition-timing-function": theme.easing?.DEFAULT,
295
- "transition-duration": theme.duration?.[d] ?? h.time(d)
296
- };
297
- }
298
- },
299
- {
300
- autocomplete: "transition-$transitionProperty-$duration"
301
- }
302
- ],
303
- // timings
304
- [
305
- /^(?:transition-)?duration-(.+)$/,
306
- ([, d], { theme }) => ({ "transition-duration": theme.duration?.[d || "DEFAULT"] ?? h.bracket.cssvar.time(d) }),
307
- { autocomplete: ["transition-duration-$duration", "duration-$duration"] }
308
- ],
309
- [
310
- /^(?:transition-)?delay-(.+)$/,
311
- ([, d], { theme }) => ({ "transition-delay": theme.duration?.[d || "DEFAULT"] ?? h.bracket.cssvar.time(d) }),
312
- { autocomplete: ["transition-delay-$duration", "delay-$duration"] }
313
- ],
314
- [
315
- /^(?:transition-)?ease(?:-(.+))?$/,
316
- ([, d], { theme }) => ({ "transition-timing-function": theme.easing?.[d || "DEFAULT"] ?? h.bracket.cssvar(d) }),
317
- { autocomplete: ["transition-ease-(linear|in|out|in-out|DEFAULT)", "ease-(linear|in|out|in-out|DEFAULT)"] }
318
- ],
319
- // props
320
- [
321
- /^(?:transition-)?property-(.+)$/,
322
- ([, v], { theme }) => {
323
- const p = h.global(v) || resolveTransitionProperty(v, theme);
324
- if (p)
325
- return { "transition-property": p };
326
- },
327
- { autocomplete: [
328
- `transition-property-(${[...globalKeywords].join("|")})`,
329
- "transition-property-$transitionProperty",
330
- "property-$transitionProperty"
331
- ] }
332
- ],
333
- // none
334
- ["transition-none", { transition: "none" }],
335
- ...makeGlobalStaticRules("transition"),
336
- // behavior
337
- ["transition-discrete", { "transition-behavior": "allow-discrete" }],
338
- ["transition-normal", { "transition-behavior": "normal" }]
339
- ];
340
-
341
261
  const flex = [
342
262
  // display
343
263
  ["flex", { display: "flex" }],
@@ -364,158 +284,6 @@ const flex = [
364
284
  ["flex-nowrap", { "flex-wrap": "nowrap" }]
365
285
  ];
366
286
 
367
- const fonts = [
368
- // text
369
- [/^text-(.+)$/, handleText, { autocomplete: "text-$fontSize" }],
370
- // text size
371
- [/^(?:text|font)-size-(.+)$/, handleSize, { autocomplete: "text-size-$fontSize" }],
372
- // text colors
373
- [/^text-(?:color-)?(.+)$/, handlerColorOrSize, { autocomplete: "text-$colors" }],
374
- // colors
375
- [/^(?:color|c)-(.+)$/, colorResolver("color", "text", "textColor"), { autocomplete: "(color|c)-$colors" }],
376
- // style
377
- [/^(?:text|color|c)-(.+)$/, ([, v]) => globalKeywords.includes(v) ? { color: v } : void 0, { autocomplete: `(text|color|c)-(${globalKeywords.join("|")})` }],
378
- // opacity
379
- [/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "(text|color|c)-(op|opacity)-<percent>" }],
380
- // weights
381
- [
382
- /^(?:font|fw)-?([^-]+)$/,
383
- ([, s], { theme }) => ({ "font-weight": theme.fontWeight?.[s] || h.bracket.global.number(s) }),
384
- {
385
- autocomplete: [
386
- "(font|fw)-(100|200|300|400|500|600|700|800|900)",
387
- "(font|fw)-$fontWeight"
388
- ]
389
- }
390
- ],
391
- // leadings
392
- [
393
- /^(?:font-)?(?:leading|lh|line-height)-(.+)$/,
394
- ([, s], { theme }) => ({ "line-height": handleThemeByKey(s, theme, "lineHeight") }),
395
- { autocomplete: "(leading|lh|line-height)-$lineHeight" }
396
- ],
397
- // synthesis
398
- ["font-synthesis-weight", { "font-synthesis": "weight" }],
399
- ["font-synthesis-style", { "font-synthesis": "style" }],
400
- ["font-synthesis-small-caps", { "font-synthesis": "small-caps" }],
401
- ["font-synthesis-none", { "font-synthesis": "none" }],
402
- [/^font-synthesis-(.+)$/, ([, s]) => ({ "font-synthesis": h.bracket.cssvar.global(s) })],
403
- // tracking
404
- [
405
- /^(?:font-)?tracking-(.+)$/,
406
- ([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || h.bracket.cssvar.global.rem(s) }),
407
- { autocomplete: "tracking-$letterSpacing" }
408
- ],
409
- // word-spacing
410
- [
411
- /^(?:font-)?word-spacing-(.+)$/,
412
- ([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] || h.bracket.cssvar.global.rem(s) }),
413
- { autocomplete: "word-spacing-$wordSpacing" }
414
- ],
415
- // stretch
416
- ["font-stretch-normal", { "font-stretch": "normal" }],
417
- ["font-stretch-ultra-condensed", { "font-stretch": "ultra-condensed" }],
418
- ["font-stretch-extra-condensed", { "font-stretch": "extra-condensed" }],
419
- ["font-stretch-condensed", { "font-stretch": "condensed" }],
420
- ["font-stretch-semi-condensed", { "font-stretch": "semi-condensed" }],
421
- ["font-stretch-semi-expanded", { "font-stretch": "semi-expanded" }],
422
- ["font-stretch-expanded", { "font-stretch": "expanded" }],
423
- ["font-stretch-extra-expanded", { "font-stretch": "extra-expanded" }],
424
- ["font-stretch-ultra-expanded", { "font-stretch": "ultra-expanded" }],
425
- [
426
- /^font-stretch-(.+)$/,
427
- ([, s]) => ({ "font-stretch": h.bracket.cssvar.fraction.global(s) }),
428
- { autocomplete: "font-stretch-<percentage>" }
429
- ],
430
- // family
431
- [
432
- /^font-(.+)$/,
433
- ([, d], { theme }) => ({ "font-family": theme.fontFamily?.[d] || h.bracket.cssvar.global(d) }),
434
- { autocomplete: "font-$fontFamily" }
435
- ]
436
- ];
437
- const tabSizes = [
438
- [/^tab(?:-(.+))?$/, ([, s]) => {
439
- const v = h.bracket.cssvar.global.number(s || "4");
440
- if (v != null) {
441
- return {
442
- "-moz-tab-size": v,
443
- "-o-tab-size": v,
444
- "tab-size": v
445
- };
446
- }
447
- }]
448
- ];
449
- const textIndents = [
450
- [/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] || h.bracket.cssvar.global.fraction.rem(s) }), { autocomplete: "indent-$textIndent" }]
451
- ];
452
- const textStrokes = [
453
- // widths
454
- [/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => ({ "-webkit-text-stroke-width": theme.textStrokeWidth?.[s || "DEFAULT"] || h.bracket.cssvar.px(s) }), { autocomplete: "text-stroke-$textStrokeWidth" }],
455
- // colors
456
- [/^text-stroke-(.+)$/, colorResolver("-webkit-text-stroke-color", "text-stroke", "borderColor"), { autocomplete: "text-stroke-$colors" }],
457
- [/^text-stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-stroke-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "text-stroke-(op|opacity)-<percent>" }]
458
- ];
459
- const textShadows = [
460
- [/^text-shadow(?:-(.+))?$/, ([, s], { theme }) => {
461
- const v = theme.textShadow?.[s || "DEFAULT"];
462
- if (v != null) {
463
- return {
464
- "--un-text-shadow": colorableShadows(v, "--un-text-shadow-color").join(","),
465
- "text-shadow": "var(--un-text-shadow)"
466
- };
467
- }
468
- return { "text-shadow": h.bracket.cssvar.global(s) };
469
- }, { autocomplete: "text-shadow-$textShadow" }],
470
- // colors
471
- [/^text-shadow-color-(.+)$/, colorResolver("--un-text-shadow-color", "text-shadow", "shadowColor"), { autocomplete: "text-shadow-color-$colors" }],
472
- [/^text-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-shadow-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "text-shadow-color-(op|opacity)-<percent>" }]
473
- ];
474
- function handleThemeByKey(s, theme, key) {
475
- return theme[key]?.[s] || h.bracket.cssvar.global.rem(s);
476
- }
477
- function handleSize([, s], { theme }) {
478
- const themed = toArray(theme.fontSize?.[s]);
479
- const size = themed?.[0] ?? h.bracket.cssvar.global.rem(s);
480
- if (size != null)
481
- return { "font-size": size };
482
- }
483
- function handlerColorOrSize(match, ctx) {
484
- if (isCSSMathFn(h.bracket(match[1])))
485
- return handleSize(match, ctx);
486
- return colorResolver("color", "text", "textColor")(match, ctx);
487
- }
488
- function handleText([, s = "base"], { theme }) {
489
- const split = splitShorthand(s, "length");
490
- if (!split)
491
- return;
492
- const [size, leading] = split;
493
- const sizePairs = toArray(theme.fontSize?.[size]);
494
- const lineHeight = leading ? handleThemeByKey(leading, theme, "lineHeight") : void 0;
495
- if (sizePairs?.[0]) {
496
- const [fontSize2, height, letterSpacing] = sizePairs;
497
- if (typeof height === "object") {
498
- return {
499
- "font-size": fontSize2,
500
- ...height
501
- };
502
- }
503
- return {
504
- "font-size": fontSize2,
505
- "line-height": lineHeight ?? height ?? "1",
506
- "letter-spacing": letterSpacing ? handleThemeByKey(letterSpacing, theme, "letterSpacing") : void 0
507
- };
508
- }
509
- const fontSize = h.bracketOfLength.rem(size);
510
- if (lineHeight && fontSize) {
511
- return {
512
- "font-size": fontSize,
513
- "line-height": lineHeight
514
- };
515
- }
516
- return { "font-size": h.bracketOfLength.rem(s) };
517
- }
518
-
519
287
  const directions = {
520
288
  "": "",
521
289
  "x": "column-",
@@ -767,6 +535,16 @@ const boxSizing = [
767
535
  ...makeGlobalStaticRules("box", "box-sizing")
768
536
  ];
769
537
 
538
+ const questionMark = [
539
+ [
540
+ /^(where|\?)$/,
541
+ (_, { constructCSS, generator }) => {
542
+ if (generator.userConfig.envMode === "dev")
543
+ 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}} ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
544
+ }
545
+ ]
546
+ ];
547
+
770
548
  const sizeMapping = {
771
549
  h: "height",
772
550
  w: "width",
@@ -851,12 +629,285 @@ const margins = [
851
629
  [/^m-?([bi][se])(?:-?(.+))?$/, directionSize("margin")]
852
630
  ];
853
631
 
854
- const variablesAbbrMap = {
855
- backface: "backface-visibility",
856
- break: "word-break",
857
- case: "text-transform",
858
- content: "align-content",
859
- fw: "font-weight",
632
+ const svgUtilities = [
633
+ // fills
634
+ [/^fill-(.+)$/, colorResolver("fill", "fill", "backgroundColor"), { autocomplete: "fill-$colors" }],
635
+ [/^fill-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-fill-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "fill-(op|opacity)-<percent>" }],
636
+ ["fill-none", { fill: "none" }],
637
+ // stroke size
638
+ [/^stroke-(?:width-|size-)?(.+)$/, handleWidth, { autocomplete: ["stroke-width-$lineWidth", "stroke-size-$lineWidth"] }],
639
+ // stroke dash
640
+ [/^stroke-dash-(.+)$/, ([, s]) => ({ "stroke-dasharray": h.bracket.cssvar.number(s) }), { autocomplete: "stroke-dash-<num>" }],
641
+ [/^stroke-offset-(.+)$/, ([, s], { theme }) => ({ "stroke-dashoffset": theme.lineWidth?.[s] ?? h.bracket.cssvar.px.numberWithUnit(s) }), { autocomplete: "stroke-offset-$lineWidth" }],
642
+ // stroke colors
643
+ [/^stroke-(.+)$/, handleColorOrWidth, { autocomplete: "stroke-$colors" }],
644
+ [/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "stroke-(op|opacity)-<percent>" }],
645
+ // line cap
646
+ ["stroke-cap-square", { "stroke-linecap": "square" }],
647
+ ["stroke-cap-round", { "stroke-linecap": "round" }],
648
+ ["stroke-cap-auto", { "stroke-linecap": "butt" }],
649
+ // line join
650
+ ["stroke-join-arcs", { "stroke-linejoin": "arcs" }],
651
+ ["stroke-join-bevel", { "stroke-linejoin": "bevel" }],
652
+ ["stroke-join-clip", { "stroke-linejoin": "miter-clip" }],
653
+ ["stroke-join-round", { "stroke-linejoin": "round" }],
654
+ ["stroke-join-auto", { "stroke-linejoin": "miter" }],
655
+ // none
656
+ ["stroke-none", { stroke: "none" }]
657
+ ];
658
+ function handleWidth([, b], { theme }) {
659
+ return { "stroke-width": theme.lineWidth?.[b] ?? h.bracket.cssvar.fraction.px.number(b) };
660
+ }
661
+ function handleColorOrWidth(match, ctx) {
662
+ if (isCSSMathFn(h.bracket(match[1])))
663
+ return handleWidth(match, ctx);
664
+ return colorResolver("stroke", "stroke", "borderColor")(match, ctx);
665
+ }
666
+
667
+ function resolveTransitionProperty(prop, theme) {
668
+ let p;
669
+ if (h.cssvar(prop) != null) {
670
+ p = h.cssvar(prop);
671
+ } else {
672
+ if (prop.startsWith("[") && prop.endsWith("]")) {
673
+ prop = prop.slice(1, -1);
674
+ }
675
+ const props = prop.split(",").map((p2) => theme.transitionProperty?.[p2] ?? h.properties(p2));
676
+ if (props.every(Boolean)) {
677
+ p = props.join(",");
678
+ }
679
+ }
680
+ return p;
681
+ }
682
+ const transitions = [
683
+ // transition
684
+ [
685
+ /^transition(?:-(\D+?))?(?:-(\d+))?$/,
686
+ ([, prop, d], { theme }) => {
687
+ if (!prop && !d) {
688
+ return {
689
+ "transition-property": theme.transitionProperty?.DEFAULT,
690
+ "transition-timing-function": theme.easing?.DEFAULT,
691
+ "transition-duration": theme.duration?.DEFAULT ?? h.time("150")
692
+ };
693
+ } else if (prop != null) {
694
+ const p = resolveTransitionProperty(prop, theme);
695
+ const duration = theme.duration?.[d || "DEFAULT"] ?? h.time(d || "150");
696
+ if (p) {
697
+ return {
698
+ "transition-property": p,
699
+ "transition-timing-function": theme.easing?.DEFAULT,
700
+ "transition-duration": duration
701
+ };
702
+ }
703
+ } else if (d != null) {
704
+ return {
705
+ "transition-property": theme.transitionProperty?.DEFAULT,
706
+ "transition-timing-function": theme.easing?.DEFAULT,
707
+ "transition-duration": theme.duration?.[d] ?? h.time(d)
708
+ };
709
+ }
710
+ },
711
+ {
712
+ autocomplete: "transition-$transitionProperty-$duration"
713
+ }
714
+ ],
715
+ // timings
716
+ [
717
+ /^(?:transition-)?duration-(.+)$/,
718
+ ([, d], { theme }) => ({ "transition-duration": theme.duration?.[d || "DEFAULT"] ?? h.bracket.cssvar.time(d) }),
719
+ { autocomplete: ["transition-duration-$duration", "duration-$duration"] }
720
+ ],
721
+ [
722
+ /^(?:transition-)?delay-(.+)$/,
723
+ ([, d], { theme }) => ({ "transition-delay": theme.duration?.[d || "DEFAULT"] ?? h.bracket.cssvar.time(d) }),
724
+ { autocomplete: ["transition-delay-$duration", "delay-$duration"] }
725
+ ],
726
+ [
727
+ /^(?:transition-)?ease(?:-(.+))?$/,
728
+ ([, d], { theme }) => ({ "transition-timing-function": theme.easing?.[d || "DEFAULT"] ?? h.bracket.cssvar(d) }),
729
+ { autocomplete: ["transition-ease-(linear|in|out|in-out|DEFAULT)", "ease-(linear|in|out|in-out|DEFAULT)"] }
730
+ ],
731
+ // props
732
+ [
733
+ /^(?:transition-)?property-(.+)$/,
734
+ ([, v], { theme }) => {
735
+ const p = h.global(v) || resolveTransitionProperty(v, theme);
736
+ if (p)
737
+ return { "transition-property": p };
738
+ },
739
+ { autocomplete: [
740
+ `transition-property-(${[...globalKeywords].join("|")})`,
741
+ "transition-property-$transitionProperty",
742
+ "property-$transitionProperty"
743
+ ] }
744
+ ],
745
+ // none
746
+ ["transition-none", { transition: "none" }],
747
+ ...makeGlobalStaticRules("transition"),
748
+ // behavior
749
+ ["transition-discrete", { "transition-behavior": "allow-discrete" }],
750
+ ["transition-normal", { "transition-behavior": "normal" }]
751
+ ];
752
+
753
+ const fonts = [
754
+ // text
755
+ [/^text-(.+)$/, handleText, { autocomplete: "text-$fontSize" }],
756
+ // text size
757
+ [/^(?:text|font)-size-(.+)$/, handleSize, { autocomplete: "text-size-$fontSize" }],
758
+ // text colors
759
+ [/^text-(?:color-)?(.+)$/, handlerColorOrSize, { autocomplete: "text-$colors" }],
760
+ // colors
761
+ [/^(?:color|c)-(.+)$/, colorResolver("color", "text", "textColor"), { autocomplete: "(color|c)-$colors" }],
762
+ // style
763
+ [/^(?:text|color|c)-(.+)$/, ([, v]) => globalKeywords.includes(v) ? { color: v } : void 0, { autocomplete: `(text|color|c)-(${globalKeywords.join("|")})` }],
764
+ // opacity
765
+ [/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "(text|color|c)-(op|opacity)-<percent>" }],
766
+ // weights
767
+ [
768
+ /^(?:font|fw)-?([^-]+)$/,
769
+ ([, s], { theme }) => ({ "font-weight": theme.fontWeight?.[s] || h.bracket.global.number(s) }),
770
+ {
771
+ autocomplete: [
772
+ "(font|fw)-(100|200|300|400|500|600|700|800|900)",
773
+ "(font|fw)-$fontWeight"
774
+ ]
775
+ }
776
+ ],
777
+ // leadings
778
+ [
779
+ /^(?:font-)?(?:leading|lh|line-height)-(.+)$/,
780
+ ([, s], { theme }) => ({ "line-height": handleThemeByKey(s, theme, "lineHeight") }),
781
+ { autocomplete: "(leading|lh|line-height)-$lineHeight" }
782
+ ],
783
+ // synthesis
784
+ ["font-synthesis-weight", { "font-synthesis": "weight" }],
785
+ ["font-synthesis-style", { "font-synthesis": "style" }],
786
+ ["font-synthesis-small-caps", { "font-synthesis": "small-caps" }],
787
+ ["font-synthesis-none", { "font-synthesis": "none" }],
788
+ [/^font-synthesis-(.+)$/, ([, s]) => ({ "font-synthesis": h.bracket.cssvar.global(s) })],
789
+ // tracking
790
+ [
791
+ /^(?:font-)?tracking-(.+)$/,
792
+ ([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || h.bracket.cssvar.global.rem(s) }),
793
+ { autocomplete: "tracking-$letterSpacing" }
794
+ ],
795
+ // word-spacing
796
+ [
797
+ /^(?:font-)?word-spacing-(.+)$/,
798
+ ([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] || h.bracket.cssvar.global.rem(s) }),
799
+ { autocomplete: "word-spacing-$wordSpacing" }
800
+ ],
801
+ // stretch
802
+ ["font-stretch-normal", { "font-stretch": "normal" }],
803
+ ["font-stretch-ultra-condensed", { "font-stretch": "ultra-condensed" }],
804
+ ["font-stretch-extra-condensed", { "font-stretch": "extra-condensed" }],
805
+ ["font-stretch-condensed", { "font-stretch": "condensed" }],
806
+ ["font-stretch-semi-condensed", { "font-stretch": "semi-condensed" }],
807
+ ["font-stretch-semi-expanded", { "font-stretch": "semi-expanded" }],
808
+ ["font-stretch-expanded", { "font-stretch": "expanded" }],
809
+ ["font-stretch-extra-expanded", { "font-stretch": "extra-expanded" }],
810
+ ["font-stretch-ultra-expanded", { "font-stretch": "ultra-expanded" }],
811
+ [
812
+ /^font-stretch-(.+)$/,
813
+ ([, s]) => ({ "font-stretch": h.bracket.cssvar.fraction.global(s) }),
814
+ { autocomplete: "font-stretch-<percentage>" }
815
+ ],
816
+ // family
817
+ [
818
+ /^font-(.+)$/,
819
+ ([, d], { theme }) => ({ "font-family": theme.fontFamily?.[d] || h.bracket.cssvar.global(d) }),
820
+ { autocomplete: "font-$fontFamily" }
821
+ ]
822
+ ];
823
+ const tabSizes = [
824
+ [/^tab(?:-(.+))?$/, ([, s]) => {
825
+ const v = h.bracket.cssvar.global.number(s || "4");
826
+ if (v != null) {
827
+ return {
828
+ "-moz-tab-size": v,
829
+ "-o-tab-size": v,
830
+ "tab-size": v
831
+ };
832
+ }
833
+ }]
834
+ ];
835
+ const textIndents = [
836
+ [/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] || h.bracket.cssvar.global.fraction.rem(s) }), { autocomplete: "indent-$textIndent" }]
837
+ ];
838
+ const textStrokes = [
839
+ // widths
840
+ [/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => ({ "-webkit-text-stroke-width": theme.textStrokeWidth?.[s || "DEFAULT"] || h.bracket.cssvar.px(s) }), { autocomplete: "text-stroke-$textStrokeWidth" }],
841
+ // colors
842
+ [/^text-stroke-(.+)$/, colorResolver("-webkit-text-stroke-color", "text-stroke", "borderColor"), { autocomplete: "text-stroke-$colors" }],
843
+ [/^text-stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-stroke-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "text-stroke-(op|opacity)-<percent>" }]
844
+ ];
845
+ const textShadows = [
846
+ [/^text-shadow(?:-(.+))?$/, ([, s], { theme }) => {
847
+ const v = theme.textShadow?.[s || "DEFAULT"];
848
+ if (v != null) {
849
+ return {
850
+ "--un-text-shadow": colorableShadows(v, "--un-text-shadow-color").join(","),
851
+ "text-shadow": "var(--un-text-shadow)"
852
+ };
853
+ }
854
+ return { "text-shadow": h.bracket.cssvar.global(s) };
855
+ }, { autocomplete: "text-shadow-$textShadow" }],
856
+ // colors
857
+ [/^text-shadow-color-(.+)$/, colorResolver("--un-text-shadow-color", "text-shadow", "shadowColor"), { autocomplete: "text-shadow-color-$colors" }],
858
+ [/^text-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-shadow-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "text-shadow-color-(op|opacity)-<percent>" }]
859
+ ];
860
+ function handleThemeByKey(s, theme, key) {
861
+ return theme[key]?.[s] || h.bracket.cssvar.global.rem(s);
862
+ }
863
+ function handleSize([, s], { theme }) {
864
+ const themed = toArray(theme.fontSize?.[s]);
865
+ const size = themed?.[0] ?? h.bracket.cssvar.global.rem(s);
866
+ if (size != null)
867
+ return { "font-size": size };
868
+ }
869
+ function handlerColorOrSize(match, ctx) {
870
+ if (isCSSMathFn(h.bracket(match[1])))
871
+ return handleSize(match, ctx);
872
+ return colorResolver("color", "text", "textColor")(match, ctx);
873
+ }
874
+ function handleText([, s = "base"], { theme }) {
875
+ const split = splitShorthand(s, "length");
876
+ if (!split)
877
+ return;
878
+ const [size, leading] = split;
879
+ const sizePairs = toArray(theme.fontSize?.[size]);
880
+ const lineHeight = leading ? handleThemeByKey(leading, theme, "lineHeight") : void 0;
881
+ if (sizePairs?.[0]) {
882
+ const [fontSize2, height, letterSpacing] = sizePairs;
883
+ if (typeof height === "object") {
884
+ return {
885
+ "font-size": fontSize2,
886
+ ...height
887
+ };
888
+ }
889
+ return {
890
+ "font-size": fontSize2,
891
+ "line-height": lineHeight ?? height ?? "1",
892
+ "letter-spacing": letterSpacing ? handleThemeByKey(letterSpacing, theme, "letterSpacing") : void 0
893
+ };
894
+ }
895
+ const fontSize = h.bracketOfLength.rem(size);
896
+ if (lineHeight && fontSize) {
897
+ return {
898
+ "font-size": fontSize,
899
+ "line-height": lineHeight
900
+ };
901
+ }
902
+ return { "font-size": h.bracketOfLength.rem(s) };
903
+ }
904
+
905
+ const variablesAbbrMap = {
906
+ backface: "backface-visibility",
907
+ break: "word-break",
908
+ case: "text-transform",
909
+ content: "align-content",
910
+ fw: "font-weight",
860
911
  items: "align-items",
861
912
  justify: "justify-content",
862
913
  select: "user-select",
@@ -921,51 +972,6 @@ function isURI(declaration) {
921
972
  }
922
973
  }
923
974
 
924
- const questionMark = [
925
- [
926
- /^(where|\?)$/,
927
- (_, { constructCSS, generator }) => {
928
- if (generator.userConfig.envMode === "dev")
929
- 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}} ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
930
- }
931
- ]
932
- ];
933
-
934
- const svgUtilities = [
935
- // fills
936
- [/^fill-(.+)$/, colorResolver("fill", "fill", "backgroundColor"), { autocomplete: "fill-$colors" }],
937
- [/^fill-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-fill-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "fill-(op|opacity)-<percent>" }],
938
- ["fill-none", { fill: "none" }],
939
- // stroke size
940
- [/^stroke-(?:width-|size-)?(.+)$/, handleWidth, { autocomplete: ["stroke-width-$lineWidth", "stroke-size-$lineWidth"] }],
941
- // stroke dash
942
- [/^stroke-dash-(.+)$/, ([, s]) => ({ "stroke-dasharray": h.bracket.cssvar.number(s) }), { autocomplete: "stroke-dash-<num>" }],
943
- [/^stroke-offset-(.+)$/, ([, s], { theme }) => ({ "stroke-dashoffset": theme.lineWidth?.[s] ?? h.bracket.cssvar.px.numberWithUnit(s) }), { autocomplete: "stroke-offset-$lineWidth" }],
944
- // stroke colors
945
- [/^stroke-(.+)$/, handleColorOrWidth, { autocomplete: "stroke-$colors" }],
946
- [/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "stroke-(op|opacity)-<percent>" }],
947
- // line cap
948
- ["stroke-cap-square", { "stroke-linecap": "square" }],
949
- ["stroke-cap-round", { "stroke-linecap": "round" }],
950
- ["stroke-cap-auto", { "stroke-linecap": "butt" }],
951
- // line join
952
- ["stroke-join-arcs", { "stroke-linejoin": "arcs" }],
953
- ["stroke-join-bevel", { "stroke-linejoin": "bevel" }],
954
- ["stroke-join-clip", { "stroke-linejoin": "miter-clip" }],
955
- ["stroke-join-round", { "stroke-linejoin": "round" }],
956
- ["stroke-join-auto", { "stroke-linejoin": "miter" }],
957
- // none
958
- ["stroke-none", { stroke: "none" }]
959
- ];
960
- function handleWidth([, b], { theme }) {
961
- return { "stroke-width": theme.lineWidth?.[b] ?? h.bracket.cssvar.fraction.px.number(b) };
962
- }
963
- function handleColorOrWidth(match, ctx) {
964
- if (isCSSMathFn(h.bracket(match[1])))
965
- return handleWidth(match, ctx);
966
- return colorResolver("stroke", "stroke", "borderColor")(match, ctx);
967
- }
968
-
969
975
  const rules = [
970
976
  cssVariables,
971
977
  cssProperty,
@@ -1,5 +1,5 @@
1
- import { f as h, r as resolveBreakpoints, C as CONTROL_MINI_NO_NEGATIVE, b as cssMathFnRE, e as cssVarFnRE } from './preset-mini.k49jxnhJ.mjs';
2
1
  import { variantGetParameter, variantMatcher, variantGetBracket, variantParentMatcher, getBracket, hasThemeFn, transformThemeFn, getStringComponent } from '@unocss/rule-utils';
2
+ import { a as h, r as resolveBreakpoints, C as CONTROL_MINI_NO_NEGATIVE, e as cssMathFnRE, f as cssVarFnRE } from './preset-mini.Cay6Ue29.mjs';
3
3
  import { warnOnce, escapeRegExp, escapeSelector } from '@unocss/core';
4
4
 
5
5
  const variantAria = {
@@ -233,11 +233,11 @@ function taggedData(tagName) {
233
233
  match(matcher, ctx) {
234
234
  const variant = variantGetParameter(`${tagName}-data-`, matcher, ctx.generator.config.separators);
235
235
  if (variant) {
236
- const [match, rest] = variant;
236
+ const [match, rest, label] = variant;
237
237
  const dataAttribute = h.bracket(match) ?? ctx.theme.data?.[match] ?? "";
238
238
  if (dataAttribute) {
239
239
  return {
240
- matcher: `${tagName}-[[data-${dataAttribute}]]:${rest}`
240
+ matcher: `${tagName}-[[data-${dataAttribute}]]${label ? `/${label}` : ""}:${rest}`
241
241
  };
242
242
  }
243
243
  }
@@ -256,6 +256,59 @@ const variantLanguageDirections = [
256
256
  variantMatcher("ltr", (input) => ({ prefix: `[dir="ltr"] $$ ${input.prefix}` }))
257
257
  ];
258
258
 
259
+ function variantImportant() {
260
+ let re;
261
+ return {
262
+ name: "important",
263
+ match(matcher, ctx) {
264
+ if (!re)
265
+ re = new RegExp(`^(important(?:${ctx.generator.config.separators.join("|")})|!)`);
266
+ let base;
267
+ const match = matcher.match(re);
268
+ if (match)
269
+ base = matcher.slice(match[0].length);
270
+ else if (matcher.endsWith("!"))
271
+ base = matcher.slice(0, -1);
272
+ if (base) {
273
+ return {
274
+ matcher: base,
275
+ body: (body) => {
276
+ body.forEach((v) => {
277
+ if (v[1] != null)
278
+ v[1] += " !important";
279
+ });
280
+ return body;
281
+ }
282
+ };
283
+ }
284
+ }
285
+ };
286
+ }
287
+
288
+ const variantPrint = variantParentMatcher("print", "@media print");
289
+ const variantCustomMedia = {
290
+ name: "media",
291
+ match(matcher, ctx) {
292
+ const variant = variantGetParameter("media-", matcher, ctx.generator.config.separators);
293
+ if (variant) {
294
+ const [match, rest] = variant;
295
+ let media = h.bracket(match) ?? "";
296
+ if (media === "")
297
+ media = ctx.theme.media?.[match] ?? "";
298
+ if (media) {
299
+ return {
300
+ matcher: rest,
301
+ handle: (input, next) => next({
302
+ ...input,
303
+ parent: `${input.parent ? `${input.parent} $$ ` : ""}@media ${media}`
304
+ })
305
+ };
306
+ }
307
+ }
308
+ },
309
+ multiPass: true
310
+ };
311
+
259
312
  const variantSelector = {
260
313
  name: "selector",
261
314
  match(matcher, ctx) {
@@ -445,82 +498,6 @@ const variantNegative = {
445
498
  }
446
499
  };
447
500
 
448
- function variantImportant() {
449
- let re;
450
- return {
451
- name: "important",
452
- match(matcher, ctx) {
453
- if (!re)
454
- re = new RegExp(`^(important(?:${ctx.generator.config.separators.join("|")})|!)`);
455
- let base;
456
- const match = matcher.match(re);
457
- if (match)
458
- base = matcher.slice(match[0].length);
459
- else if (matcher.endsWith("!"))
460
- base = matcher.slice(0, -1);
461
- if (base) {
462
- return {
463
- matcher: base,
464
- body: (body) => {
465
- body.forEach((v) => {
466
- if (v[1] != null)
467
- v[1] += " !important";
468
- });
469
- return body;
470
- }
471
- };
472
- }
473
- }
474
- };
475
- }
476
-
477
- const variantPrint = variantParentMatcher("print", "@media print");
478
- const variantCustomMedia = {
479
- name: "media",
480
- match(matcher, ctx) {
481
- const variant = variantGetParameter("media-", matcher, ctx.generator.config.separators);
482
- if (variant) {
483
- const [match, rest] = variant;
484
- let media = h.bracket(match) ?? "";
485
- if (media === "")
486
- media = ctx.theme.media?.[match] ?? "";
487
- if (media) {
488
- return {
489
- matcher: rest,
490
- handle: (input, next) => next({
491
- ...input,
492
- parent: `${input.parent ? `${input.parent} $$ ` : ""}@media ${media}`
493
- })
494
- };
495
- }
496
- }
497
- },
498
- multiPass: true
499
- };
500
-
501
- const variantSupports = {
502
- name: "supports",
503
- match(matcher, ctx) {
504
- const variant = variantGetParameter("supports-", matcher, ctx.generator.config.separators);
505
- if (variant) {
506
- const [match, rest] = variant;
507
- let supports = h.bracket(match) ?? "";
508
- if (supports === "")
509
- supports = ctx.theme.supports?.[match] ?? "";
510
- if (supports) {
511
- return {
512
- matcher: rest,
513
- handle: (input, next) => next({
514
- ...input,
515
- parent: `${input.parent ? `${input.parent} $$ ` : ""}@supports ${supports}`
516
- })
517
- };
518
- }
519
- }
520
- },
521
- multiPass: true
522
- };
523
-
524
501
  const PseudoClasses = Object.fromEntries([
525
502
  // pseudo elements part 1
526
503
  ["first-letter", "::first-letter"],
@@ -798,6 +775,29 @@ const variantStartingStyle = {
798
775
  }
799
776
  };
800
777
 
778
+ const variantSupports = {
779
+ name: "supports",
780
+ match(matcher, ctx) {
781
+ const variant = variantGetParameter("supports-", matcher, ctx.generator.config.separators);
782
+ if (variant) {
783
+ const [match, rest] = variant;
784
+ let supports = h.bracket(match) ?? "";
785
+ if (supports === "")
786
+ supports = ctx.theme.supports?.[match] ?? "";
787
+ if (supports) {
788
+ return {
789
+ matcher: rest,
790
+ handle: (input, next) => next({
791
+ ...input,
792
+ parent: `${input.parent ? `${input.parent} $$ ` : ""}@supports ${supports}`
793
+ })
794
+ };
795
+ }
796
+ }
797
+ },
798
+ multiPass: true
799
+ };
800
+
801
801
  function variants(options) {
802
802
  return [
803
803
  variantAria,
@@ -829,4 +829,4 @@ function variants(options) {
829
829
  ];
830
830
  }
831
831
 
832
- export { variantSupports as A, variantStartingStyle as B, variantTaggedAriaAttributes as a, variantBreakpoints as b, calcMaxWidthBySize as c, variantChildren as d, variantCombinators as e, variantContainerQuery as f, variantColorsMediaOrClass as g, variantDataAttribute as h, variantTaggedDataAttributes as i, variants as j, variantLanguageDirections as k, variantImportant as l, variantPrint as m, variantCustomMedia as n, variantSelector as o, variantCssLayer as p, variantInternalLayer as q, variantScope as r, variantVariables as s, variantTheme as t, variantNegative as u, variantAria as v, variantPseudoClassesAndElements as w, variantPseudoClassFunctions as x, variantTaggedPseudoClasses as y, variantPartClasses as z };
832
+ export { variantStartingStyle as A, variantSupports as B, variantTaggedAriaAttributes as a, variantBreakpoints as b, calcMaxWidthBySize as c, variantChildren as d, variantCombinators as e, variantContainerQuery as f, variantColorsMediaOrClass as g, variantDataAttribute as h, variantTaggedDataAttributes as i, variants as j, variantLanguageDirections as k, variantImportant as l, variantPrint as m, variantCustomMedia as n, variantSelector as o, variantCssLayer as p, variantInternalLayer as q, variantScope as r, variantVariables as s, variantTheme as t, variantNegative as u, variantAria as v, variantPseudoClassesAndElements as w, variantPseudoClassFunctions as x, variantTaggedPseudoClasses as y, variantPartClasses as z };
@@ -1,5 +1,25 @@
1
1
  import { colors } from '../colors.mjs';
2
- import { q as transformBase, b as boxShadowsBase, r as ringBase } from './preset-mini.DKJ8kHBp.mjs';
2
+ import { q as transformBase, b as boxShadowsBase, r as ringBase } from './preset-mini.Cw_oISCI.mjs';
3
+
4
+ const blur = {
5
+ "DEFAULT": "8px",
6
+ "0": "0",
7
+ "sm": "4px",
8
+ "md": "12px",
9
+ "lg": "16px",
10
+ "xl": "24px",
11
+ "2xl": "40px",
12
+ "3xl": "64px"
13
+ };
14
+ const dropShadow = {
15
+ "DEFAULT": ["0 1px 2px rgb(0 0 0 / 0.1)", "0 1px 1px rgb(0 0 0 / 0.06)"],
16
+ "sm": "0 1px 1px rgb(0 0 0 / 0.05)",
17
+ "md": ["0 4px 3px rgb(0 0 0 / 0.07)", "0 2px 2px rgb(0 0 0 / 0.06)"],
18
+ "lg": ["0 10px 8px rgb(0 0 0 / 0.04)", "0 4px 3px rgb(0 0 0 / 0.1)"],
19
+ "xl": ["0 20px 13px rgb(0 0 0 / 0.03)", "0 8px 5px rgb(0 0 0 / 0.08)"],
20
+ "2xl": "0 25px 25px rgb(0 0 0 / 0.15)",
21
+ "none": "0 0 rgb(0 0 0 / 0)"
22
+ };
3
23
 
4
24
  const fontFamily = {
5
25
  sans: [
@@ -179,24 +199,10 @@ const media = {
179
199
  mouse: "(hover) and (pointer: fine)"
180
200
  };
181
201
 
182
- const blur = {
183
- "DEFAULT": "8px",
184
- "0": "0",
185
- "sm": "4px",
186
- "md": "12px",
187
- "lg": "16px",
188
- "xl": "24px",
189
- "2xl": "40px",
190
- "3xl": "64px"
191
- };
192
- const dropShadow = {
193
- "DEFAULT": ["0 1px 2px rgb(0 0 0 / 0.1)", "0 1px 1px rgb(0 0 0 / 0.06)"],
194
- "sm": "0 1px 1px rgb(0 0 0 / 0.05)",
195
- "md": ["0 4px 3px rgb(0 0 0 / 0.07)", "0 2px 2px rgb(0 0 0 / 0.06)"],
196
- "lg": ["0 10px 8px rgb(0 0 0 / 0.04)", "0 4px 3px rgb(0 0 0 / 0.1)"],
197
- "xl": ["0 20px 13px rgb(0 0 0 / 0.03)", "0 8px 5px rgb(0 0 0 / 0.08)"],
198
- "2xl": "0 25px 25px rgb(0 0 0 / 0.15)",
199
- "none": "0 0 rgb(0 0 0 / 0)"
202
+ const preflightBase = {
203
+ ...transformBase,
204
+ ...boxShadowsBase,
205
+ ...ringBase
200
206
  };
201
207
 
202
208
  const baseSize = {
@@ -235,12 +241,6 @@ const maxHeight = {
235
241
  };
236
242
  const containers = Object.fromEntries(Object.entries(baseSize).map(([k, v]) => [k, `(min-width: ${v})`]));
237
243
 
238
- const preflightBase = {
239
- ...transformBase,
240
- ...boxShadowsBase,
241
- ...ringBase
242
- };
243
-
244
244
  const easing = {
245
245
  "DEFAULT": "cubic-bezier(0.4, 0, 0.2, 1)",
246
246
  "linear": "linear",
package/dist/theme.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  export { colors } from './colors.mjs';
2
- export { u as baseSize, b as blur, n as borderRadius, o as boxShadow, j as breakpoints, C as containers, d as dropShadow, m as duration, f as fontFamily, a as fontSize, i as fontWeight, A as height, h as letterSpacing, l as lineHeight, k as lineWidth, B as maxHeight, y as maxWidth, p as media, q as preflightBase, r as ringWidth, s as spacing, c as textIndent, g as textShadow, e as textStrokeWidth, t as theme, v as verticalBreakpoints, x as width, w as wordSpacing, z as zIndex } from './shared/preset-mini.MvpFhrjh.mjs';
3
- import './shared/preset-mini.DKJ8kHBp.mjs';
4
- import './shared/preset-mini.k49jxnhJ.mjs';
2
+ export { u as baseSize, b as blur, n as borderRadius, o as boxShadow, j as breakpoints, C as containers, d as dropShadow, m as duration, f as fontFamily, a as fontSize, i as fontWeight, A as height, h as letterSpacing, l as lineHeight, k as lineWidth, B as maxHeight, y as maxWidth, p as media, q as preflightBase, r as ringWidth, s as spacing, c as textIndent, g as textShadow, e as textStrokeWidth, t as theme, v as verticalBreakpoints, x as width, w as wordSpacing, z as zIndex } from './shared/preset-mini.DyJsPAde.mjs';
3
+ import './shared/preset-mini.Cw_oISCI.mjs';
4
+ import './shared/preset-mini.Cay6Ue29.mjs';
5
5
  import '@unocss/core';
6
6
  import '@unocss/rule-utils';
package/dist/utils.d.mts CHANGED
@@ -4,16 +4,6 @@ export { C as CONTROL_MINI_NO_NEGATIVE, c as colorResolver, a as colorableShadow
4
4
  import '@unocss/core';
5
5
  import './shared/preset-mini.Cde3ndkA.mjs';
6
6
 
7
- declare const directionMap: Record<string, string[]>;
8
- declare const insetMap: Record<string, string[]>;
9
- declare const cornerMap: Record<string, string[]>;
10
- declare const xyzMap: Record<string, string[]>;
11
- declare const xyzArray: string[];
12
- declare const positionMap: Record<string, string>;
13
- declare const globalKeywords: string[];
14
- declare const cssMathFnRE: RegExp;
15
- declare const cssVarFnRE: RegExp;
16
-
17
7
  declare function numberWithUnit(str: string): string | undefined;
18
8
  declare function auto(str: string): "auto" | undefined;
19
9
  declare function rem(str: string): string | undefined;
@@ -56,4 +46,14 @@ declare namespace handlers {
56
46
  declare const handler: _unocss_rule_utils.ValueHandler<"number" | "global" | "auto" | "px" | "position" | "numberWithUnit" | "rem" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "bracketOfPosition" | "cssvar" | "time" | "degree" | "properties">;
57
47
  declare const h: _unocss_rule_utils.ValueHandler<"number" | "global" | "auto" | "px" | "position" | "numberWithUnit" | "rem" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "bracketOfPosition" | "cssvar" | "time" | "degree" | "properties">;
58
48
 
49
+ declare const directionMap: Record<string, string[]>;
50
+ declare const insetMap: Record<string, string[]>;
51
+ declare const cornerMap: Record<string, string[]>;
52
+ declare const xyzMap: Record<string, string[]>;
53
+ declare const xyzArray: string[];
54
+ declare const positionMap: Record<string, string>;
55
+ declare const globalKeywords: string[];
56
+ declare const cssMathFnRE: RegExp;
57
+ declare const cssVarFnRE: RegExp;
58
+
59
59
  export { cornerMap, cssMathFnRE, cssVarFnRE, directionMap, globalKeywords, h, handler, insetMap, positionMap, handlers as valueHandlers, xyzArray, xyzMap };
package/dist/utils.d.ts CHANGED
@@ -4,16 +4,6 @@ export { C as CONTROL_MINI_NO_NEGATIVE, c as colorResolver, a as colorableShadow
4
4
  import '@unocss/core';
5
5
  import './shared/preset-mini.Cde3ndkA.js';
6
6
 
7
- declare const directionMap: Record<string, string[]>;
8
- declare const insetMap: Record<string, string[]>;
9
- declare const cornerMap: Record<string, string[]>;
10
- declare const xyzMap: Record<string, string[]>;
11
- declare const xyzArray: string[];
12
- declare const positionMap: Record<string, string>;
13
- declare const globalKeywords: string[];
14
- declare const cssMathFnRE: RegExp;
15
- declare const cssVarFnRE: RegExp;
16
-
17
7
  declare function numberWithUnit(str: string): string | undefined;
18
8
  declare function auto(str: string): "auto" | undefined;
19
9
  declare function rem(str: string): string | undefined;
@@ -56,4 +46,14 @@ declare namespace handlers {
56
46
  declare const handler: _unocss_rule_utils.ValueHandler<"number" | "global" | "auto" | "px" | "position" | "numberWithUnit" | "rem" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "bracketOfPosition" | "cssvar" | "time" | "degree" | "properties">;
57
47
  declare const h: _unocss_rule_utils.ValueHandler<"number" | "global" | "auto" | "px" | "position" | "numberWithUnit" | "rem" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "bracketOfPosition" | "cssvar" | "time" | "degree" | "properties">;
58
48
 
49
+ declare const directionMap: Record<string, string[]>;
50
+ declare const insetMap: Record<string, string[]>;
51
+ declare const cornerMap: Record<string, string[]>;
52
+ declare const xyzMap: Record<string, string[]>;
53
+ declare const xyzArray: string[];
54
+ declare const positionMap: Record<string, string>;
55
+ declare const globalKeywords: string[];
56
+ declare const cssMathFnRE: RegExp;
57
+ declare const cssVarFnRE: RegExp;
58
+
59
59
  export { cornerMap, cssMathFnRE, cssVarFnRE, directionMap, globalKeywords, h, handler, insetMap, positionMap, handlers as valueHandlers, xyzArray, xyzMap };
package/dist/utils.mjs CHANGED
@@ -1,3 +1,3 @@
1
- export { C as CONTROL_MINI_NO_NEGATIVE, l as colorResolver, m as colorableShadows, c as cornerMap, b as cssMathFnRE, e as cssVarFnRE, d as directionMap, j as directionSize, g as globalKeywords, f as h, h as handler, n as hasParseableColor, i as insetMap, t as isCSSMathFn, u as isSize, q as makeGlobalStaticRules, k as parseColor, p as positionMap, r as resolveBreakpoints, o as resolveVerticalBreakpoints, s as splitShorthand, w as transformXYZ, v as valueHandlers, a as xyzArray, x as xyzMap } from './shared/preset-mini.k49jxnhJ.mjs';
1
+ export { C as CONTROL_MINI_NO_NEGATIVE, l as colorResolver, m as colorableShadows, c as cornerMap, e as cssMathFnRE, f as cssVarFnRE, d as directionMap, j as directionSize, g as globalKeywords, a as h, h as handler, n as hasParseableColor, i as insetMap, t as isCSSMathFn, u as isSize, q as makeGlobalStaticRules, k as parseColor, p as positionMap, r as resolveBreakpoints, o as resolveVerticalBreakpoints, s as splitShorthand, w as transformXYZ, v as valueHandlers, b as xyzArray, x as xyzMap } from './shared/preset-mini.Cay6Ue29.mjs';
2
2
  export * from '@unocss/rule-utils';
3
3
  import '@unocss/core';
@@ -1,8 +1,8 @@
1
1
  import { VariantObject, Variant } from '@unocss/core';
2
2
  import { PresetMiniOptions } from './index.mjs';
3
3
  import { T as Theme } from './shared/preset-mini.Cde3ndkA.mjs';
4
- import './shared/preset-mini.Cnier7ov.mjs';
5
4
  import './colors.mjs';
5
+ import './shared/preset-mini.Cnier7ov.mjs';
6
6
  import './shared/preset-mini.XtClvIKE.mjs';
7
7
  import '@unocss/rule-utils';
8
8
 
@@ -46,8 +46,8 @@ declare function variantPseudoClassFunctions(): VariantObject;
46
46
  declare function variantTaggedPseudoClasses(options?: PresetMiniOptions): VariantObject[];
47
47
  declare const variantPartClasses: VariantObject;
48
48
 
49
- declare const variantSupports: VariantObject;
50
-
51
49
  declare const variantStartingStyle: Variant;
52
50
 
51
+ declare const variantSupports: VariantObject;
52
+
53
53
  export { calcMaxWidthBySize, variantAria, variantBreakpoints, variantChildren, variantColorsMediaOrClass, variantCombinators, variantContainerQuery, variantCssLayer, variantCustomMedia, variantDataAttribute, variantImportant, variantInternalLayer, variantLanguageDirections, variantNegative, variantPartClasses, variantPrint, variantPseudoClassFunctions, variantPseudoClassesAndElements, variantScope, variantSelector, variantStartingStyle, variantSupports, variantTaggedAriaAttributes, variantTaggedDataAttributes, variantTaggedPseudoClasses, variantTheme, variantVariables, variants };
@@ -1,8 +1,8 @@
1
1
  import { VariantObject, Variant } from '@unocss/core';
2
2
  import { PresetMiniOptions } from './index.js';
3
3
  import { T as Theme } from './shared/preset-mini.Cde3ndkA.js';
4
- import './shared/preset-mini.BooHsK52.js';
5
4
  import './colors.js';
5
+ import './shared/preset-mini.BooHsK52.js';
6
6
  import './shared/preset-mini.DChc_8j2.js';
7
7
  import '@unocss/rule-utils';
8
8
 
@@ -46,8 +46,8 @@ declare function variantPseudoClassFunctions(): VariantObject;
46
46
  declare function variantTaggedPseudoClasses(options?: PresetMiniOptions): VariantObject[];
47
47
  declare const variantPartClasses: VariantObject;
48
48
 
49
- declare const variantSupports: VariantObject;
50
-
51
49
  declare const variantStartingStyle: Variant;
52
50
 
51
+ declare const variantSupports: VariantObject;
52
+
53
53
  export { calcMaxWidthBySize, variantAria, variantBreakpoints, variantChildren, variantColorsMediaOrClass, variantCombinators, variantContainerQuery, variantCssLayer, variantCustomMedia, variantDataAttribute, variantImportant, variantInternalLayer, variantLanguageDirections, variantNegative, variantPartClasses, variantPrint, variantPseudoClassFunctions, variantPseudoClassesAndElements, variantScope, variantSelector, variantStartingStyle, variantSupports, variantTaggedAriaAttributes, variantTaggedDataAttributes, variantTaggedPseudoClasses, variantTheme, variantVariables, variants };
package/dist/variants.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { c as calcMaxWidthBySize, v as variantAria, b as variantBreakpoints, d as variantChildren, g as variantColorsMediaOrClass, e as variantCombinators, f as variantContainerQuery, p as variantCssLayer, n as variantCustomMedia, h as variantDataAttribute, l as variantImportant, q as variantInternalLayer, k as variantLanguageDirections, u as variantNegative, z as variantPartClasses, m as variantPrint, x as variantPseudoClassFunctions, w as variantPseudoClassesAndElements, r as variantScope, o as variantSelector, B as variantStartingStyle, A as variantSupports, a as variantTaggedAriaAttributes, i as variantTaggedDataAttributes, y as variantTaggedPseudoClasses, t as variantTheme, s as variantVariables, j as variants } from './shared/preset-mini.BcAMrOfV.mjs';
2
- import './shared/preset-mini.k49jxnhJ.mjs';
3
- import '@unocss/core';
1
+ export { c as calcMaxWidthBySize, v as variantAria, b as variantBreakpoints, d as variantChildren, g as variantColorsMediaOrClass, e as variantCombinators, f as variantContainerQuery, p as variantCssLayer, n as variantCustomMedia, h as variantDataAttribute, l as variantImportant, q as variantInternalLayer, k as variantLanguageDirections, u as variantNegative, z as variantPartClasses, m as variantPrint, x as variantPseudoClassFunctions, w as variantPseudoClassesAndElements, r as variantScope, o as variantSelector, A as variantStartingStyle, B as variantSupports, a as variantTaggedAriaAttributes, i as variantTaggedDataAttributes, y as variantTaggedPseudoClasses, t as variantTheme, s as variantVariables, j as variants } from './shared/preset-mini.DsZi5feL.mjs';
4
2
  import '@unocss/rule-utils';
3
+ import './shared/preset-mini.Cay6Ue29.mjs';
4
+ import '@unocss/core';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unocss/preset-mini",
3
3
  "type": "module",
4
- "version": "0.62.3",
4
+ "version": "0.63.0",
5
5
  "description": "The minimal preset for UnoCSS",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -56,9 +56,9 @@
56
56
  "dist"
57
57
  ],
58
58
  "dependencies": {
59
- "@unocss/extractor-arbitrary-variants": "0.62.3",
60
- "@unocss/rule-utils": "0.62.3",
61
- "@unocss/core": "0.62.3"
59
+ "@unocss/core": "0.63.0",
60
+ "@unocss/extractor-arbitrary-variants": "0.63.0",
61
+ "@unocss/rule-utils": "0.63.0"
62
62
  },
63
63
  "scripts": {
64
64
  "build": "unbuild",