@unocss/preset-mini 0.52.7 → 0.53.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const colors = require('./preset-mini.fcd935e5.cjs');
3
+ const colors = require('./preset-mini.02aa6651.cjs');
4
4
  const core = require('@unocss/core');
5
- const variants$1 = require('./preset-mini.dd2d059b.cjs');
5
+ const variants$1 = require('./preset-mini.c1922eb8.cjs');
6
6
 
7
7
  const variantAria = {
8
8
  name: "aria",
@@ -10,7 +10,7 @@ const variantAria = {
10
10
  const variant = variants$1.variantGetParameter("aria-", matcher, ctx.generator.config.separators);
11
11
  if (variant) {
12
12
  const [match, rest] = variant;
13
- const aria = colors.handler.bracket(match) ?? ctx.theme.aria?.[match] ?? "";
13
+ const aria = colors.h.bracket(match) ?? ctx.theme.aria?.[match] ?? "";
14
14
  if (aria) {
15
15
  return {
16
16
  matcher: rest,
@@ -24,7 +24,7 @@ const variantAria = {
24
24
  function calcMaxWidthBySize(size) {
25
25
  const value = size.match(/^-?[0-9]+\.?[0-9]*/)?.[0] || "";
26
26
  const unit = size.slice(value.length);
27
- const maxWidth = parseFloat(value) - 0.1;
27
+ const maxWidth = Number.parseFloat(value) - 0.1;
28
28
  return Number.isNaN(maxWidth) ? size : `${maxWidth}${unit}`;
29
29
  }
30
30
  function variantBreakpoints() {
@@ -101,7 +101,7 @@ function scopeMatcher(name, combinator) {
101
101
  if (!body)
102
102
  return;
103
103
  }
104
- let bracketValue = colors.handler.bracket(body[0]) ?? "";
104
+ let bracketValue = colors.h.bracket(body[0]) ?? "";
105
105
  if (bracketValue === "")
106
106
  bracketValue = "*";
107
107
  return {
@@ -128,10 +128,10 @@ const variantContainerQuery = {
128
128
  const variant = variants$1.variantGetParameter("@", matcher, ctx.generator.config.separators);
129
129
  if (variant) {
130
130
  const [match, rest, label] = variant;
131
- const unbracket = colors.handler.bracket(match);
131
+ const unbracket = colors.h.bracket(match);
132
132
  let container;
133
133
  if (unbracket) {
134
- const minWidth = colors.handler.numberWithUnit(unbracket);
134
+ const minWidth = colors.h.numberWithUnit(unbracket);
135
135
  if (minWidth)
136
136
  container = `(min-width: ${minWidth})`;
137
137
  } else {
@@ -172,7 +172,7 @@ const variantDataAttribute = {
172
172
  const variant = variants$1.variantGetParameter("data-", matcher, ctx.generator.config.separators);
173
173
  if (variant) {
174
174
  const [match, rest] = variant;
175
- const dataAttribute = colors.handler.bracket(match) ?? ctx.theme.data?.[match] ?? "";
175
+ const dataAttribute = colors.h.bracket(match) ?? ctx.theme.data?.[match] ?? "";
176
176
  if (dataAttribute) {
177
177
  return {
178
178
  matcher: rest,
@@ -194,7 +194,7 @@ const variantSelector = {
194
194
  const variant = variants$1.variantGetBracket("selector-", matcher, ctx.generator.config.separators);
195
195
  if (variant) {
196
196
  const [match, rest] = variant;
197
- const selector = colors.handler.bracket(match);
197
+ const selector = colors.h.bracket(match);
198
198
  if (selector) {
199
199
  return {
200
200
  matcher: rest,
@@ -210,7 +210,7 @@ const variantCssLayer = {
210
210
  const variant = variants$1.variantGetParameter("layer-", matcher, ctx.generator.config.separators);
211
211
  if (variant) {
212
212
  const [match, rest] = variant;
213
- const layer = colors.handler.bracket(match) ?? match;
213
+ const layer = colors.h.bracket(match) ?? match;
214
214
  if (layer) {
215
215
  return {
216
216
  matcher: rest,
@@ -229,7 +229,7 @@ const variantInternalLayer = {
229
229
  const variant = variants$1.variantGetParameter("uno-layer-", matcher, ctx.generator.config.separators);
230
230
  if (variant) {
231
231
  const [match, rest] = variant;
232
- const layer = colors.handler.bracket(match) ?? match;
232
+ const layer = colors.h.bracket(match) ?? match;
233
233
  if (layer) {
234
234
  return {
235
235
  matcher: rest,
@@ -245,7 +245,7 @@ const variantScope = {
245
245
  const variant = variants$1.variantGetBracket("scope-", matcher, ctx.generator.config.separators);
246
246
  if (variant) {
247
247
  const [match, rest] = variant;
248
- const scope = colors.handler.bracket(match);
248
+ const scope = colors.h.bracket(match);
249
249
  if (scope) {
250
250
  return {
251
251
  matcher: rest,
@@ -272,7 +272,7 @@ const variantVariables = {
272
272
  }
273
273
  if (newMatcher == null)
274
274
  return;
275
- const variant = colors.handler.bracket(match) ?? "";
275
+ const variant = colors.h.bracket(match) ?? "";
276
276
  const useParent = variant.startsWith("@");
277
277
  if (!(useParent || variant.includes("&")))
278
278
  return;
@@ -376,7 +376,7 @@ const variantCustomMedia = {
376
376
  const variant = variants$1.variantGetParameter("media-", matcher, ctx.generator.config.separators);
377
377
  if (variant) {
378
378
  const [match, rest] = variant;
379
- let media = colors.handler.bracket(match) ?? "";
379
+ let media = colors.h.bracket(match) ?? "";
380
380
  if (media === "")
381
381
  media = ctx.theme.media?.[match] ?? "";
382
382
  if (media) {
@@ -399,7 +399,7 @@ const variantSupports = {
399
399
  const variant = variants$1.variantGetParameter("supports-", matcher, ctx.generator.config.separators);
400
400
  if (variant) {
401
401
  const [match, rest] = variant;
402
- let supports = colors.handler.bracket(match) ?? "";
402
+ let supports = colors.h.bracket(match) ?? "";
403
403
  if (supports === "")
404
404
  supports = ctx.theme.supports?.[match] ?? "";
405
405
  if (supports) {
@@ -424,26 +424,27 @@ const PseudoClasses = Object.fromEntries([
424
424
  "visited",
425
425
  "target",
426
426
  ["open", "[open]"],
427
- "hover",
428
- "active",
429
- "focus-visible",
430
- "focus-within",
431
- "focus",
432
- "autofill",
433
- "enabled",
434
- "disabled",
435
- "read-only",
436
- "read-write",
437
- "placeholder-shown",
438
427
  "default",
439
428
  "checked",
440
429
  "indeterminate",
430
+ "placeholder-shown",
431
+ "autofill",
432
+ "optional",
433
+ "required",
441
434
  "valid",
442
435
  "invalid",
443
436
  "in-range",
444
437
  "out-of-range",
445
- "required",
446
- "optional",
438
+ "read-only",
439
+ "read-write",
440
+ "empty",
441
+ "focus-within",
442
+ "hover",
443
+ "focus",
444
+ "focus-visible",
445
+ "active",
446
+ "enabled",
447
+ "disabled",
447
448
  "root",
448
449
  "empty",
449
450
  ["even-of-type", ":nth-of-type(even)"],
@@ -464,43 +465,32 @@ const PseudoClasses = Object.fromEntries([
464
465
  ["marker", "::marker"],
465
466
  ["file", "::file-selector-button"]
466
467
  ].map((key) => Array.isArray(key) ? key : [key, `:${key}`]));
468
+ const PseudoClassesKeys = Object.keys(PseudoClasses);
467
469
  const PseudoClassesColon = Object.fromEntries([
468
470
  ["backdrop", "::backdrop"]
469
471
  ].map((key) => Array.isArray(key) ? key : [key, `:${key}`]));
472
+ const PseudoClassesColonKeys = Object.keys(PseudoClassesColon);
470
473
  const PseudoClassFunctions = [
471
474
  "not",
472
475
  "is",
473
476
  "where",
474
477
  "has"
475
478
  ];
476
- const PseudoClassesStr = Object.entries(PseudoClasses).filter(([, pseudo]) => !pseudo.startsWith("::")).map(([key]) => key).join("|");
477
- const PseudoClassesColonStr = Object.entries(PseudoClassesColon).filter(([, pseudo]) => !pseudo.startsWith("::")).map(([key]) => key).join("|");
479
+ const PseudoClassesStr = Object.entries(PseudoClasses).filter(([, pseudo]) => !pseudo.startsWith("::")).map(([key]) => key).sort((a, b) => b.length - a.length).join("|");
480
+ const PseudoClassesColonStr = Object.entries(PseudoClassesColon).filter(([, pseudo]) => !pseudo.startsWith("::")).map(([key]) => key).sort((a, b) => b.length - a.length).join("|");
478
481
  const PseudoClassFunctionsStr = PseudoClassFunctions.join("|");
479
- function pseudoModifier(pseudo) {
480
- if (pseudo === "focus") {
481
- return {
482
- sort: 10,
483
- noMerge: true
484
- };
485
- }
486
- if (pseudo === "active") {
487
- return {
488
- sort: 20,
489
- noMerge: true
490
- };
491
- }
492
- }
493
482
  function taggedPseudoClassMatcher(tag, parent, combinator) {
494
483
  const rawRE = new RegExp(`^(${core.escapeRegExp(parent)}:)(\\S+)${core.escapeRegExp(combinator)}\\1`);
495
484
  let splitRE;
496
485
  let pseudoRE;
497
486
  let pseudoColonRE;
487
+ let pseudoVarRE;
498
488
  const matchBracket = (input) => {
499
489
  const body = variants$1.variantGetBracket(`${tag}-`, input, []);
500
490
  if (!body)
501
491
  return;
502
492
  const [match, rest] = body;
503
- const bracketValue = colors.handler.bracket(match);
493
+ const bracketValue = colors.h.bracket(match);
504
494
  if (bracketValue == null)
505
495
  return;
506
496
  const label = rest.split(splitRE, 1)?.[0] ?? "";
@@ -527,6 +517,19 @@ function taggedPseudoClassMatcher(tag, parent, combinator) {
527
517
  pseudoKey
528
518
  ];
529
519
  };
520
+ const matchPseudoVar = (input) => {
521
+ const match = input.match(pseudoVarRE);
522
+ if (!match)
523
+ return;
524
+ const [original, fn, pseudoValue] = match;
525
+ const label = match[3] ?? "";
526
+ const pseudo = `:${fn}(${pseudoValue})`;
527
+ return [
528
+ label,
529
+ input.slice(original.length),
530
+ `${parent}${core.escapeSelector(label)}${pseudo}`
531
+ ];
532
+ };
530
533
  return {
531
534
  name: `pseudo:${tag}`,
532
535
  match(input, ctx) {
@@ -534,10 +537,11 @@ function taggedPseudoClassMatcher(tag, parent, combinator) {
534
537
  splitRE = new RegExp(`(?:${ctx.generator.config.separators.join("|")})`);
535
538
  pseudoRE = new RegExp(`^${tag}-(?:(?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))(?:(/\\w+))?(?:${ctx.generator.config.separators.join("|")})`);
536
539
  pseudoColonRE = new RegExp(`^${tag}-(?:(?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesColonStr}))(?:(/\\w+))?(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`);
540
+ pseudoVarRE = new RegExp(`^${tag}-(?:(${PseudoClassFunctionsStr})-)?\\[(.+)\\](?:(/\\w+))?(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`);
537
541
  }
538
542
  if (!input.startsWith(tag))
539
543
  return;
540
- const result = matchBracket(input) || matchPseudo(input);
544
+ const result = matchBracket(input) || matchPseudo(input) || matchPseudoVar(input);
541
545
  if (!result)
542
546
  return;
543
547
  const [label, matcher, prefix, pseudoName = ""] = result;
@@ -548,7 +552,7 @@ function taggedPseudoClassMatcher(tag, parent, combinator) {
548
552
  handle: (input2, next) => next({
549
553
  ...input2,
550
554
  prefix: `${prefix}${combinator}${input2.prefix}`.replace(rawRE, "$1$2:"),
551
- ...pseudoModifier(pseudoName)
555
+ sort: PseudoClassesKeys.indexOf(pseudoName) ?? PseudoClassesColonKeys.indexOf(pseudoName)
552
556
  })
553
557
  };
554
558
  },
@@ -565,8 +569,8 @@ const excludedPseudo = [
565
569
  "::-webkit-scrollbar-track-piece",
566
570
  "::file-selector-button"
567
571
  ];
568
- const PseudoClassesAndElementsStr = Object.entries(PseudoClasses).map(([key]) => key).join("|");
569
- const PseudoClassesAndElementsColonStr = Object.entries(PseudoClassesColon).map(([key]) => key).join("|");
572
+ const PseudoClassesAndElementsStr = Object.entries(PseudoClasses).map(([key]) => key).sort((a, b) => b.length - a.length).join("|");
573
+ const PseudoClassesAndElementsColonStr = Object.entries(PseudoClassesColon).map(([key]) => key).sort((a, b) => b.length - a.length).join("|");
570
574
  function variantPseudoClassesAndElements() {
571
575
  let PseudoClassesAndElementsRE;
572
576
  let PseudoClassesAndElementsColonRE;
@@ -580,6 +584,11 @@ function variantPseudoClassesAndElements() {
580
584
  const match = input.match(PseudoClassesAndElementsRE) || input.match(PseudoClassesAndElementsColonRE);
581
585
  if (match) {
582
586
  const pseudo = PseudoClasses[match[1]] || PseudoClassesColon[match[1]] || `:${match[1]}`;
587
+ let index = PseudoClassesKeys.indexOf(match[1]);
588
+ if (index === -1)
589
+ index = PseudoClassesColonKeys.indexOf(match[1]);
590
+ if (index === -1)
591
+ index = void 0;
583
592
  return {
584
593
  matcher: input.slice(match[0].length),
585
594
  handle: (input2, next) => {
@@ -591,7 +600,8 @@ function variantPseudoClassesAndElements() {
591
600
  return next({
592
601
  ...input2,
593
602
  ...selectors,
594
- ...pseudoModifier(match[1])
603
+ sort: index,
604
+ noMerge: true
595
605
  });
596
606
  }
597
607
  };
@@ -604,16 +614,19 @@ function variantPseudoClassesAndElements() {
604
614
  function variantPseudoClassFunctions() {
605
615
  let PseudoClassFunctionsRE;
606
616
  let PseudoClassColonFunctionsRE;
617
+ let PseudoClassVarFunctionRE;
607
618
  return {
608
619
  match(input, ctx) {
609
620
  if (!(PseudoClassFunctionsRE && PseudoClassColonFunctionsRE)) {
610
621
  PseudoClassFunctionsRE = new RegExp(`^(${PseudoClassFunctionsStr})-(${PseudoClassesStr})(?:${ctx.generator.config.separators.join("|")})`);
611
622
  PseudoClassColonFunctionsRE = new RegExp(`^(${PseudoClassFunctionsStr})-(${PseudoClassesColonStr})(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`);
623
+ PseudoClassVarFunctionRE = new RegExp(`^(${PseudoClassFunctionsStr})-(\\[.+\\])(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`);
612
624
  }
613
- const match = input.match(PseudoClassFunctionsRE) || input.match(PseudoClassColonFunctionsRE);
625
+ const match = input.match(PseudoClassFunctionsRE) || input.match(PseudoClassColonFunctionsRE) || input.match(PseudoClassVarFunctionRE);
614
626
  if (match) {
615
627
  const fn = match[1];
616
- const pseudo = PseudoClasses[match[2]] || PseudoClassesColon[match[2]] || `:${match[2]}`;
628
+ const fnVal = colors.getBracket(match[2], "[", "]");
629
+ const pseudo = fnVal ? colors.h.bracket(match[2]) : PseudoClasses[match[2]] || PseudoClassesColon[match[2]] || `:${match[2]}`;
617
630
  return {
618
631
  matcher: input.slice(match[0].length),
619
632
  selector: (s) => `${s}:${fn}(${pseudo})`
@@ -634,7 +647,7 @@ function variantTaggedPseudoClasses(options = {}) {
634
647
  ];
635
648
  }
636
649
  const PartClassesRE = /(part-\[(.+)]:)(.+)/;
637
- const partClasses = {
650
+ const variantPartClasses = {
638
651
  match(input) {
639
652
  const match = input.match(PartClassesRE);
640
653
  if (match) {
@@ -665,7 +678,7 @@ function variants(options) {
665
678
  variantPseudoClassesAndElements(),
666
679
  variantPseudoClassFunctions(),
667
680
  ...variantTaggedPseudoClasses(options),
668
- partClasses,
681
+ variantPartClasses,
669
682
  ...variantColorsMediaOrClass(options),
670
683
  ...variantLanguageDirections,
671
684
  variantScope,
@@ -675,7 +688,6 @@ function variants(options) {
675
688
  }
676
689
 
677
690
  exports.calcMaxWidthBySize = calcMaxWidthBySize;
678
- exports.partClasses = partClasses;
679
691
  exports.variantAria = variantAria;
680
692
  exports.variantBreakpoints = variantBreakpoints;
681
693
  exports.variantColorsMediaOrClass = variantColorsMediaOrClass;
@@ -688,6 +700,7 @@ exports.variantImportant = variantImportant;
688
700
  exports.variantInternalLayer = variantInternalLayer;
689
701
  exports.variantLanguageDirections = variantLanguageDirections;
690
702
  exports.variantNegative = variantNegative;
703
+ exports.variantPartClasses = variantPartClasses;
691
704
  exports.variantPrint = variantPrint;
692
705
  exports.variantPseudoClassFunctions = variantPseudoClassFunctions;
693
706
  exports.variantPseudoClassesAndElements = variantPseudoClassesAndElements;
@@ -1,5 +1,5 @@
1
- import { d as displays, o as opacity, b as bgColors, a as borders, c as contentVisibility, e as contents, f as fonts, t as tabSizes, g as textIndents, h as textOverflows, i as textDecorations, j as textStrokes, k as textShadows, l as textTransforms, m as textAligns, n as textColors, p as fontStyles, q as fontSmoothings, r as boxShadows, s as rings, u as positions, v as cursors, w as appearances, x as pointerEvents, y as resizes, z as verticalAligns, A as userSelects, B as whitespaces, C as breaks, D as overflows, E as outline, F as appearance, G as orders, H as justifies, I as alignments, J as placements, K as flexGridJustifiesAlignments, L as insets, M as floats, N as zIndexes, O as boxSizing, P as transitions, Q as transforms, R as willChange, S as contains, T as textWraps } from './preset-mini.f5158c55.mjs';
2
- import { h as handler, r as resolveVerticalBreakpoints, l as resolveBreakpoints, o as directionSize, c as colorResolver } from './preset-mini.9dd74f3a.mjs';
1
+ import { d as displays, o as opacity, b as bgColors, a as borders, c as contentVisibility, e as contents, f as fonts, t as tabSizes, g as textIndents, h as textOverflows, i as textDecorations, j as textStrokes, k as textShadows, l as textTransforms, m as textAligns, n as textColors, p as fontStyles, q as fontSmoothings, r as boxShadows, s as rings, u as positions, v as cursors, w as appearances, x as pointerEvents, y as resizes, z as verticalAligns, A as userSelects, B as whitespaces, C as breaks, D as overflows, E as outline, F as appearance, G as orders, H as justifies, I as alignments, J as placements, K as flexGridJustifiesAlignments, L as insets, M as floats, N as zIndexes, O as boxSizing, P as transitions, Q as transforms, R as willChange, S as contains, T as textWraps } from './preset-mini.a201ed79.mjs';
2
+ import { h, r as resolveVerticalBreakpoints, l as resolveBreakpoints, o as directionSize, c as colorResolver } from './preset-mini.08cdeeea.mjs';
3
3
  import { warnOnce } from '@unocss/core';
4
4
 
5
5
  const containerParent = [
@@ -16,14 +16,14 @@ const flex = [
16
16
  ["flex", { display: "flex" }],
17
17
  ["inline-flex", { display: "inline-flex" }],
18
18
  ["flex-inline", { display: "inline-flex" }],
19
- [/^flex-(.*)$/, ([, d]) => ({ flex: handler.bracket(d) != null ? handler.bracket(d).split(" ").map((e) => handler.cssvar.fraction(e) ?? e).join(" ") : handler.cssvar.fraction(d) })],
19
+ [/^flex-(.*)$/, ([, d]) => ({ flex: h.bracket(d) != null ? h.bracket(d).split(" ").map((e) => h.cssvar.fraction(e) ?? e).join(" ") : h.cssvar.fraction(d) })],
20
20
  ["flex-1", { flex: "1 1 0%" }],
21
21
  ["flex-auto", { flex: "1 1 auto" }],
22
22
  ["flex-initial", { flex: "0 1 auto" }],
23
23
  ["flex-none", { flex: "none" }],
24
- [/^(?:flex-)?shrink(?:-(.*))?$/, ([, d = ""]) => ({ "flex-shrink": handler.bracket.cssvar.number(d) ?? 1 }), { autocomplete: ["flex-shrink-<num>", "shrink-<num>"] }],
25
- [/^(?:flex-)?grow(?:-(.*))?$/, ([, d = ""]) => ({ "flex-grow": handler.bracket.cssvar.number(d) ?? 1 }), { autocomplete: ["flex-grow-<num>", "grow-<num>"] }],
26
- [/^(?:flex-)?basis-(.+)$/, ([, d], { theme }) => ({ "flex-basis": theme.spacing?.[d] ?? handler.bracket.cssvar.auto.fraction.rem(d) }), { autocomplete: ["flex-basis-$spacing", "basis-$spacing"] }],
24
+ [/^(?:flex-)?shrink(?:-(.*))?$/, ([, d = ""]) => ({ "flex-shrink": h.bracket.cssvar.number(d) ?? 1 }), { autocomplete: ["flex-shrink-<num>", "shrink-<num>"] }],
25
+ [/^(?:flex-)?grow(?:-(.*))?$/, ([, d = ""]) => ({ "flex-grow": h.bracket.cssvar.number(d) ?? 1 }), { autocomplete: ["flex-grow-<num>", "grow-<num>"] }],
26
+ [/^(?:flex-)?basis-(.+)$/, ([, d], { theme }) => ({ "flex-basis": theme.spacing?.[d] ?? h.bracket.cssvar.auto.fraction.rem(d) }), { autocomplete: ["flex-basis-$spacing", "basis-$spacing"] }],
27
27
  ["flex-row", { "flex-direction": "row" }],
28
28
  ["flex-row-reverse", { "flex-direction": "row-reverse" }],
29
29
  ["flex-col", { "flex-direction": "column" }],
@@ -39,7 +39,7 @@ const directions = {
39
39
  "y": "row-"
40
40
  };
41
41
  function handleGap([, d = "", s], { theme }) {
42
- const v = theme.spacing?.[s] ?? handler.bracket.cssvar.global.rem(s);
42
+ const v = theme.spacing?.[s] ?? h.bracket.cssvar.global.rem(s);
43
43
  if (v != null) {
44
44
  return {
45
45
  [`grid-${directions[d]}gap`]: v,
@@ -70,35 +70,35 @@ function autoDirection(c, theme, prop) {
70
70
  case "fr":
71
71
  return "minmax(0,1fr)";
72
72
  }
73
- return handler.bracket.cssvar.auto.rem(prop);
73
+ return h.bracket.cssvar.auto.rem(prop);
74
74
  }
75
75
  const grids = [
76
76
  ["grid", { display: "grid" }],
77
77
  ["inline-grid", { display: "inline-grid" }],
78
78
  [/^(?:grid-)?(row|col)-(.+)$/, ([, c, v], { theme }) => ({
79
- [`grid-${rowCol(c)}`]: theme[`grid${rowColTheme(c)}`]?.[v] ?? handler.bracket.cssvar.auto(v)
79
+ [`grid-${rowCol(c)}`]: theme[`grid${rowColTheme(c)}`]?.[v] ?? h.bracket.cssvar.auto(v)
80
80
  })],
81
81
  [/^(?:grid-)?(row|col)-span-(.+)$/, ([, c, s]) => {
82
82
  if (s === "full")
83
83
  return { [`grid-${rowCol(c)}`]: "1/-1" };
84
- const v = handler.bracket.number(s);
84
+ const v = h.bracket.number(s);
85
85
  if (v != null)
86
86
  return { [`grid-${rowCol(c)}`]: `span ${v}/span ${v}` };
87
87
  }, { autocomplete: ["grid-(row|col)-span-<num>", "(row|col)-span-<num>"] }],
88
- [/^(?:grid-)?(row|col)-start-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-start`]: handler.bracket.cssvar(v) ?? v })],
89
- [/^(?:grid-)?(row|col)-end-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]: handler.bracket.cssvar(v) ?? v }), { autocomplete: ["grid-(row|col)-(start|end)-<num>"] }],
88
+ [/^(?:grid-)?(row|col)-start-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-start`]: h.bracket.cssvar(v) ?? v })],
89
+ [/^(?:grid-)?(row|col)-end-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]: h.bracket.cssvar(v) ?? v }), { autocomplete: ["grid-(row|col)-(start|end)-<num>"] }],
90
90
  [/^(?:grid-)?auto-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({ [`grid-auto-${rowCol(c)}`]: autoDirection(c, theme, v) }), { autocomplete: ["grid-auto-(rows|cols)-<num>"] }],
91
- [/^(?:grid-auto-flow|auto-flow|grid-flow)-(.+)$/, ([, v]) => ({ "grid-auto-flow": handler.bracket.cssvar(v) })],
91
+ [/^(?:grid-auto-flow|auto-flow|grid-flow)-(.+)$/, ([, v]) => ({ "grid-auto-flow": h.bracket.cssvar(v) })],
92
92
  [/^(?:grid-auto-flow|auto-flow|grid-flow)-(row|col|dense|row-dense|col-dense)$/, ([, v]) => ({ "grid-auto-flow": rowCol(v).replace("-", " ") }), { autocomplete: ["(grid-auto-flow|auto-flow|grid-flow)-(row|col|dense|row-dense|col-dense)"] }],
93
93
  [/^grid-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({
94
- [`grid-template-${rowCol(c)}`]: theme[`gridTemplate${rowColTheme(c)}`]?.[v] ?? handler.bracket.cssvar(v)
94
+ [`grid-template-${rowCol(c)}`]: theme[`gridTemplate${rowColTheme(c)}`]?.[v] ?? h.bracket.cssvar(v)
95
95
  })],
96
96
  [/^grid-(rows|cols)-minmax-([\w.-]+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(auto-fill,minmax(${d},1fr))` })],
97
97
  [/^grid-(rows|cols)-(\d+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(${d},minmax(0,1fr))` }), { autocomplete: ["grid-(rows|cols)-<num>", "grid-(rows|cols)-none"] }],
98
98
  [/^grid-area(s)?-(.+)$/, ([, s, v]) => {
99
99
  if (s != null)
100
- return { "grid-template-areas": handler.cssvar(v) ?? v.split("-").map((s2) => `"${handler.bracket(s2)}"`).join(" ") };
101
- return { "grid-area": handler.bracket.cssvar(v) };
100
+ return { "grid-template-areas": h.cssvar(v) ?? v.split("-").map((s2) => `"${h.bracket(s2)}"`).join(" ") };
101
+ return { "grid-area": h.bracket.cssvar(v) };
102
102
  }],
103
103
  ["grid-rows-none", { "grid-template-rows": "none" }],
104
104
  ["grid-cols-none", { "grid-template-columns": "none" }]
@@ -124,7 +124,7 @@ function getSizeValue(minmax, hw, theme, prop) {
124
124
  case "min":
125
125
  return `${prop}-content`;
126
126
  }
127
- return handler.bracket.cssvar.global.auto.fraction.rem(prop);
127
+ return h.bracket.cssvar.global.auto.fraction.rem(prop);
128
128
  }
129
129
  const sizes = [
130
130
  [/^(?:size-)?(min-|max-)?([wh])-?(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
@@ -157,7 +157,7 @@ function getAspectRatio(prop) {
157
157
  case "video":
158
158
  return "16/9";
159
159
  }
160
- return handler.bracket.cssvar.global.auto.number(prop);
160
+ return h.bracket.cssvar.global.auto.number(prop);
161
161
  }
162
162
  const aspectRatio = [
163
163
  [/^(?:size-)?aspect-(?:ratio-)?(.+)$/, ([, d]) => ({ "aspect-ratio": getAspectRatio(d) }), { autocomplete: ["aspect-(square|video|ratio)", "aspect-ratio-(square|video)"] }]
@@ -199,13 +199,13 @@ const cssVariables = [
199
199
  [/^(.+?)-(\$.+)$/, ([, name, varname]) => {
200
200
  const prop = variablesAbbrMap[name];
201
201
  if (prop)
202
- return { [prop]: handler.cssvar(varname) };
202
+ return { [prop]: h.cssvar(varname) };
203
203
  }]
204
204
  ];
205
205
  const cssProperty = [
206
206
  [/^\[(--(\w|\\\W)+|[\w-]+):([^\s:]*?("\S+?"|'\S+?'|`\S+?`|[^\s:]+?)[^\s:]*?\)?)\]$/, ([match, prop, , value]) => {
207
207
  if (!isURI(match.slice(1, -1)))
208
- return { [prop]: handler.bracket(`[${value}]`) };
208
+ return { [prop]: h.bracket(`[${value}]`) };
209
209
  }]
210
210
  ];
211
211
  function isURI(declaration) {
@@ -231,13 +231,13 @@ ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
231
231
 
232
232
  const svgUtilities = [
233
233
  [/^fill-(.+)$/, colorResolver("fill", "fill"), { autocomplete: "fill-$colors" }],
234
- [/^fill-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-fill-opacity": handler.bracket.percent.cssvar(opacity) }), { autocomplete: "fill-(op|opacity)-<percent>" }],
234
+ [/^fill-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-fill-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "fill-(op|opacity)-<percent>" }],
235
235
  ["fill-none", { fill: "none" }],
236
- [/^stroke-(?:width-|size-)?(.+)$/, ([, s], { theme }) => ({ "stroke-width": theme.lineWidth?.[s] ?? handler.bracket.cssvar.fraction.px.number(s) }), { autocomplete: ["stroke-width-$lineWidth", "stroke-size-$lineWidth"] }],
237
- [/^stroke-dash-(.+)$/, ([, s]) => ({ "stroke-dasharray": handler.bracket.cssvar.number(s) }), { autocomplete: "stroke-dash-<num>" }],
238
- [/^stroke-offset-(.+)$/, ([, s], { theme }) => ({ "stroke-dashoffset": theme.lineWidth?.[s] ?? handler.bracket.cssvar.px.numberWithUnit(s) }), { autocomplete: "stroke-offset-$lineWidth" }],
236
+ [/^stroke-(?:width-|size-)?(.+)$/, ([, s], { theme }) => ({ "stroke-width": theme.lineWidth?.[s] ?? h.bracket.cssvar.fraction.px.number(s) }), { autocomplete: ["stroke-width-$lineWidth", "stroke-size-$lineWidth"] }],
237
+ [/^stroke-dash-(.+)$/, ([, s]) => ({ "stroke-dasharray": h.bracket.cssvar.number(s) }), { autocomplete: "stroke-dash-<num>" }],
238
+ [/^stroke-offset-(.+)$/, ([, s], { theme }) => ({ "stroke-dashoffset": theme.lineWidth?.[s] ?? h.bracket.cssvar.px.numberWithUnit(s) }), { autocomplete: "stroke-offset-$lineWidth" }],
239
239
  [/^stroke-(.+)$/, colorResolver("stroke", "stroke"), { autocomplete: "stroke-$colors" }],
240
- [/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity": handler.bracket.percent.cssvar(opacity) }), { autocomplete: "stroke-(op|opacity)-<percent>" }],
240
+ [/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "stroke-(op|opacity)-<percent>" }],
241
241
  ["stroke-cap-square", { "stroke-linecap": "square" }],
242
242
  ["stroke-cap-round", { "stroke-linecap": "round" }],
243
243
  ["stroke-cap-auto", { "stroke-linecap": "butt" }],
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  const colors = require('./preset-mini.f3fc54d2.cjs');
4
- const transform = require('./preset-mini.c0eda31d.cjs');
4
+ const transform = require('./preset-mini.daaac022.cjs');
5
5
  require('@unocss/core');
6
- require('./preset-mini.fcd935e5.cjs');
6
+ require('./preset-mini.02aa6651.cjs');
7
7
 
8
8
  const fontFamily = {
9
9
  sans: [
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const transform = require('./preset-mini.c0eda31d.cjs');
4
- const colors = require('./preset-mini.fcd935e5.cjs');
3
+ const transform = require('./preset-mini.daaac022.cjs');
4
+ const colors = require('./preset-mini.02aa6651.cjs');
5
5
  const core = require('@unocss/core');
6
6
 
7
7
  const containerParent = [
@@ -18,14 +18,14 @@ const flex = [
18
18
  ["flex", { display: "flex" }],
19
19
  ["inline-flex", { display: "inline-flex" }],
20
20
  ["flex-inline", { display: "inline-flex" }],
21
- [/^flex-(.*)$/, ([, d]) => ({ flex: colors.handler.bracket(d) != null ? colors.handler.bracket(d).split(" ").map((e) => colors.handler.cssvar.fraction(e) ?? e).join(" ") : colors.handler.cssvar.fraction(d) })],
21
+ [/^flex-(.*)$/, ([, d]) => ({ flex: colors.h.bracket(d) != null ? colors.h.bracket(d).split(" ").map((e) => colors.h.cssvar.fraction(e) ?? e).join(" ") : colors.h.cssvar.fraction(d) })],
22
22
  ["flex-1", { flex: "1 1 0%" }],
23
23
  ["flex-auto", { flex: "1 1 auto" }],
24
24
  ["flex-initial", { flex: "0 1 auto" }],
25
25
  ["flex-none", { flex: "none" }],
26
- [/^(?:flex-)?shrink(?:-(.*))?$/, ([, d = ""]) => ({ "flex-shrink": colors.handler.bracket.cssvar.number(d) ?? 1 }), { autocomplete: ["flex-shrink-<num>", "shrink-<num>"] }],
27
- [/^(?:flex-)?grow(?:-(.*))?$/, ([, d = ""]) => ({ "flex-grow": colors.handler.bracket.cssvar.number(d) ?? 1 }), { autocomplete: ["flex-grow-<num>", "grow-<num>"] }],
28
- [/^(?:flex-)?basis-(.+)$/, ([, d], { theme }) => ({ "flex-basis": theme.spacing?.[d] ?? colors.handler.bracket.cssvar.auto.fraction.rem(d) }), { autocomplete: ["flex-basis-$spacing", "basis-$spacing"] }],
26
+ [/^(?:flex-)?shrink(?:-(.*))?$/, ([, d = ""]) => ({ "flex-shrink": colors.h.bracket.cssvar.number(d) ?? 1 }), { autocomplete: ["flex-shrink-<num>", "shrink-<num>"] }],
27
+ [/^(?:flex-)?grow(?:-(.*))?$/, ([, d = ""]) => ({ "flex-grow": colors.h.bracket.cssvar.number(d) ?? 1 }), { autocomplete: ["flex-grow-<num>", "grow-<num>"] }],
28
+ [/^(?:flex-)?basis-(.+)$/, ([, d], { theme }) => ({ "flex-basis": theme.spacing?.[d] ?? colors.h.bracket.cssvar.auto.fraction.rem(d) }), { autocomplete: ["flex-basis-$spacing", "basis-$spacing"] }],
29
29
  ["flex-row", { "flex-direction": "row" }],
30
30
  ["flex-row-reverse", { "flex-direction": "row-reverse" }],
31
31
  ["flex-col", { "flex-direction": "column" }],
@@ -41,7 +41,7 @@ const directions = {
41
41
  "y": "row-"
42
42
  };
43
43
  function handleGap([, d = "", s], { theme }) {
44
- const v = theme.spacing?.[s] ?? colors.handler.bracket.cssvar.global.rem(s);
44
+ const v = theme.spacing?.[s] ?? colors.h.bracket.cssvar.global.rem(s);
45
45
  if (v != null) {
46
46
  return {
47
47
  [`grid-${directions[d]}gap`]: v,
@@ -72,35 +72,35 @@ function autoDirection(c, theme, prop) {
72
72
  case "fr":
73
73
  return "minmax(0,1fr)";
74
74
  }
75
- return colors.handler.bracket.cssvar.auto.rem(prop);
75
+ return colors.h.bracket.cssvar.auto.rem(prop);
76
76
  }
77
77
  const grids = [
78
78
  ["grid", { display: "grid" }],
79
79
  ["inline-grid", { display: "inline-grid" }],
80
80
  [/^(?:grid-)?(row|col)-(.+)$/, ([, c, v], { theme }) => ({
81
- [`grid-${rowCol(c)}`]: theme[`grid${rowColTheme(c)}`]?.[v] ?? colors.handler.bracket.cssvar.auto(v)
81
+ [`grid-${rowCol(c)}`]: theme[`grid${rowColTheme(c)}`]?.[v] ?? colors.h.bracket.cssvar.auto(v)
82
82
  })],
83
83
  [/^(?:grid-)?(row|col)-span-(.+)$/, ([, c, s]) => {
84
84
  if (s === "full")
85
85
  return { [`grid-${rowCol(c)}`]: "1/-1" };
86
- const v = colors.handler.bracket.number(s);
86
+ const v = colors.h.bracket.number(s);
87
87
  if (v != null)
88
88
  return { [`grid-${rowCol(c)}`]: `span ${v}/span ${v}` };
89
89
  }, { autocomplete: ["grid-(row|col)-span-<num>", "(row|col)-span-<num>"] }],
90
- [/^(?:grid-)?(row|col)-start-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-start`]: colors.handler.bracket.cssvar(v) ?? v })],
91
- [/^(?:grid-)?(row|col)-end-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]: colors.handler.bracket.cssvar(v) ?? v }), { autocomplete: ["grid-(row|col)-(start|end)-<num>"] }],
90
+ [/^(?:grid-)?(row|col)-start-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-start`]: colors.h.bracket.cssvar(v) ?? v })],
91
+ [/^(?:grid-)?(row|col)-end-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]: colors.h.bracket.cssvar(v) ?? v }), { autocomplete: ["grid-(row|col)-(start|end)-<num>"] }],
92
92
  [/^(?:grid-)?auto-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({ [`grid-auto-${rowCol(c)}`]: autoDirection(c, theme, v) }), { autocomplete: ["grid-auto-(rows|cols)-<num>"] }],
93
- [/^(?:grid-auto-flow|auto-flow|grid-flow)-(.+)$/, ([, v]) => ({ "grid-auto-flow": colors.handler.bracket.cssvar(v) })],
93
+ [/^(?:grid-auto-flow|auto-flow|grid-flow)-(.+)$/, ([, v]) => ({ "grid-auto-flow": colors.h.bracket.cssvar(v) })],
94
94
  [/^(?:grid-auto-flow|auto-flow|grid-flow)-(row|col|dense|row-dense|col-dense)$/, ([, v]) => ({ "grid-auto-flow": rowCol(v).replace("-", " ") }), { autocomplete: ["(grid-auto-flow|auto-flow|grid-flow)-(row|col|dense|row-dense|col-dense)"] }],
95
95
  [/^grid-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({
96
- [`grid-template-${rowCol(c)}`]: theme[`gridTemplate${rowColTheme(c)}`]?.[v] ?? colors.handler.bracket.cssvar(v)
96
+ [`grid-template-${rowCol(c)}`]: theme[`gridTemplate${rowColTheme(c)}`]?.[v] ?? colors.h.bracket.cssvar(v)
97
97
  })],
98
98
  [/^grid-(rows|cols)-minmax-([\w.-]+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(auto-fill,minmax(${d},1fr))` })],
99
99
  [/^grid-(rows|cols)-(\d+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(${d},minmax(0,1fr))` }), { autocomplete: ["grid-(rows|cols)-<num>", "grid-(rows|cols)-none"] }],
100
100
  [/^grid-area(s)?-(.+)$/, ([, s, v]) => {
101
101
  if (s != null)
102
- return { "grid-template-areas": colors.handler.cssvar(v) ?? v.split("-").map((s2) => `"${colors.handler.bracket(s2)}"`).join(" ") };
103
- return { "grid-area": colors.handler.bracket.cssvar(v) };
102
+ return { "grid-template-areas": colors.h.cssvar(v) ?? v.split("-").map((s2) => `"${colors.h.bracket(s2)}"`).join(" ") };
103
+ return { "grid-area": colors.h.bracket.cssvar(v) };
104
104
  }],
105
105
  ["grid-rows-none", { "grid-template-rows": "none" }],
106
106
  ["grid-cols-none", { "grid-template-columns": "none" }]
@@ -126,7 +126,7 @@ function getSizeValue(minmax, hw, theme, prop) {
126
126
  case "min":
127
127
  return `${prop}-content`;
128
128
  }
129
- return colors.handler.bracket.cssvar.global.auto.fraction.rem(prop);
129
+ return colors.h.bracket.cssvar.global.auto.fraction.rem(prop);
130
130
  }
131
131
  const sizes = [
132
132
  [/^(?:size-)?(min-|max-)?([wh])-?(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
@@ -159,7 +159,7 @@ function getAspectRatio(prop) {
159
159
  case "video":
160
160
  return "16/9";
161
161
  }
162
- return colors.handler.bracket.cssvar.global.auto.number(prop);
162
+ return colors.h.bracket.cssvar.global.auto.number(prop);
163
163
  }
164
164
  const aspectRatio = [
165
165
  [/^(?:size-)?aspect-(?:ratio-)?(.+)$/, ([, d]) => ({ "aspect-ratio": getAspectRatio(d) }), { autocomplete: ["aspect-(square|video|ratio)", "aspect-ratio-(square|video)"] }]
@@ -201,13 +201,13 @@ const cssVariables = [
201
201
  [/^(.+?)-(\$.+)$/, ([, name, varname]) => {
202
202
  const prop = variablesAbbrMap[name];
203
203
  if (prop)
204
- return { [prop]: colors.handler.cssvar(varname) };
204
+ return { [prop]: colors.h.cssvar(varname) };
205
205
  }]
206
206
  ];
207
207
  const cssProperty = [
208
208
  [/^\[(--(\w|\\\W)+|[\w-]+):([^\s:]*?("\S+?"|'\S+?'|`\S+?`|[^\s:]+?)[^\s:]*?\)?)\]$/, ([match, prop, , value]) => {
209
209
  if (!isURI(match.slice(1, -1)))
210
- return { [prop]: colors.handler.bracket(`[${value}]`) };
210
+ return { [prop]: colors.h.bracket(`[${value}]`) };
211
211
  }]
212
212
  ];
213
213
  function isURI(declaration) {
@@ -233,13 +233,13 @@ ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
233
233
 
234
234
  const svgUtilities = [
235
235
  [/^fill-(.+)$/, colors.colorResolver("fill", "fill"), { autocomplete: "fill-$colors" }],
236
- [/^fill-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-fill-opacity": colors.handler.bracket.percent.cssvar(opacity) }), { autocomplete: "fill-(op|opacity)-<percent>" }],
236
+ [/^fill-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-fill-opacity": colors.h.bracket.percent.cssvar(opacity) }), { autocomplete: "fill-(op|opacity)-<percent>" }],
237
237
  ["fill-none", { fill: "none" }],
238
- [/^stroke-(?:width-|size-)?(.+)$/, ([, s], { theme }) => ({ "stroke-width": theme.lineWidth?.[s] ?? colors.handler.bracket.cssvar.fraction.px.number(s) }), { autocomplete: ["stroke-width-$lineWidth", "stroke-size-$lineWidth"] }],
239
- [/^stroke-dash-(.+)$/, ([, s]) => ({ "stroke-dasharray": colors.handler.bracket.cssvar.number(s) }), { autocomplete: "stroke-dash-<num>" }],
240
- [/^stroke-offset-(.+)$/, ([, s], { theme }) => ({ "stroke-dashoffset": theme.lineWidth?.[s] ?? colors.handler.bracket.cssvar.px.numberWithUnit(s) }), { autocomplete: "stroke-offset-$lineWidth" }],
238
+ [/^stroke-(?:width-|size-)?(.+)$/, ([, s], { theme }) => ({ "stroke-width": theme.lineWidth?.[s] ?? colors.h.bracket.cssvar.fraction.px.number(s) }), { autocomplete: ["stroke-width-$lineWidth", "stroke-size-$lineWidth"] }],
239
+ [/^stroke-dash-(.+)$/, ([, s]) => ({ "stroke-dasharray": colors.h.bracket.cssvar.number(s) }), { autocomplete: "stroke-dash-<num>" }],
240
+ [/^stroke-offset-(.+)$/, ([, s], { theme }) => ({ "stroke-dashoffset": theme.lineWidth?.[s] ?? colors.h.bracket.cssvar.px.numberWithUnit(s) }), { autocomplete: "stroke-offset-$lineWidth" }],
241
241
  [/^stroke-(.+)$/, colors.colorResolver("stroke", "stroke"), { autocomplete: "stroke-$colors" }],
242
- [/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity": colors.handler.bracket.percent.cssvar(opacity) }), { autocomplete: "stroke-(op|opacity)-<percent>" }],
242
+ [/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity": colors.h.bracket.percent.cssvar(opacity) }), { autocomplete: "stroke-(op|opacity)-<percent>" }],
243
243
  ["stroke-cap-square", { "stroke-linecap": "square" }],
244
244
  ["stroke-cap-round", { "stroke-linecap": "round" }],
245
245
  ["stroke-cap-auto", { "stroke-linecap": "butt" }],