@unocss/preset-mini 0.41.0 → 0.42.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.
@@ -15,17 +15,18 @@ const verticalAlignAlias = {
15
15
  "text-top": "text-top",
16
16
  "text-bottom": "text-bottom",
17
17
  "sub": "sub",
18
- "super": "super"
18
+ "super": "super",
19
+ ...Object.fromEntries(utilities.globalKeywords.map((x) => [x, x]))
19
20
  };
20
21
  const verticalAligns = [
21
- [/^(?:vertical|align|v)-(.+)$/, ([, v]) => ({ "vertical-align": verticalAlignAlias[v] }), { autocomplete: `(vertical|align|v)-(${Object.keys(verticalAlignAlias).join("|")})` }]
22
+ [/^(?:vertical|align|v)-([-\w]+)$/, ([, v]) => ({ "vertical-align": verticalAlignAlias[v] }), { autocomplete: `(vertical|align|v)-(${Object.keys(verticalAlignAlias).join("|")})` }]
22
23
  ];
23
24
  const textAligns = ["center", "left", "right", "justify", "start", "end", ...utilities.globalKeywords].map((v) => [`text-${v}`, { "text-align": v }]);
24
25
 
25
26
  const outline = [
26
- [/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) }), { autocomplete: "outline-(width|size)-<num>" }],
27
+ [/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.global.px(d) }), { autocomplete: "outline-(width|size)-<num>" }],
27
28
  [/^outline-(?:color-)?(.+)$/, utilities.colorResolver("outline-color", "outline-color"), { autocomplete: "outline-$colors" }],
28
- [/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) }), { autocomplete: "outline-(offset)-<num>" }],
29
+ [/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.global.px(d) }), { autocomplete: "outline-(offset)-<num>" }],
29
30
  ["outline", { "outline-style": "solid" }],
30
31
  ...["auto", "dashed", "dotted", "double", "hidden", "solid", "groove", "ridge", "inset", "outset", ...utilities.globalKeywords].map((v) => [`outline-${v}`, { "outline-style": v }]),
31
32
  ["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }]
@@ -119,7 +120,7 @@ function handlerBorder(m, ctx) {
119
120
  }
120
121
  }
121
122
  function handlerBorderSize([, a = "", b], { theme }) {
122
- const v = theme.lineWidth?.[b || "DEFAULT"] ?? utilities.handler.bracket.cssvar.px(b || "1");
123
+ const v = theme.lineWidth?.[b || "DEFAULT"] ?? utilities.handler.bracket.cssvar.global.px(b || "1");
123
124
  if (a in utilities.directionMap && v != null)
124
125
  return utilities.directionMap[a].map((i) => [`border${i}-width`, v]);
125
126
  }
@@ -134,7 +135,7 @@ function handlerBorderOpacity([, a = "", opacity]) {
134
135
  return utilities.directionMap[a].map((i) => [`--un-border${i}-opacity`, v]);
135
136
  }
136
137
  function handlerRounded([, a = "", s], { theme }) {
137
- const v = theme.borderRadius?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.fraction.rem(s || "1");
138
+ const v = theme.borderRadius?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.global.fraction.rem(s || "1");
138
139
  if (a in utilities.cornerMap && v != null)
139
140
  return utilities.cornerMap[a].map((i) => [`border${i}-radius`, v]);
140
141
  }
@@ -198,7 +199,8 @@ const transitions = [
198
199
  ([, v]) => ({ "transition-property": utilities.handler.global(v) || transitionProperty(v) }),
199
200
  { autocomplete: [`transition-property-(${[...utilities.globalKeywords, ...Object.keys(transitionPropertyGroup)].join("|")})`] }
200
201
  ],
201
- ["transition-none", { transition: "none" }]
202
+ ["transition-none", { transition: "none" }],
203
+ ...utilities.makeGlobalStaticRules("transition")
202
204
  ];
203
205
 
204
206
  const flex = [
@@ -258,7 +260,7 @@ const fonts = [
258
260
  ],
259
261
  [/^text-size-(.+)$/, ([, s], { theme }) => {
260
262
  const themed = core.toArray(theme.fontSize?.[s]);
261
- const size = themed?.[0] ?? utilities.handler.bracket.cssvar.rem(s);
263
+ const size = themed?.[0] ?? utilities.handler.bracket.cssvar.global.rem(s);
262
264
  if (size != null)
263
265
  return { "font-size": size };
264
266
  }, { autocomplete: "text-size-$fontSize" }],
@@ -272,11 +274,11 @@ const fonts = [
272
274
  ([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] || utilities.handler.bracket.cssvar.global.rem(s) }),
273
275
  { autocomplete: "(leading|lh)-$lineHeight" }
274
276
  ],
275
- [
276
- /^font-synthesis-(.+)$/,
277
- ([, s]) => ({ "font-synthesis": s }),
278
- { autocomplete: "font-synthesis-(none|weight|style|small-caps)" }
279
- ],
277
+ ["font-synthesis-weight", { "font-synthesis": "weight" }],
278
+ ["font-synthesis-style", { "font-synthesis": "style" }],
279
+ ["font-synthesis-small-caps", { "font-synthesis": "small-caps" }],
280
+ ["font-synthesis-none", { "font-synthesis": "none" }],
281
+ [/^font-synthesis-(.+)$/, ([, s]) => ({ "font-synthesis": utilities.handler.bracket.cssvar.global(s) })],
280
282
  [
281
283
  /^(?:font-)?tracking-(.+)$/,
282
284
  ([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || utilities.handler.bracket.cssvar.global.rem(s) }),
@@ -317,7 +319,7 @@ const textShadows = [
317
319
  "text-shadow": "var(--un-text-shadow)"
318
320
  };
319
321
  }
320
- return { "text-shadow": utilities.handler.bracket.cssvar(s) };
322
+ return { "text-shadow": utilities.handler.bracket.cssvar.global(s) };
321
323
  }, { autocomplete: "text-shadow-$textShadow" }],
322
324
  [/^text-shadow-color-(.+)$/, utilities.colorResolver("--un-text-shadow-color", "text-shadow"), { autocomplete: "text-shadow-color-$colors" }],
323
325
  [/^text-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-shadow-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "text-shadow-color-(op|opacity)-<percent>" }]
@@ -329,7 +331,7 @@ const directions = {
329
331
  "y": "row-"
330
332
  };
331
333
  const handleGap = ([, d = "", s], { theme }) => {
332
- const v = theme.spacing?.[s] ?? utilities.handler.bracket.cssvar.rem(s);
334
+ const v = theme.spacing?.[s] ?? utilities.handler.bracket.cssvar.global.rem(s);
333
335
  if (v != null) {
334
336
  return {
335
337
  [`grid-${directions[d]}gap`]: v,
@@ -390,7 +392,8 @@ const overflowValues = [
390
392
  "hidden",
391
393
  "clip",
392
394
  "visible",
393
- "scroll"
395
+ "scroll",
396
+ ...utilities.globalKeywords
394
397
  ];
395
398
  const overflows = [
396
399
  [/^(?:overflow|of)-(.+)$/, ([, v]) => overflowValues.includes(v) ? { overflow: v } : void 0, { autocomplete: [`(overflow|of)-(${overflowValues.join("|")})`, `(overflow|of)-(x|y)-(${overflowValues.join("|")})`] }],
@@ -399,6 +402,7 @@ const overflows = [
399
402
 
400
403
  const positions = [
401
404
  [/^(?:position-|pos-)?(relative|absolute|fixed|sticky)$/, ([, v]) => ({ position: v })],
405
+ [/^(?:position-|pos-)([-\w]+)$/, ([, v]) => utilities.globalKeywords.includes(v) ? { position: v } : void 0],
402
406
  [/^(?:position-|pos-)?(static)$/, ([, v]) => ({ position: v })]
403
407
  ];
404
408
  const justifies = [
@@ -408,15 +412,18 @@ const justifies = [
408
412
  ["justify-between", { "justify-content": "space-between" }],
409
413
  ["justify-around", { "justify-content": "space-around" }],
410
414
  ["justify-evenly", { "justify-content": "space-evenly" }],
415
+ ...utilities.makeGlobalStaticRules("justify", "justify-content"),
411
416
  ["justify-items-start", { "justify-items": "start" }],
412
417
  ["justify-items-end", { "justify-items": "end" }],
413
418
  ["justify-items-center", { "justify-items": "center" }],
414
419
  ["justify-items-stretch", { "justify-items": "stretch" }],
420
+ ...utilities.makeGlobalStaticRules("justify-items"),
415
421
  ["justify-self-auto", { "justify-self": "auto" }],
416
422
  ["justify-self-start", { "justify-self": "start" }],
417
423
  ["justify-self-end", { "justify-self": "end" }],
418
424
  ["justify-self-center", { "justify-self": "center" }],
419
- ["justify-self-stretch", { "justify-self": "stretch" }]
425
+ ["justify-self-stretch", { "justify-self": "stretch" }],
426
+ ...utilities.makeGlobalStaticRules("justify-self")
420
427
  ];
421
428
  const orders = [
422
429
  [/^order-(.+)$/, ([, v]) => ({ order: utilities.handler.bracket.cssvar.number(v) })],
@@ -431,17 +438,20 @@ const alignments = [
431
438
  ["content-between", { "align-content": "space-between" }],
432
439
  ["content-around", { "align-content": "space-around" }],
433
440
  ["content-evenly", { "align-content": "space-evenly" }],
441
+ ...utilities.makeGlobalStaticRules("content", "align-content"),
434
442
  ["items-start", { "align-items": "flex-start" }],
435
443
  ["items-end", { "align-items": "flex-end" }],
436
444
  ["items-center", { "align-items": "center" }],
437
445
  ["items-baseline", { "align-items": "baseline" }],
438
446
  ["items-stretch", { "align-items": "stretch" }],
447
+ ...utilities.makeGlobalStaticRules("items", "align-items"),
439
448
  ["self-auto", { "align-self": "auto" }],
440
449
  ["self-start", { "align-self": "flex-start" }],
441
450
  ["self-end", { "align-self": "flex-end" }],
442
451
  ["self-center", { "align-self": "center" }],
443
452
  ["self-stretch", { "align-self": "stretch" }],
444
- ["self-baseline", { "align-self": "baseline" }]
453
+ ["self-baseline", { "align-self": "baseline" }],
454
+ ...utilities.makeGlobalStaticRules("self", "align-self")
445
455
  ];
446
456
  const placements = [
447
457
  ["place-content-center", { "place-content": "center" }],
@@ -451,18 +461,21 @@ const placements = [
451
461
  ["place-content-around", { "place-content": "space-around" }],
452
462
  ["place-content-evenly", { "place-content": "space-evenly" }],
453
463
  ["place-content-stretch", { "place-content": "stretch" }],
464
+ ...utilities.makeGlobalStaticRules("place-content"),
454
465
  ["place-items-start", { "place-items": "start" }],
455
466
  ["place-items-end", { "place-items": "end" }],
456
467
  ["place-items-center", { "place-items": "center" }],
457
468
  ["place-items-stretch", { "place-items": "stretch" }],
469
+ ...utilities.makeGlobalStaticRules("place-items"),
458
470
  ["place-self-auto", { "place-self": "auto" }],
459
471
  ["place-self-start", { "place-self": "start" }],
460
472
  ["place-self-end", { "place-self": "end" }],
461
473
  ["place-self-center", { "place-self": "center" }],
462
- ["place-self-stretch", { "place-self": "stretch" }]
474
+ ["place-self-stretch", { "place-self": "stretch" }],
475
+ ...utilities.makeGlobalStaticRules("place-self")
463
476
  ];
464
477
  function handleInsetValue(v, { theme }) {
465
- return theme.spacing?.[v] ?? utilities.handler.bracket.cssvar.auto.fraction.rem(v);
478
+ return theme.spacing?.[v] ?? utilities.handler.bracket.cssvar.global.auto.fraction.rem(v);
466
479
  }
467
480
  function handleInsetValues([, d, v], ctx) {
468
481
  const r = handleInsetValue(v, ctx);
@@ -492,18 +505,21 @@ const floats = [
492
505
  ["float-left", { float: "left" }],
493
506
  ["float-right", { float: "right" }],
494
507
  ["float-none", { float: "none" }],
508
+ ...utilities.makeGlobalStaticRules("float"),
495
509
  ["clear-left", { clear: "left" }],
496
510
  ["clear-right", { clear: "right" }],
497
511
  ["clear-both", { clear: "both" }],
498
- ["clear-none", { clear: "none" }]
512
+ ["clear-none", { clear: "none" }],
513
+ ...utilities.makeGlobalStaticRules("clear")
499
514
  ];
500
515
  const zIndexes = [
501
516
  [/^z([\d.]+)$/, ([, v]) => ({ "z-index": utilities.handler.number(v) })],
502
- [/^z-(.+)$/, ([, v]) => ({ "z-index": utilities.handler.bracket.cssvar.auto.number(v) }), { autocomplete: "z-<num>" }]
517
+ [/^z-(.+)$/, ([, v]) => ({ "z-index": utilities.handler.bracket.cssvar.global.auto.number(v) }), { autocomplete: "z-<num>" }]
503
518
  ];
504
519
  const boxSizing = [
505
520
  ["box-border", { "box-sizing": "border-box" }],
506
- ["box-content", { "box-sizing": "content-box" }]
521
+ ["box-content", { "box-sizing": "content-box" }],
522
+ ...utilities.makeGlobalStaticRules("box", "box-sizing")
507
523
  ];
508
524
 
509
525
  const sizeMapping = {
@@ -526,7 +542,7 @@ function getSizeValue(minmax, hw, theme, prop) {
526
542
  case "min":
527
543
  return `${prop}-content`;
528
544
  }
529
- return utilities.handler.bracket.cssvar.auto.fraction.rem(prop);
545
+ return utilities.handler.bracket.cssvar.global.auto.fraction.rem(prop);
530
546
  }
531
547
  const sizes = [
532
548
  [
@@ -561,7 +577,7 @@ function getAspectRatio(prop) {
561
577
  case "video":
562
578
  return "16/9";
563
579
  }
564
- return utilities.handler.bracket.cssvar.auto.number(prop);
580
+ return utilities.handler.bracket.cssvar.global.auto.number(prop);
565
581
  }
566
582
  const aspectRatio = [
567
583
  [/^aspect-(?:ratio-)?(.+)$/, ([, d]) => ({ "aspect-ratio": getAspectRatio(d) }), { autocomplete: ["aspect-(square|video)", "aspect-ratio-(square|video)"] }]
@@ -624,7 +640,7 @@ ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
624
640
  const decorationStyles = ["solid", "double", "dotted", "dashed", "wavy", ...utilities.globalKeywords];
625
641
  const textDecorations = [
626
642
  [/^(?:decoration-)?(underline|overline|line-through)$/, ([, s]) => ({ "text-decoration-line": s }), { autocomplete: "decoration-(underline|overline|line-through)" }],
627
- [/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? utilities.handler.bracket.cssvar.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
643
+ [/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? utilities.handler.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
628
644
  [/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s }), { autocomplete: "(underline|decoration)-(auto|from-font)" }],
629
645
  [/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
630
646
  const result = utilities.colorResolver("text-decoration-color", "line")(match, ctx);
@@ -636,7 +652,7 @@ const textDecorations = [
636
652
  }
637
653
  }, { autocomplete: "(underline|decoration)-$colors" }],
638
654
  [/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "(underline|decoration)-(op|opacity)-<percent>" }],
639
- [/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? utilities.handler.auto.bracket.cssvar.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
655
+ [/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? utilities.handler.auto.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
640
656
  ...decorationStyles.map((v) => [`underline-${v}`, { "text-decoration-style": v }]),
641
657
  ...decorationStyles.map((v) => [`decoration-${v}`, { "text-decoration-style": v }]),
642
658
  ["no-underline", { "text-decoration": "none" }],
@@ -723,6 +739,7 @@ exports.alignments = alignments;
723
739
  exports.appearance = appearance;
724
740
  exports.aspectRatio = aspectRatio;
725
741
  exports.bgColors = bgColors;
742
+ exports.borderStyles = borderStyles;
726
743
  exports.borders = borders;
727
744
  exports.boxSizing = boxSizing;
728
745
  exports.cssProperty = cssProperty;
@@ -1,4 +1,4 @@
1
- import { g as globalKeywords, h as handler, c as colorResolver, d as directionMap, a as hasParseableColor, p as parseColor, b as colorToString, e as colorOpacityToString, f as cornerMap, i as colorableShadows, j as insetMap, r as resolveVerticalBreakpoints, k as resolveBreakpoints, l as directionSize } from './utilities.mjs';
1
+ import { g as globalKeywords, h as handler, c as colorResolver, d as directionMap, a as hasParseableColor, p as parseColor, b as colorToString, e as colorOpacityToString, f as cornerMap, m as makeGlobalStaticRules, i as colorableShadows, j as insetMap, r as resolveVerticalBreakpoints, k as resolveBreakpoints, l as directionSize } from './utilities.mjs';
2
2
  import { toArray } from '@unocss/core';
3
3
  import { d as displays, c as contents, a as textOverflows, e as textTransforms, f as fontStyles, g as fontSmoothings, h as boxShadows, i as rings, j as cursors, k as appearances, p as pointerEvents, l as resizes, u as userSelects, w as whitespaces, m as breaks, n as transforms } from './transform.mjs';
4
4
 
@@ -13,17 +13,18 @@ const verticalAlignAlias = {
13
13
  "text-top": "text-top",
14
14
  "text-bottom": "text-bottom",
15
15
  "sub": "sub",
16
- "super": "super"
16
+ "super": "super",
17
+ ...Object.fromEntries(globalKeywords.map((x) => [x, x]))
17
18
  };
18
19
  const verticalAligns = [
19
- [/^(?:vertical|align|v)-(.+)$/, ([, v]) => ({ "vertical-align": verticalAlignAlias[v] }), { autocomplete: `(vertical|align|v)-(${Object.keys(verticalAlignAlias).join("|")})` }]
20
+ [/^(?:vertical|align|v)-([-\w]+)$/, ([, v]) => ({ "vertical-align": verticalAlignAlias[v] }), { autocomplete: `(vertical|align|v)-(${Object.keys(verticalAlignAlias).join("|")})` }]
20
21
  ];
21
22
  const textAligns = ["center", "left", "right", "justify", "start", "end", ...globalKeywords].map((v) => [`text-${v}`, { "text-align": v }]);
22
23
 
23
24
  const outline = [
24
- [/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ?? handler.bracket.cssvar.px(d) }), { autocomplete: "outline-(width|size)-<num>" }],
25
+ [/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ?? handler.bracket.cssvar.global.px(d) }), { autocomplete: "outline-(width|size)-<num>" }],
25
26
  [/^outline-(?:color-)?(.+)$/, colorResolver("outline-color", "outline-color"), { autocomplete: "outline-$colors" }],
26
- [/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ?? handler.bracket.cssvar.px(d) }), { autocomplete: "outline-(offset)-<num>" }],
27
+ [/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ?? handler.bracket.cssvar.global.px(d) }), { autocomplete: "outline-(offset)-<num>" }],
27
28
  ["outline", { "outline-style": "solid" }],
28
29
  ...["auto", "dashed", "dotted", "double", "hidden", "solid", "groove", "ridge", "inset", "outset", ...globalKeywords].map((v) => [`outline-${v}`, { "outline-style": v }]),
29
30
  ["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }]
@@ -117,7 +118,7 @@ function handlerBorder(m, ctx) {
117
118
  }
118
119
  }
119
120
  function handlerBorderSize([, a = "", b], { theme }) {
120
- const v = theme.lineWidth?.[b || "DEFAULT"] ?? handler.bracket.cssvar.px(b || "1");
121
+ const v = theme.lineWidth?.[b || "DEFAULT"] ?? handler.bracket.cssvar.global.px(b || "1");
121
122
  if (a in directionMap && v != null)
122
123
  return directionMap[a].map((i) => [`border${i}-width`, v]);
123
124
  }
@@ -132,7 +133,7 @@ function handlerBorderOpacity([, a = "", opacity]) {
132
133
  return directionMap[a].map((i) => [`--un-border${i}-opacity`, v]);
133
134
  }
134
135
  function handlerRounded([, a = "", s], { theme }) {
135
- const v = theme.borderRadius?.[s || "DEFAULT"] || handler.bracket.cssvar.fraction.rem(s || "1");
136
+ const v = theme.borderRadius?.[s || "DEFAULT"] || handler.bracket.cssvar.global.fraction.rem(s || "1");
136
137
  if (a in cornerMap && v != null)
137
138
  return cornerMap[a].map((i) => [`border${i}-radius`, v]);
138
139
  }
@@ -196,7 +197,8 @@ const transitions = [
196
197
  ([, v]) => ({ "transition-property": handler.global(v) || transitionProperty(v) }),
197
198
  { autocomplete: [`transition-property-(${[...globalKeywords, ...Object.keys(transitionPropertyGroup)].join("|")})`] }
198
199
  ],
199
- ["transition-none", { transition: "none" }]
200
+ ["transition-none", { transition: "none" }],
201
+ ...makeGlobalStaticRules("transition")
200
202
  ];
201
203
 
202
204
  const flex = [
@@ -256,7 +258,7 @@ const fonts = [
256
258
  ],
257
259
  [/^text-size-(.+)$/, ([, s], { theme }) => {
258
260
  const themed = toArray(theme.fontSize?.[s]);
259
- const size = themed?.[0] ?? handler.bracket.cssvar.rem(s);
261
+ const size = themed?.[0] ?? handler.bracket.cssvar.global.rem(s);
260
262
  if (size != null)
261
263
  return { "font-size": size };
262
264
  }, { autocomplete: "text-size-$fontSize" }],
@@ -270,11 +272,11 @@ const fonts = [
270
272
  ([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] || handler.bracket.cssvar.global.rem(s) }),
271
273
  { autocomplete: "(leading|lh)-$lineHeight" }
272
274
  ],
273
- [
274
- /^font-synthesis-(.+)$/,
275
- ([, s]) => ({ "font-synthesis": s }),
276
- { autocomplete: "font-synthesis-(none|weight|style|small-caps)" }
277
- ],
275
+ ["font-synthesis-weight", { "font-synthesis": "weight" }],
276
+ ["font-synthesis-style", { "font-synthesis": "style" }],
277
+ ["font-synthesis-small-caps", { "font-synthesis": "small-caps" }],
278
+ ["font-synthesis-none", { "font-synthesis": "none" }],
279
+ [/^font-synthesis-(.+)$/, ([, s]) => ({ "font-synthesis": handler.bracket.cssvar.global(s) })],
278
280
  [
279
281
  /^(?:font-)?tracking-(.+)$/,
280
282
  ([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || handler.bracket.cssvar.global.rem(s) }),
@@ -315,7 +317,7 @@ const textShadows = [
315
317
  "text-shadow": "var(--un-text-shadow)"
316
318
  };
317
319
  }
318
- return { "text-shadow": handler.bracket.cssvar(s) };
320
+ return { "text-shadow": handler.bracket.cssvar.global(s) };
319
321
  }, { autocomplete: "text-shadow-$textShadow" }],
320
322
  [/^text-shadow-color-(.+)$/, colorResolver("--un-text-shadow-color", "text-shadow"), { autocomplete: "text-shadow-color-$colors" }],
321
323
  [/^text-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-shadow-opacity": handler.bracket.percent(opacity) }), { autocomplete: "text-shadow-color-(op|opacity)-<percent>" }]
@@ -327,7 +329,7 @@ const directions = {
327
329
  "y": "row-"
328
330
  };
329
331
  const handleGap = ([, d = "", s], { theme }) => {
330
- const v = theme.spacing?.[s] ?? handler.bracket.cssvar.rem(s);
332
+ const v = theme.spacing?.[s] ?? handler.bracket.cssvar.global.rem(s);
331
333
  if (v != null) {
332
334
  return {
333
335
  [`grid-${directions[d]}gap`]: v,
@@ -388,7 +390,8 @@ const overflowValues = [
388
390
  "hidden",
389
391
  "clip",
390
392
  "visible",
391
- "scroll"
393
+ "scroll",
394
+ ...globalKeywords
392
395
  ];
393
396
  const overflows = [
394
397
  [/^(?:overflow|of)-(.+)$/, ([, v]) => overflowValues.includes(v) ? { overflow: v } : void 0, { autocomplete: [`(overflow|of)-(${overflowValues.join("|")})`, `(overflow|of)-(x|y)-(${overflowValues.join("|")})`] }],
@@ -397,6 +400,7 @@ const overflows = [
397
400
 
398
401
  const positions = [
399
402
  [/^(?:position-|pos-)?(relative|absolute|fixed|sticky)$/, ([, v]) => ({ position: v })],
403
+ [/^(?:position-|pos-)([-\w]+)$/, ([, v]) => globalKeywords.includes(v) ? { position: v } : void 0],
400
404
  [/^(?:position-|pos-)?(static)$/, ([, v]) => ({ position: v })]
401
405
  ];
402
406
  const justifies = [
@@ -406,15 +410,18 @@ const justifies = [
406
410
  ["justify-between", { "justify-content": "space-between" }],
407
411
  ["justify-around", { "justify-content": "space-around" }],
408
412
  ["justify-evenly", { "justify-content": "space-evenly" }],
413
+ ...makeGlobalStaticRules("justify", "justify-content"),
409
414
  ["justify-items-start", { "justify-items": "start" }],
410
415
  ["justify-items-end", { "justify-items": "end" }],
411
416
  ["justify-items-center", { "justify-items": "center" }],
412
417
  ["justify-items-stretch", { "justify-items": "stretch" }],
418
+ ...makeGlobalStaticRules("justify-items"),
413
419
  ["justify-self-auto", { "justify-self": "auto" }],
414
420
  ["justify-self-start", { "justify-self": "start" }],
415
421
  ["justify-self-end", { "justify-self": "end" }],
416
422
  ["justify-self-center", { "justify-self": "center" }],
417
- ["justify-self-stretch", { "justify-self": "stretch" }]
423
+ ["justify-self-stretch", { "justify-self": "stretch" }],
424
+ ...makeGlobalStaticRules("justify-self")
418
425
  ];
419
426
  const orders = [
420
427
  [/^order-(.+)$/, ([, v]) => ({ order: handler.bracket.cssvar.number(v) })],
@@ -429,17 +436,20 @@ const alignments = [
429
436
  ["content-between", { "align-content": "space-between" }],
430
437
  ["content-around", { "align-content": "space-around" }],
431
438
  ["content-evenly", { "align-content": "space-evenly" }],
439
+ ...makeGlobalStaticRules("content", "align-content"),
432
440
  ["items-start", { "align-items": "flex-start" }],
433
441
  ["items-end", { "align-items": "flex-end" }],
434
442
  ["items-center", { "align-items": "center" }],
435
443
  ["items-baseline", { "align-items": "baseline" }],
436
444
  ["items-stretch", { "align-items": "stretch" }],
445
+ ...makeGlobalStaticRules("items", "align-items"),
437
446
  ["self-auto", { "align-self": "auto" }],
438
447
  ["self-start", { "align-self": "flex-start" }],
439
448
  ["self-end", { "align-self": "flex-end" }],
440
449
  ["self-center", { "align-self": "center" }],
441
450
  ["self-stretch", { "align-self": "stretch" }],
442
- ["self-baseline", { "align-self": "baseline" }]
451
+ ["self-baseline", { "align-self": "baseline" }],
452
+ ...makeGlobalStaticRules("self", "align-self")
443
453
  ];
444
454
  const placements = [
445
455
  ["place-content-center", { "place-content": "center" }],
@@ -449,18 +459,21 @@ const placements = [
449
459
  ["place-content-around", { "place-content": "space-around" }],
450
460
  ["place-content-evenly", { "place-content": "space-evenly" }],
451
461
  ["place-content-stretch", { "place-content": "stretch" }],
462
+ ...makeGlobalStaticRules("place-content"),
452
463
  ["place-items-start", { "place-items": "start" }],
453
464
  ["place-items-end", { "place-items": "end" }],
454
465
  ["place-items-center", { "place-items": "center" }],
455
466
  ["place-items-stretch", { "place-items": "stretch" }],
467
+ ...makeGlobalStaticRules("place-items"),
456
468
  ["place-self-auto", { "place-self": "auto" }],
457
469
  ["place-self-start", { "place-self": "start" }],
458
470
  ["place-self-end", { "place-self": "end" }],
459
471
  ["place-self-center", { "place-self": "center" }],
460
- ["place-self-stretch", { "place-self": "stretch" }]
472
+ ["place-self-stretch", { "place-self": "stretch" }],
473
+ ...makeGlobalStaticRules("place-self")
461
474
  ];
462
475
  function handleInsetValue(v, { theme }) {
463
- return theme.spacing?.[v] ?? handler.bracket.cssvar.auto.fraction.rem(v);
476
+ return theme.spacing?.[v] ?? handler.bracket.cssvar.global.auto.fraction.rem(v);
464
477
  }
465
478
  function handleInsetValues([, d, v], ctx) {
466
479
  const r = handleInsetValue(v, ctx);
@@ -490,18 +503,21 @@ const floats = [
490
503
  ["float-left", { float: "left" }],
491
504
  ["float-right", { float: "right" }],
492
505
  ["float-none", { float: "none" }],
506
+ ...makeGlobalStaticRules("float"),
493
507
  ["clear-left", { clear: "left" }],
494
508
  ["clear-right", { clear: "right" }],
495
509
  ["clear-both", { clear: "both" }],
496
- ["clear-none", { clear: "none" }]
510
+ ["clear-none", { clear: "none" }],
511
+ ...makeGlobalStaticRules("clear")
497
512
  ];
498
513
  const zIndexes = [
499
514
  [/^z([\d.]+)$/, ([, v]) => ({ "z-index": handler.number(v) })],
500
- [/^z-(.+)$/, ([, v]) => ({ "z-index": handler.bracket.cssvar.auto.number(v) }), { autocomplete: "z-<num>" }]
515
+ [/^z-(.+)$/, ([, v]) => ({ "z-index": handler.bracket.cssvar.global.auto.number(v) }), { autocomplete: "z-<num>" }]
501
516
  ];
502
517
  const boxSizing = [
503
518
  ["box-border", { "box-sizing": "border-box" }],
504
- ["box-content", { "box-sizing": "content-box" }]
519
+ ["box-content", { "box-sizing": "content-box" }],
520
+ ...makeGlobalStaticRules("box", "box-sizing")
505
521
  ];
506
522
 
507
523
  const sizeMapping = {
@@ -524,7 +540,7 @@ function getSizeValue(minmax, hw, theme, prop) {
524
540
  case "min":
525
541
  return `${prop}-content`;
526
542
  }
527
- return handler.bracket.cssvar.auto.fraction.rem(prop);
543
+ return handler.bracket.cssvar.global.auto.fraction.rem(prop);
528
544
  }
529
545
  const sizes = [
530
546
  [
@@ -559,7 +575,7 @@ function getAspectRatio(prop) {
559
575
  case "video":
560
576
  return "16/9";
561
577
  }
562
- return handler.bracket.cssvar.auto.number(prop);
578
+ return handler.bracket.cssvar.global.auto.number(prop);
563
579
  }
564
580
  const aspectRatio = [
565
581
  [/^aspect-(?:ratio-)?(.+)$/, ([, d]) => ({ "aspect-ratio": getAspectRatio(d) }), { autocomplete: ["aspect-(square|video)", "aspect-ratio-(square|video)"] }]
@@ -622,7 +638,7 @@ ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
622
638
  const decorationStyles = ["solid", "double", "dotted", "dashed", "wavy", ...globalKeywords];
623
639
  const textDecorations = [
624
640
  [/^(?:decoration-)?(underline|overline|line-through)$/, ([, s]) => ({ "text-decoration-line": s }), { autocomplete: "decoration-(underline|overline|line-through)" }],
625
- [/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? handler.bracket.cssvar.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
641
+ [/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? handler.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
626
642
  [/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s }), { autocomplete: "(underline|decoration)-(auto|from-font)" }],
627
643
  [/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
628
644
  const result = colorResolver("text-decoration-color", "line")(match, ctx);
@@ -634,7 +650,7 @@ const textDecorations = [
634
650
  }
635
651
  }, { autocomplete: "(underline|decoration)-$colors" }],
636
652
  [/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": handler.bracket.percent(opacity) }), { autocomplete: "(underline|decoration)-(op|opacity)-<percent>" }],
637
- [/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? handler.auto.bracket.cssvar.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
653
+ [/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? handler.auto.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
638
654
  ...decorationStyles.map((v) => [`underline-${v}`, { "text-decoration-style": v }]),
639
655
  ...decorationStyles.map((v) => [`decoration-${v}`, { "text-decoration-style": v }]),
640
656
  ["no-underline", { "text-decoration": "none" }],
@@ -717,4 +733,4 @@ const rules = [
717
733
  questionMark
718
734
  ].flat(1);
719
735
 
720
- export { paddings as A, margins as B, svgUtilities as C, transitions as D, fonts as E, tabSizes as F, textIndents as G, textStrokes as H, textShadows as I, cssVariables as J, cssProperty as K, textDecorations as L, appearance as a, borders as b, opacity as c, textColors as d, bgColors as e, flex as f, gaps as g, grids as h, overflows as i, justifies as j, orders as k, alignments as l, placements as m, insets as n, outline as o, positions as p, floats as q, rules as r, boxSizing as s, textAligns as t, questionMark as u, verticalAligns as v, willChange as w, sizes as x, aspectRatio as y, zIndexes as z };
736
+ export { aspectRatio as A, paddings as B, margins as C, svgUtilities as D, transitions as E, fonts as F, tabSizes as G, textIndents as H, textStrokes as I, textShadows as J, cssVariables as K, cssProperty as L, textDecorations as M, appearance as a, borderStyles as b, borders as c, opacity as d, textColors as e, bgColors as f, flex as g, gaps as h, grids as i, overflows as j, justifies as k, orders as l, alignments as m, placements as n, outline as o, positions as p, insets as q, rules as r, floats as s, textAligns as t, boxSizing as u, verticalAligns as v, willChange as w, questionMark as x, sizes as y, zIndexes as z };
@@ -76,7 +76,8 @@ const scopeMatcher = (strict, name, template) => {
76
76
  selector: (s) => template.replace("&&-s", s).replace("&&-c", match[1] ?? "*")
77
77
  };
78
78
  }
79
- }
79
+ },
80
+ multiPass: true
80
81
  };
81
82
  };
82
83
  const variantCombinators = [
@@ -326,7 +327,7 @@ const sortValue = (pseudo) => {
326
327
  return 1;
327
328
  };
328
329
  const taggedPseudoClassMatcher = (tag, parent, combinator) => {
329
- const rawRe = new RegExp(`${core.escapeRegExp(parent)}:`);
330
+ const rawRe = new RegExp(`^(${core.escapeRegExp(parent)}:)(\\S+)${core.escapeRegExp(combinator)}\\1`);
330
331
  const pseudoRE = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))[:-]`);
331
332
  const pseudoColonRE = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesColonStr}))[:]`);
332
333
  return {
@@ -341,12 +342,13 @@ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
341
342
  matcher: input.slice(match[0].length),
342
343
  handle: (input2, next) => next({
343
344
  ...input2,
344
- prefix: rawRe.test(input2.prefix) ? input2.prefix.replace(rawRe, `${parent}${pseudo}:`) : `${parent}${pseudo}${combinator}${input2.prefix}`,
345
+ prefix: `${parent}${pseudo}${combinator}${input2.prefix}`.replace(rawRe, "$1$2:"),
345
346
  sort: sortValue(match[3])
346
347
  })
347
348
  };
348
349
  }
349
- }
350
+ },
351
+ multiPass: true
350
352
  };
351
353
  };
352
354
  const PseudoClassesAndElementsStr = Object.entries(PseudoClasses).map(([key]) => key).join("|");
@@ -399,22 +401,10 @@ const variantPseudoClassFunctions = {
399
401
  const variantTaggedPseudoClasses = (options = {}) => {
400
402
  const attributify = !!options?.attributifyPseudo;
401
403
  return [
402
- {
403
- ...taggedPseudoClassMatcher("group", attributify ? '[group=""]' : ".group", " "),
404
- multiPass: true
405
- },
406
- {
407
- ...taggedPseudoClassMatcher("peer", attributify ? '[peer=""]' : ".peer", "~"),
408
- multiPass: true
409
- },
410
- {
411
- ...taggedPseudoClassMatcher("parent", attributify ? '[parent=""]' : ".parent", ">"),
412
- multiPass: true
413
- },
414
- {
415
- ...taggedPseudoClassMatcher("previous", attributify ? '[previous=""]' : ".previous", "+"),
416
- multiPass: true
417
- }
404
+ taggedPseudoClassMatcher("group", attributify ? '[group=""]' : ".group", " "),
405
+ taggedPseudoClassMatcher("peer", attributify ? '[peer=""]' : ".peer", "~"),
406
+ taggedPseudoClassMatcher("parent", attributify ? '[parent=""]' : ".parent", ">"),
407
+ taggedPseudoClassMatcher("previous", attributify ? '[previous=""]' : ".previous", "+")
418
408
  ];
419
409
  };
420
410
  const PartClassesRE = /(part-\[(.+)]:)(.+)/;
@@ -74,7 +74,8 @@ const scopeMatcher = (strict, name, template) => {
74
74
  selector: (s) => template.replace("&&-s", s).replace("&&-c", match[1] ?? "*")
75
75
  };
76
76
  }
77
- }
77
+ },
78
+ multiPass: true
78
79
  };
79
80
  };
80
81
  const variantCombinators = [
@@ -324,7 +325,7 @@ const sortValue = (pseudo) => {
324
325
  return 1;
325
326
  };
326
327
  const taggedPseudoClassMatcher = (tag, parent, combinator) => {
327
- const rawRe = new RegExp(`${escapeRegExp(parent)}:`);
328
+ const rawRe = new RegExp(`^(${escapeRegExp(parent)}:)(\\S+)${escapeRegExp(combinator)}\\1`);
328
329
  const pseudoRE = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))[:-]`);
329
330
  const pseudoColonRE = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesColonStr}))[:]`);
330
331
  return {
@@ -339,12 +340,13 @@ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
339
340
  matcher: input.slice(match[0].length),
340
341
  handle: (input2, next) => next({
341
342
  ...input2,
342
- prefix: rawRe.test(input2.prefix) ? input2.prefix.replace(rawRe, `${parent}${pseudo}:`) : `${parent}${pseudo}${combinator}${input2.prefix}`,
343
+ prefix: `${parent}${pseudo}${combinator}${input2.prefix}`.replace(rawRe, "$1$2:"),
343
344
  sort: sortValue(match[3])
344
345
  })
345
346
  };
346
347
  }
347
- }
348
+ },
349
+ multiPass: true
348
350
  };
349
351
  };
350
352
  const PseudoClassesAndElementsStr = Object.entries(PseudoClasses).map(([key]) => key).join("|");
@@ -397,22 +399,10 @@ const variantPseudoClassFunctions = {
397
399
  const variantTaggedPseudoClasses = (options = {}) => {
398
400
  const attributify = !!options?.attributifyPseudo;
399
401
  return [
400
- {
401
- ...taggedPseudoClassMatcher("group", attributify ? '[group=""]' : ".group", " "),
402
- multiPass: true
403
- },
404
- {
405
- ...taggedPseudoClassMatcher("peer", attributify ? '[peer=""]' : ".peer", "~"),
406
- multiPass: true
407
- },
408
- {
409
- ...taggedPseudoClassMatcher("parent", attributify ? '[parent=""]' : ".parent", ">"),
410
- multiPass: true
411
- },
412
- {
413
- ...taggedPseudoClassMatcher("previous", attributify ? '[previous=""]' : ".previous", "+"),
414
- multiPass: true
415
- }
402
+ taggedPseudoClassMatcher("group", attributify ? '[group=""]' : ".group", " "),
403
+ taggedPseudoClassMatcher("peer", attributify ? '[peer=""]' : ".peer", "~"),
404
+ taggedPseudoClassMatcher("parent", attributify ? '[parent=""]' : ".parent", ">"),
405
+ taggedPseudoClassMatcher("previous", attributify ? '[previous=""]' : ".previous", "+")
416
406
  ];
417
407
  };
418
408
  const PartClassesRE = /(part-\[(.+)]:)(.+)/;
@@ -11,35 +11,43 @@ const displays = [
11
11
  ["flow-root", { display: "flow-root" }],
12
12
  ["list-item", { display: "list-item" }],
13
13
  ["hidden", { display: "none" }],
14
- [/^display-(.+)$/, ([, c]) => ({ display: utilities.handler.bracket.cssvar(c) || c })]
14
+ [/^display-(.+)$/, ([, c]) => ({ display: utilities.handler.bracket.cssvar.global(c) || c })]
15
15
  ];
16
16
  const appearances = [
17
17
  ["visible", { visibility: "visible" }],
18
18
  ["invisible", { visibility: "hidden" }],
19
19
  ["backface-visible", { "backface-visibility": "visible" }],
20
- ["backface-hidden", { "backface-visibility": "hidden" }]
20
+ ["backface-hidden", { "backface-visibility": "hidden" }],
21
+ ...utilities.makeGlobalStaticRules("backface", "backface-visibility")
21
22
  ];
22
23
  const cursors = [
23
- [/^cursor-(.+)$/, ([, c]) => ({ cursor: utilities.handler.bracket.cssvar(c) || c })]
24
+ [/^cursor-(.+)$/, ([, c]) => ({ cursor: utilities.handler.bracket.cssvar.global(c) || c })]
24
25
  ];
25
26
  const pointerEvents = [
26
27
  ["pointer-events-auto", { "pointer-events": "auto" }],
27
- ["pointer-events-none", { "pointer-events": "none" }]
28
+ ["pointer-events-none", { "pointer-events": "none" }],
29
+ ...utilities.makeGlobalStaticRules("pointer-events")
28
30
  ];
29
31
  const resizes = [
30
32
  ["resize-x", { resize: "horizontal" }],
31
33
  ["resize-y", { resize: "vertical" }],
32
34
  ["resize", { resize: "both" }],
33
- ["resize-none", { resize: "none" }]
35
+ ["resize-none", { resize: "none" }],
36
+ ...utilities.makeGlobalStaticRules("resize")
34
37
  ];
35
38
  const userSelects = [
36
39
  ["select-auto", { "user-select": "auto" }],
37
40
  ["select-all", { "user-select": "all" }],
38
41
  ["select-text", { "user-select": "text" }],
39
- ["select-none", { "user-select": "none" }]
42
+ ["select-none", { "user-select": "none" }],
43
+ ...utilities.makeGlobalStaticRules("select", "user-select")
40
44
  ];
41
45
  const whitespaces = [
42
- [/^(?:whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap|break-spaces)$/, ([, v]) => ({ "white-space": v }), { autocomplete: "(whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap|break-spaces)" }]
46
+ [
47
+ /^(?:whitespace-|ws-)([-\w]+)$/,
48
+ ([, v]) => ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces", ...utilities.globalKeywords].includes(v) ? { "white-space": v } : void 0,
49
+ { autocomplete: "(whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap|break-spaces)" }
50
+ ]
43
51
  ];
44
52
  const contents = [
45
53
  [/^content-\[(.+)\]$/, ([, v]) => ({ content: `"${v}"` })],
@@ -61,7 +69,8 @@ const textTransforms = [
61
69
  ["case-upper", { "text-transform": "uppercase" }],
62
70
  ["case-lower", { "text-transform": "lowercase" }],
63
71
  ["case-capital", { "text-transform": "capitalize" }],
64
- ["case-normal", { "text-transform": "none" }]
72
+ ["case-normal", { "text-transform": "none" }],
73
+ ...utilities.makeGlobalStaticRules("case", "text-transform")
65
74
  ];
66
75
  const fontStyles = [
67
76
  ["italic", { "font-style": "italic" }],
@@ -209,7 +218,8 @@ const transforms = [
209
218
  ["transform", { transform: transformCpu }],
210
219
  ["transform-cpu", { transform: transformCpu }],
211
220
  ["transform-gpu", { transform: transformGpu }],
212
- ["transform-none", { transform: "none" }]
221
+ ["transform-none", { transform: "none" }],
222
+ ...utilities.makeGlobalStaticRules("transform")
213
223
  ];
214
224
  function handleTranslate([, d, b], { theme }) {
215
225
  const v = theme.spacing?.[b] ?? utilities.handler.bracket.cssvar.fraction.rem(b);
@@ -1,4 +1,4 @@
1
- import { h as handler, c as colorResolver, i as colorableShadows, m as positionMap, x as xyzMap } from './utilities.mjs';
1
+ import { h as handler, m as makeGlobalStaticRules, g as globalKeywords, c as colorResolver, i as colorableShadows, n as positionMap, x as xyzMap } from './utilities.mjs';
2
2
 
3
3
  const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
4
4
  const displays = [
@@ -9,35 +9,43 @@ const displays = [
9
9
  ["flow-root", { display: "flow-root" }],
10
10
  ["list-item", { display: "list-item" }],
11
11
  ["hidden", { display: "none" }],
12
- [/^display-(.+)$/, ([, c]) => ({ display: handler.bracket.cssvar(c) || c })]
12
+ [/^display-(.+)$/, ([, c]) => ({ display: handler.bracket.cssvar.global(c) || c })]
13
13
  ];
14
14
  const appearances = [
15
15
  ["visible", { visibility: "visible" }],
16
16
  ["invisible", { visibility: "hidden" }],
17
17
  ["backface-visible", { "backface-visibility": "visible" }],
18
- ["backface-hidden", { "backface-visibility": "hidden" }]
18
+ ["backface-hidden", { "backface-visibility": "hidden" }],
19
+ ...makeGlobalStaticRules("backface", "backface-visibility")
19
20
  ];
20
21
  const cursors = [
21
- [/^cursor-(.+)$/, ([, c]) => ({ cursor: handler.bracket.cssvar(c) || c })]
22
+ [/^cursor-(.+)$/, ([, c]) => ({ cursor: handler.bracket.cssvar.global(c) || c })]
22
23
  ];
23
24
  const pointerEvents = [
24
25
  ["pointer-events-auto", { "pointer-events": "auto" }],
25
- ["pointer-events-none", { "pointer-events": "none" }]
26
+ ["pointer-events-none", { "pointer-events": "none" }],
27
+ ...makeGlobalStaticRules("pointer-events")
26
28
  ];
27
29
  const resizes = [
28
30
  ["resize-x", { resize: "horizontal" }],
29
31
  ["resize-y", { resize: "vertical" }],
30
32
  ["resize", { resize: "both" }],
31
- ["resize-none", { resize: "none" }]
33
+ ["resize-none", { resize: "none" }],
34
+ ...makeGlobalStaticRules("resize")
32
35
  ];
33
36
  const userSelects = [
34
37
  ["select-auto", { "user-select": "auto" }],
35
38
  ["select-all", { "user-select": "all" }],
36
39
  ["select-text", { "user-select": "text" }],
37
- ["select-none", { "user-select": "none" }]
40
+ ["select-none", { "user-select": "none" }],
41
+ ...makeGlobalStaticRules("select", "user-select")
38
42
  ];
39
43
  const whitespaces = [
40
- [/^(?:whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap|break-spaces)$/, ([, v]) => ({ "white-space": v }), { autocomplete: "(whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap|break-spaces)" }]
44
+ [
45
+ /^(?:whitespace-|ws-)([-\w]+)$/,
46
+ ([, v]) => ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces", ...globalKeywords].includes(v) ? { "white-space": v } : void 0,
47
+ { autocomplete: "(whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap|break-spaces)" }
48
+ ]
41
49
  ];
42
50
  const contents = [
43
51
  [/^content-\[(.+)\]$/, ([, v]) => ({ content: `"${v}"` })],
@@ -59,7 +67,8 @@ const textTransforms = [
59
67
  ["case-upper", { "text-transform": "uppercase" }],
60
68
  ["case-lower", { "text-transform": "lowercase" }],
61
69
  ["case-capital", { "text-transform": "capitalize" }],
62
- ["case-normal", { "text-transform": "none" }]
70
+ ["case-normal", { "text-transform": "none" }],
71
+ ...makeGlobalStaticRules("case", "text-transform")
63
72
  ];
64
73
  const fontStyles = [
65
74
  ["italic", { "font-style": "italic" }],
@@ -207,7 +216,8 @@ const transforms = [
207
216
  ["transform", { transform: transformCpu }],
208
217
  ["transform-cpu", { transform: transformCpu }],
209
218
  ["transform-gpu", { transform: transformGpu }],
210
- ["transform-none", { transform: "none" }]
219
+ ["transform-none", { transform: "none" }],
220
+ ...makeGlobalStaticRules("transform")
211
221
  ];
212
222
  function handleTranslate([, d, b], { theme }) {
213
223
  const v = theme.spacing?.[b] ?? handler.bracket.cssvar.fraction.rem(b);
@@ -528,7 +528,7 @@ const h = handler;
528
528
 
529
529
  const CONTROL_MINI_NO_NEGATIVE = "$$mini-no-negative";
530
530
  const directionSize = (propertyPrefix) => ([_, direction, size], { theme }) => {
531
- const v = theme.spacing?.[size || "DEFAULT"] ?? handler.bracket.cssvar.auto.fraction.rem(size);
531
+ const v = theme.spacing?.[size || "DEFAULT"] ?? handler.bracket.cssvar.global.auto.fraction.rem(size);
532
532
  if (v != null)
533
533
  return directionMap[direction].map((i) => [`${propertyPrefix}${i}`, v]);
534
534
  };
@@ -639,6 +639,9 @@ const resolveVerticalBreakpoints = ({ theme, generator }) => {
639
639
  verticalBreakpoints = theme.verticalBreakpoints;
640
640
  return verticalBreakpoints;
641
641
  };
642
+ const makeGlobalStaticRules = (prefix, property) => {
643
+ return globalKeywords.map((keyword) => [`${prefix}-${keyword}`, { [property ?? prefix]: keyword }]);
644
+ };
642
645
 
643
646
  exports.CONTROL_MINI_NO_NEGATIVE = CONTROL_MINI_NO_NEGATIVE;
644
647
  exports.colorOpacityToString = colorOpacityToString;
@@ -655,6 +658,7 @@ exports.handler = handler;
655
658
  exports.hasParseableColor = hasParseableColor;
656
659
  exports.hex2rgba = hex2rgba;
657
660
  exports.insetMap = insetMap;
661
+ exports.makeGlobalStaticRules = makeGlobalStaticRules;
658
662
  exports.parseColor = parseColor;
659
663
  exports.parseCssColor = parseCssColor;
660
664
  exports.positionMap = positionMap;
@@ -526,7 +526,7 @@ const h = handler;
526
526
 
527
527
  const CONTROL_MINI_NO_NEGATIVE = "$$mini-no-negative";
528
528
  const directionSize = (propertyPrefix) => ([_, direction, size], { theme }) => {
529
- const v = theme.spacing?.[size || "DEFAULT"] ?? handler.bracket.cssvar.auto.fraction.rem(size);
529
+ const v = theme.spacing?.[size || "DEFAULT"] ?? handler.bracket.cssvar.global.auto.fraction.rem(size);
530
530
  if (v != null)
531
531
  return directionMap[direction].map((i) => [`${propertyPrefix}${i}`, v]);
532
532
  };
@@ -637,5 +637,8 @@ const resolveVerticalBreakpoints = ({ theme, generator }) => {
637
637
  verticalBreakpoints = theme.verticalBreakpoints;
638
638
  return verticalBreakpoints;
639
639
  };
640
+ const makeGlobalStaticRules = (prefix, property) => {
641
+ return globalKeywords.map((keyword) => [`${prefix}-${keyword}`, { [property ?? prefix]: keyword }]);
642
+ };
640
643
 
641
- export { CONTROL_MINI_NO_NEGATIVE as C, hasParseableColor as a, colorToString as b, colorResolver as c, directionMap as d, colorOpacityToString as e, cornerMap as f, globalKeywords as g, handler as h, colorableShadows as i, insetMap as j, resolveBreakpoints as k, directionSize as l, positionMap as m, hex2rgba as n, parseCssColor as o, parseColor as p, getComponents as q, resolveVerticalBreakpoints as r, h as s, valueHandlers as v, xyzMap as x };
644
+ export { CONTROL_MINI_NO_NEGATIVE as C, hasParseableColor as a, colorToString as b, colorResolver as c, directionMap as d, colorOpacityToString as e, cornerMap as f, globalKeywords as g, handler as h, colorableShadows as i, insetMap as j, resolveBreakpoints as k, directionSize as l, makeGlobalStaticRules as m, positionMap as n, hex2rgba as o, parseColor as p, parseCssColor as q, resolveVerticalBreakpoints as r, getComponents as s, h as t, valueHandlers as v, xyzMap as x };
@@ -30,7 +30,10 @@ const variantParentMatcher = (name, parent) => {
30
30
  if (match) {
31
31
  return {
32
32
  matcher: input.slice(match[0].length),
33
- parent
33
+ handle: (input2, next) => next({
34
+ ...input2,
35
+ parent: `${input2.parent ? `${input2.parent} $$ ` : ""}${parent}`
36
+ })
34
37
  };
35
38
  }
36
39
  },
@@ -28,7 +28,10 @@ const variantParentMatcher = (name, parent) => {
28
28
  if (match) {
29
29
  return {
30
30
  matcher: input.slice(match[0].length),
31
- parent
31
+ handle: (input2, next) => next({
32
+ ...input2,
33
+ parent: `${input2.parent ? `${input2.parent} $$ ` : ""}${parent}`
34
+ })
32
35
  };
33
36
  }
34
37
  },
@@ -1,4 +1,4 @@
1
- import { T as Theme } from './types-2a2972f5.js';
1
+ import { T as Theme } from './types-9e30040a.js';
2
2
 
3
3
  declare const colors: Theme['colors'];
4
4
 
package/dist/colors.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { c as colors } from './colors-b075335e.js';
2
- import './types-2a2972f5.js';
1
+ export { c as colors } from './colors-f2b5968c.js';
2
+ import './types-9e30040a.js';
@@ -1,4 +1,4 @@
1
- import { T as Theme } from './types-2a2972f5.js';
1
+ import { T as Theme } from './types-9e30040a.js';
2
2
 
3
3
  declare const theme: Theme;
4
4
 
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { Preflight, PresetOptions, Preset } from '@unocss/core';
2
- import { T as Theme } from './types-2a2972f5.js';
3
- export { T as Theme, a as ThemeAnimation } from './types-2a2972f5.js';
4
- export { t as theme } from './default-08edad2c.js';
5
- export { c as colors } from './colors-b075335e.js';
6
- export { p as parseColor } from './utilities-c3da10e0.js';
2
+ import { T as Theme } from './types-9e30040a.js';
3
+ export { T as Theme, a as ThemeAnimation } from './types-9e30040a.js';
4
+ export { t as theme } from './default-0fe8c7f8.js';
5
+ export { c as colors } from './colors-f2b5968c.js';
6
+ export { p as parseColor } from './utilities-654ad3bd.js';
7
7
 
8
8
  declare const preflights: Preflight[];
9
9
 
package/dist/rules.cjs CHANGED
@@ -13,6 +13,7 @@ exports.alignments = _default.alignments;
13
13
  exports.appearance = _default.appearance;
14
14
  exports.aspectRatio = _default.aspectRatio;
15
15
  exports.bgColors = _default.bgColors;
16
+ exports.borderStyles = _default.borderStyles;
16
17
  exports.borders = _default.borders;
17
18
  exports.boxSizing = _default.boxSizing;
18
19
  exports.cssProperty = _default.cssProperty;
package/dist/rules.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Rule } from '@unocss/core';
2
- import { T as Theme } from './types-2a2972f5.js';
2
+ import { T as Theme } from './types-9e30040a.js';
3
3
 
4
4
  declare const verticalAligns: Rule[];
5
5
  declare const textAligns: Rule[];
@@ -8,6 +8,7 @@ declare const outline: Rule<Theme>[];
8
8
  declare const appearance: Rule[];
9
9
  declare const willChange: Rule[];
10
10
 
11
+ declare const borderStyles: string[];
11
12
  declare const borders: Rule[];
12
13
 
13
14
  /**
@@ -117,4 +118,4 @@ declare const cssProperty: Rule[];
117
118
 
118
119
  declare const textDecorations: Rule<Theme>[];
119
120
 
120
- export { alignments, appearance, appearances, aspectRatio, bgColors, borders, boxShadows, boxShadowsBase, boxSizing, breaks, contents, cssProperty, cssVariables, cursors, displays, flex, floats, fontSmoothings, fontStyles, fonts, gaps, grids, insets, justifies, margins, opacity, orders, outline, overflows, paddings, placements, pointerEvents, positions, questionMark, resizes, ringBase, rings, rules, sizes, svgUtilities, tabSizes, textAligns, textColors, textDecorations, textIndents, textOverflows, textShadows, textStrokes, textTransforms, transformBase, transforms, transitions, userSelects, varEmpty, verticalAligns, whitespaces, willChange, zIndexes };
121
+ export { alignments, appearance, appearances, aspectRatio, bgColors, borderStyles, borders, boxShadows, boxShadowsBase, boxSizing, breaks, contents, cssProperty, cssVariables, cursors, displays, flex, floats, fontSmoothings, fontStyles, fonts, gaps, grids, insets, justifies, margins, opacity, orders, outline, overflows, paddings, placements, pointerEvents, positions, questionMark, resizes, ringBase, rings, rules, sizes, svgUtilities, tabSizes, textAligns, textColors, textDecorations, textIndents, textOverflows, textShadows, textStrokes, textTransforms, transformBase, transforms, transitions, userSelects, varEmpty, verticalAligns, whitespaces, willChange, zIndexes };
package/dist/rules.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { l as alignments, a as appearance, y as aspectRatio, e as bgColors, b as borders, s as boxSizing, K as cssProperty, J as cssVariables, f as flex, q as floats, E as fonts, g as gaps, h as grids, n as insets, j as justifies, B as margins, c as opacity, k as orders, o as outline, i as overflows, A as paddings, m as placements, p as positions, u as questionMark, r as rules, x as sizes, C as svgUtilities, F as tabSizes, t as textAligns, d as textColors, L as textDecorations, G as textIndents, I as textShadows, H as textStrokes, D as transitions, v as verticalAligns, w as willChange, z as zIndexes } from './chunks/default2.mjs';
1
+ export { m as alignments, a as appearance, A as aspectRatio, f as bgColors, b as borderStyles, c as borders, u as boxSizing, L as cssProperty, K as cssVariables, g as flex, s as floats, F as fonts, h as gaps, i as grids, q as insets, k as justifies, C as margins, d as opacity, l as orders, o as outline, j as overflows, B as paddings, n as placements, p as positions, x as questionMark, r as rules, y as sizes, D as svgUtilities, G as tabSizes, t as textAligns, e as textColors, M as textDecorations, H as textIndents, J as textShadows, I as textStrokes, E as transitions, v as verticalAligns, w as willChange, z as zIndexes } from './chunks/default2.mjs';
2
2
  export { k as appearances, h as boxShadows, b as boxShadowsBase, m as breaks, c as contents, j as cursors, d as displays, g as fontSmoothings, f as fontStyles, p as pointerEvents, l as resizes, r as ringBase, i as rings, a as textOverflows, e as textTransforms, t as transformBase, n as transforms, u as userSelects, v as varEmpty, w as whitespaces } from './chunks/transform.mjs';
3
3
  import './chunks/utilities.mjs';
4
4
  import '@unocss/core';
package/dist/theme.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { c as colors } from './colors-b075335e.js';
2
- export { t as theme } from './default-08edad2c.js';
3
- import { T as Theme } from './types-2a2972f5.js';
4
- export { T as Theme, a as ThemeAnimation } from './types-2a2972f5.js';
1
+ export { c as colors } from './colors-f2b5968c.js';
2
+ export { t as theme } from './default-0fe8c7f8.js';
3
+ import { T as Theme } from './types-9e30040a.js';
4
+ export { T as Theme, a as ThemeAnimation } from './types-9e30040a.js';
5
5
 
6
6
  declare const blur: {
7
7
  DEFAULT: string;
@@ -46,6 +46,9 @@ interface Theme {
46
46
  gridRow?: Record<string, string>;
47
47
  gridTemplateColumn?: Record<string, string>;
48
48
  gridTemplateRow?: Record<string, string>;
49
+ container?: {
50
+ center?: boolean;
51
+ };
49
52
  /** Used to generate CSS variables placeholder in preflight */
50
53
  preflightBase?: Record<string, string | number>;
51
54
  }
@@ -1,5 +1,5 @@
1
- import { RuleContext, CSSEntries, ParsedColorValue, CSSObject, VariantContext } from '@unocss/core';
2
- import { T as Theme } from './types-2a2972f5.js';
1
+ import { RuleContext, CSSEntries, ParsedColorValue, CSSObject, VariantContext, Rule } from '@unocss/core';
2
+ import { T as Theme } from './types-9e30040a.js';
3
3
 
4
4
  declare const CONTROL_MINI_NO_NEGATIVE = "$$mini-no-negative";
5
5
  /**
@@ -55,5 +55,6 @@ declare const colorableShadows: (shadows: string | string[], colorVar: string) =
55
55
  declare const hasParseableColor: (color: string | undefined, theme: Theme) => boolean;
56
56
  declare const resolveBreakpoints: ({ theme, generator }: Readonly<VariantContext<Theme>>) => Record<string, string> | undefined;
57
57
  declare const resolveVerticalBreakpoints: ({ theme, generator }: Readonly<VariantContext<Theme>>) => Record<string, string> | undefined;
58
+ declare const makeGlobalStaticRules: (prefix: string, property?: string) => Rule<{}>[];
58
59
 
59
- export { CONTROL_MINI_NO_NEGATIVE as C, colorableShadows as a, resolveVerticalBreakpoints as b, colorResolver as c, directionSize as d, hasParseableColor as h, parseColor as p, resolveBreakpoints as r };
60
+ export { CONTROL_MINI_NO_NEGATIVE as C, colorableShadows as a, resolveVerticalBreakpoints as b, colorResolver as c, directionSize as d, hasParseableColor as h, makeGlobalStaticRules as m, parseColor as p, resolveBreakpoints as r };
package/dist/utils.cjs CHANGED
@@ -23,6 +23,7 @@ exports.handler = utilities.handler;
23
23
  exports.hasParseableColor = utilities.hasParseableColor;
24
24
  exports.hex2rgba = utilities.hex2rgba;
25
25
  exports.insetMap = utilities.insetMap;
26
+ exports.makeGlobalStaticRules = utilities.makeGlobalStaticRules;
26
27
  exports.parseColor = utilities.parseColor;
27
28
  exports.parseCssColor = utilities.parseCssColor;
28
29
  exports.positionMap = utilities.positionMap;
package/dist/utils.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _unocss_core from '@unocss/core';
2
2
  import { RGBAColorValue, CSSColorValue, VariantHandlerContext, VariantObject } from '@unocss/core';
3
- export { C as CONTROL_MINI_NO_NEGATIVE, c as colorResolver, a as colorableShadows, d as directionSize, h as hasParseableColor, p as parseColor, r as resolveBreakpoints, b as resolveVerticalBreakpoints } from './utilities-c3da10e0.js';
4
- import './types-2a2972f5.js';
3
+ export { C as CONTROL_MINI_NO_NEGATIVE, c as colorResolver, a as colorableShadows, d as directionSize, h as hasParseableColor, m as makeGlobalStaticRules, p as parseColor, r as resolveBreakpoints, b as resolveVerticalBreakpoints } from './utilities-654ad3bd.js';
4
+ import './types-9e30040a.js';
5
5
 
6
6
  declare function hex2rgba(hex?: string): RGBAColorValue | undefined;
7
7
  declare function parseCssColor(str?: string): CSSColorValue | undefined;
package/dist/utils.mjs CHANGED
@@ -1,3 +1,3 @@
1
- export { C as CONTROL_MINI_NO_NEGATIVE, e as colorOpacityToString, c as colorResolver, b as colorToString, i as colorableShadows, f as cornerMap, d as directionMap, l as directionSize, q as getComponents, g as globalKeywords, s as h, h as handler, a as hasParseableColor, n as hex2rgba, j as insetMap, p as parseColor, o as parseCssColor, m as positionMap, k as resolveBreakpoints, r as resolveVerticalBreakpoints, v as valueHandlers, x as xyzMap } from './chunks/utilities.mjs';
1
+ export { C as CONTROL_MINI_NO_NEGATIVE, e as colorOpacityToString, c as colorResolver, b as colorToString, i as colorableShadows, f as cornerMap, d as directionMap, l as directionSize, s as getComponents, g as globalKeywords, t as h, h as handler, a as hasParseableColor, o as hex2rgba, j as insetMap, m as makeGlobalStaticRules, p as parseColor, q as parseCssColor, n as positionMap, k as resolveBreakpoints, r as resolveVerticalBreakpoints, v as valueHandlers, x as xyzMap } from './chunks/utilities.mjs';
2
2
  export { a as variantMatcher, v as variantParentMatcher } from './chunks/variants.mjs';
3
3
  import '@unocss/core';
@@ -1,9 +1,9 @@
1
1
  import { Variant, VariantObject } from '@unocss/core';
2
- import { T as Theme } from './types-2a2972f5.js';
2
+ import { T as Theme } from './types-9e30040a.js';
3
3
  import { PresetMiniOptions } from './index.js';
4
- import './default-08edad2c.js';
5
- import './colors-b075335e.js';
6
- import './utilities-c3da10e0.js';
4
+ import './default-0fe8c7f8.js';
5
+ import './colors-f2b5968c.js';
6
+ import './utilities-654ad3bd.js';
7
7
 
8
8
  declare const variantBreakpoints: Variant<Theme>;
9
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-mini",
3
- "version": "0.41.0",
3
+ "version": "0.42.0",
4
4
  "description": "The minimal preset for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -61,7 +61,7 @@
61
61
  "*.css"
62
62
  ],
63
63
  "dependencies": {
64
- "@unocss/core": "0.41.0"
64
+ "@unocss/core": "0.42.0"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "unbuild",