@unocss/preset-mini 0.15.5 → 0.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -78,22 +78,6 @@ const textColors = [
78
78
  [/^(?:text|color|c)-(.+)$/, colorResolver$1("color", "text")],
79
79
  [/^(?:text|color|c)-op(?:acity)?-?(.+)$/m, ([, opacity2]) => ({ "--un-text-opacity": handler.bracket.percent.cssvar(opacity2) })]
80
80
  ];
81
- const textDecorationColors = [
82
- [/^underline-(.+)$/, (match, ctx) => {
83
- const result = colorResolver$1("text-decoration-color", "line")(match, ctx);
84
- if (result) {
85
- return {
86
- "-webkit-text-decoration-color": result["text-decoration-color"],
87
- ...result
88
- };
89
- }
90
- }],
91
- [/^underline-op(?:acity)?-?(.+)$/m, ([, opacity2]) => ({ "--un-line-opacity": handler.bracket.percent(opacity2) })]
92
- ];
93
- const textStrokeColors = [
94
- [/^text-stroke-(.+)$/, colorResolver$1("-webkit-text-stroke-color", "text-stroke")],
95
- [/^text-stroke-op(?:acity)?-?(.+)$/m, ([, opacity2]) => ({ "--un-text-stroke-opacity": handler.bracket.percent(opacity2) })]
96
- ];
97
81
  const bgColors = [
98
82
  [/^bg-(.+)$/, colorResolver$1("background-color", "bg")],
99
83
  [/^bg-op(?:acity)?-?(.+)$/m, ([, opacity2]) => ({ "--un-bg-opacity": handler.bracket.percent(opacity2) })]
@@ -178,39 +162,51 @@ const placeholder = [
178
162
  ]
179
163
  ];
180
164
 
181
- const borderSizes = [
165
+ const borders = [
182
166
  [/^border$/, handlerBorder],
183
- [/^(?:border|b)(?:-([^-]+))?$/, handlerBorder],
184
- [/^(?:border|b)(?:-([^-]+))?(?:-([^-]+))?$/, handlerBorder]
185
- ];
186
- const borderRadius = [
187
- [/^(?:border-)?(?:rounded|rd)$/, handlerRounded],
188
- [/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?$/, handlerRounded],
189
- [/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?(?:-([^-]+))?$/, handlerRounded]
190
- ];
191
- const borderStyles = [
167
+ [/^(?:border|b)()-(.+)$/, handlerBorder],
168
+ [/^(?:border|b)-([^-]+)-(.+)$/, handlerBorder],
169
+ [/^(?:border|b)()-size-(.+)$/, handlerBorderSize],
170
+ [/^(?:border|b)-([^-]+)-size-(.+)$/, handlerBorderSize],
171
+ [/^(?:border|b)()-(.+)$/, handlerBorderColor],
172
+ [/^(?:border|b)-([^-]+)-(.+)$/, handlerBorderColor],
173
+ [/^(?:border|b)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-border-opacity": handler.bracket.percent(opacity) })],
192
174
  ["border-solid", { "border-style": "solid" }],
193
175
  ["border-dashed", { "border-style": "dashed" }],
194
176
  ["border-dotted", { "border-style": "dotted" }],
195
177
  ["border-double", { "border-style": "double" }],
196
- ["border-none", { "border-style": "none" }]
178
+ ["border-none", { "border-style": "none" }],
179
+ [/^(?:border-)?(?:rounded|rd)$/, handlerRounded],
180
+ [/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?$/, handlerRounded],
181
+ [/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?(?:-([^-]+))?$/, handlerRounded]
197
182
  ];
198
- const borders = [
199
- borderSizes,
200
- borderColors,
201
- borderStyles,
202
- borderRadius
203
- ].flat(1);
204
- function handlerBorder([, a, b]) {
183
+ function handlerBorder(m) {
184
+ const borderSizes = handlerBorderSize(m);
185
+ if (borderSizes) {
186
+ return [
187
+ ...borderSizes,
188
+ ["border-style", "solid"]
189
+ ];
190
+ }
191
+ }
192
+ function handlerBorderSize([, a, b]) {
205
193
  const [d, s = "1"] = directionMap[a] ? [a, b] : ["", a];
206
194
  const v = handler.bracket.px(s);
207
195
  if (v != null) {
208
196
  return [
209
- ...directionMap[d].map((i) => [`border${i}-width`, v]),
210
- ["border-style", "solid"]
197
+ ...directionMap[d].map((i) => [`border${i}-width`, v])
211
198
  ];
212
199
  }
213
200
  }
201
+ function handlerBorderColor([, a, c], ctx) {
202
+ const ofColor = colorResolver$1("border-color", "border")(["", c], ctx);
203
+ if (ofColor) {
204
+ const borders2 = directionMap[directionMap[a] ? a : ""].map((i) => colorResolver$1(`border${i}-color`, "border")(["", c], ctx));
205
+ const borderObject = {};
206
+ Object.assign(borderObject, ...borders2);
207
+ return borderObject;
208
+ }
209
+ }
214
210
  function handlerRounded([, a, b], { theme }) {
215
211
  const [d, s = "DEFAULT"] = cornerMap[a] ? [a, b] : ["", a];
216
212
  const v = theme.borderRadius?.[s] || handler.bracket.fraction.rem(s);
@@ -309,37 +305,27 @@ const transitions = [
309
305
  ];
310
306
 
311
307
  const flex = [
312
- ["flex-col", { "flex-direction": "column" }],
313
- ["flex-col-reverse", { "flex-direction": "column-reverse" }],
314
- ["flex-row", { "flex-direction": "row" }],
315
- ["flex-row-reverse", { "flex-direction": "row-reverse" }],
316
- ["flex-wrap", { "flex-wrap": "wrap" }],
317
- ["flex-wrap-reverse", { "flex-wrap": "wrap-reverse" }],
318
- ["flex-nowrap", { "flex-wrap": "nowrap" }],
308
+ ["flex", { display: "flex" }],
309
+ ["inline-flex", { display: "inline-flex" }],
310
+ ["flex-inline", { display: "inline-flex" }],
319
311
  ["flex-1", { flex: "1 1 0%" }],
320
312
  ["flex-auto", { flex: "1 1 auto" }],
321
313
  ["flex-initial", { flex: "0 1 auto" }],
322
314
  ["flex-none", { flex: "none" }],
323
315
  [/^flex-\[(.+)\]$/, ([, d]) => ({ flex: d })],
324
- ["flex-grow", { "flex-grow": 1 }],
325
- ["flex-grow-0", { "flex-grow": 0 }],
326
316
  ["flex-shrink", { "flex-shrink": 1 }],
327
317
  ["flex-shrink-0", { "flex-shrink": 0 }],
328
- ["flex", { display: "flex" }],
329
- ["inline-flex", { display: "inline-flex" }],
330
- ["flex-inline", { display: "inline-flex" }]
318
+ ["flex-grow", { "flex-grow": 1 }],
319
+ ["flex-grow-0", { "flex-grow": 0 }],
320
+ ["flex-row", { "flex-direction": "row" }],
321
+ ["flex-row-reverse", { "flex-direction": "row-reverse" }],
322
+ ["flex-col", { "flex-direction": "column" }],
323
+ ["flex-col-reverse", { "flex-direction": "column-reverse" }],
324
+ ["flex-wrap", { "flex-wrap": "wrap" }],
325
+ ["flex-wrap-reverse", { "flex-wrap": "wrap-reverse" }],
326
+ ["flex-nowrap", { "flex-wrap": "nowrap" }]
331
327
  ];
332
328
 
333
- const fontsFamilies = [
334
- [/^font-(\w+)$/, ([, d], { theme }) => {
335
- const font = theme.fontFamily?.[d];
336
- if (font) {
337
- return {
338
- "font-family": font
339
- };
340
- }
341
- }]
342
- ];
343
329
  const weightMap = {
344
330
  thin: "100",
345
331
  extralight: "200",
@@ -351,7 +337,15 @@ const weightMap = {
351
337
  extrabold: "800",
352
338
  black: "900"
353
339
  };
354
- const fontSizes = [
340
+ const fonts = [
341
+ [/^font-(\w+)$/, ([, d], { theme }) => {
342
+ const font = theme.fontFamily?.[d];
343
+ if (font) {
344
+ return {
345
+ "font-family": font
346
+ };
347
+ }
348
+ }],
355
349
  [/^text-(.+)$/, ([, s = "base"], { theme }) => {
356
350
  const size = handler.bracket.rem(s);
357
351
  if (size)
@@ -364,30 +358,27 @@ const fontSizes = [
364
358
  "line-height": height
365
359
  };
366
360
  }
367
- }]
368
- ];
369
- const fontWeights = [
361
+ }],
362
+ [/^text-size-(.+)$/, ([, s]) => {
363
+ const raw = handler.bracket.rem(s);
364
+ if (raw)
365
+ return { "font-size": raw };
366
+ }],
370
367
  [/^(?:font|fw)-?([^-]+)$/, ([, s]) => {
371
368
  const v = weightMap[s] || handler.number(s);
372
369
  if (v)
373
370
  return { "font-weight": v };
374
- }]
375
- ];
376
- const leadings = [
371
+ }],
377
372
  [/^(?:leading|lh)-([^-]+)$/, ([, s], { theme }) => {
378
373
  const v = theme.lineHeight?.[s] || handler.bracket.rem(s);
379
374
  if (v !== null)
380
375
  return { "line-height": v };
381
- }]
382
- ];
383
- const trackings = [
376
+ }],
384
377
  [/^tracking-([^-]+)$/, ([, s], { theme }) => {
385
378
  const v = theme.letterSpacing?.[s] || handler.bracket.rem(s);
386
379
  if (v !== null)
387
380
  return { "letter-spacing": v };
388
- }]
389
- ];
390
- const wordSpacings = [
381
+ }],
391
382
  [/^word-spacing-([^-]+)$/, ([, s], { theme }) => {
392
383
  const v = theme.wordSpacing?.[s] || handler.bracket.rem(s);
393
384
  if (v !== null)
@@ -407,20 +398,6 @@ const tabSizes = [
407
398
  }
408
399
  }]
409
400
  ];
410
- const textDecorationLengths = [
411
- [/^underline-([^-]+)$/, ([, s]) => {
412
- const v = s === "auto" ? s : handler.bracket.px(s);
413
- if (v != null)
414
- return { "text-decoration-thickness": v };
415
- }]
416
- ];
417
- const textDecorationOffsets = [
418
- [/^underline-offset-([^-]+)$/, ([, s]) => {
419
- const v = s === "auto" ? s : handler.bracket.px(s);
420
- if (v != null)
421
- return { "text-underline-offset": v };
422
- }]
423
- ];
424
401
  const textIndents = [
425
402
  [/^indent(?:-(.+))?$/, ([, s], { theme }) => {
426
403
  const v = theme.textIndent?.[s || "DEFAULT"] || handler.bracket.cssvar.fraction.rem(s);
@@ -428,12 +405,14 @@ const textIndents = [
428
405
  return { "text-indent": v };
429
406
  }]
430
407
  ];
431
- const textStrokeWidths = [
408
+ const textStrokes = [
432
409
  [/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => {
433
410
  const v = theme.textStrokeWidth?.[s || "DEFAULT"] || handler.bracket.cssvar.px(s);
434
411
  if (v != null)
435
412
  return { "-webkit-text-stroke-width": v };
436
- }]
413
+ }],
414
+ [/^text-stroke-(.+)$/, colorResolver$1("-webkit-text-stroke-color", "text-stroke")],
415
+ [/^text-stroke-op(?:acity)?-?(.+)$/m, ([, opacity]) => ({ "--un-text-stroke-opacity": handler.bracket.percent(opacity) })]
437
416
  ];
438
417
  const textShadows = [
439
418
  [/^text-shadow(?:-(.+))?$/, ([, s], { theme }) => {
@@ -442,11 +421,6 @@ const textShadows = [
442
421
  return { "text-shadow": v };
443
422
  }]
444
423
  ];
445
- const fonts = [
446
- fontsFamilies,
447
- fontSizes,
448
- fontWeights
449
- ].flat(1);
450
424
 
451
425
  const gaps = [
452
426
  [/^(?:flex-|grid-)?gap-([^-]+)$/, ([, s]) => {
@@ -491,12 +465,10 @@ const autoDirection = (selector, theme) => {
491
465
  const grids = [
492
466
  ["grid", { display: "grid" }],
493
467
  ["inline-grid", { display: "inline-grid" }],
494
- [/^grid-cols-minmax-([\w.-]+)$/, ([, d]) => ({ "grid-template-columns": `repeat(auto-fill, minmax(${d}, 1fr))` })],
495
- [/^grid-rows-minmax-([\w.-]+)$/, ([, d]) => ({ "grid-template-rows": `repeat(auto-fill, minmax(${d}, 1fr))` })],
496
- [/^grid-cols-(\d+)$/, ([, d]) => ({ "grid-template-columns": `repeat(${d},minmax(0,1fr))` })],
497
- [/^grid-rows-(\d+)$/, ([, d]) => ({ "grid-template-rows": `repeat(${d},minmax(0,1fr))` })],
498
- [/^grid-cols-\[(.+)\]$/, ([, v]) => ({ "grid-template-columns": v.replace(/,/g, " ") })],
499
- [/^grid-rows-\[(.+)\]$/, ([, v]) => ({ "grid-template-rows": v.replace(/,/g, " ") })],
468
+ [/^(?:grid-)?col-start-([\w.-]+)$/, ([, v]) => ({ "grid-column-start": `${v}` })],
469
+ [/^(?:grid-)?col-end-([\w.]+)$/, ([, v]) => ({ "grid-column-end": `${v}` })],
470
+ [/^(?:grid-)?row-start-([\w.-]+)$/, ([, v]) => ({ "grid-row-start": `${v}` })],
471
+ [/^(?:grid-)?row-end-([\w.-]+)$/, ([, v]) => ({ "grid-row-end": `${v}` })],
500
472
  [/^(?:grid-)?(row|col)-(.+)$/, ([, d, v]) => {
501
473
  const key = d === "row" ? "grid-row" : "grid-column";
502
474
  let raw = handler.bracket(v);
@@ -513,13 +485,15 @@ const grids = [
513
485
  return { [key]: `span ${raw}/span ${raw}` };
514
486
  }
515
487
  }],
488
+ [/^(?:grid-)?auto-cols-([\w.-]+)$/, ([, v], { theme }) => ({ "grid-auto-columns": `${autoDirection(v, theme)}` })],
516
489
  [/^(?:grid-)?auto-flow-([\w.-]+)$/, ([, v]) => ({ "grid-auto-flow": `${v.replace("col", "column").split("-").join(" ")}` })],
517
- [/^(?:grid-)?row-start-([\w.-]+)$/, ([, v]) => ({ "grid-row-start": `${v}` })],
518
- [/^(?:grid-)?row-end-([\w.-]+)$/, ([, v]) => ({ "grid-row-end": `${v}` })],
519
- [/^(?:grid-)?col-start-([\w.-]+)$/, ([, v]) => ({ "grid-column-start": `${v}` })],
520
- [/^(?:grid-)?col-end-([\w.]+)$/, ([, v]) => ({ "grid-column-end": `${v}` })],
521
490
  [/^(?:grid-)?auto-rows-([\w.-]+)$/, ([, v], { theme }) => ({ "grid-auto-rows": `${autoDirection(v, theme)}` })],
522
- [/^(?:grid-)?auto-cols-([\w.-]+)$/, ([, v], { theme }) => ({ "grid-auto-columns": `${autoDirection(v, theme)}` })]
491
+ [/^grid-cols-minmax-([\w.-]+)$/, ([, d]) => ({ "grid-template-columns": `repeat(auto-fill, minmax(${d}, 1fr))` })],
492
+ [/^grid-rows-minmax-([\w.-]+)$/, ([, d]) => ({ "grid-template-rows": `repeat(auto-fill, minmax(${d}, 1fr))` })],
493
+ [/^grid-cols-(\d+)$/, ([, d]) => ({ "grid-template-columns": `repeat(${d},minmax(0,1fr))` })],
494
+ [/^grid-rows-(\d+)$/, ([, d]) => ({ "grid-template-rows": `repeat(${d},minmax(0,1fr))` })],
495
+ [/^grid-cols-\[(.+)\]$/, ([, v]) => ({ "grid-template-columns": v.replace(/,/g, " ") })],
496
+ [/^grid-rows-\[(.+)\]$/, ([, v]) => ({ "grid-template-rows": v.replace(/,/g, " ") })]
523
497
  ];
524
498
 
525
499
  const overflowValues = [
@@ -533,6 +507,7 @@ const overflows = [
533
507
  [/^(?:overflow|of)-([xy])-(.+)$/, ([, d, v]) => overflowValues.includes(v) ? { [`overflow-${d}`]: v } : void 0]
534
508
  ];
535
509
 
510
+ const basicSet = ["auto", "start", "end", "center", "stretch"];
536
511
  const positions = [
537
512
  ["relative", { position: "relative" }],
538
513
  ["absolute", { position: "absolute" }],
@@ -546,47 +521,42 @@ const justifies = [
546
521
  ["justify-center", { "justify-content": "center" }],
547
522
  ["justify-between", { "justify-content": "space-between" }],
548
523
  ["justify-around", { "justify-content": "space-around" }],
549
- ["justify-evenly", { "justify-content": "space-evenly" }]
524
+ ["justify-evenly", { "justify-content": "space-evenly" }],
525
+ ...basicSet.map((i) => [`justify-items-${i}`, { "justify-items": i }]),
526
+ ...basicSet.map((i) => [`justify-self-${i}`, { "justify-self": i }])
550
527
  ];
551
528
  const orders = [
552
529
  [/^order-(.+)$/, ([, v]) => ({ order: { first: "-9999", last: "9999", none: "0" }[v] || handler.bracket.number(v) })]
553
530
  ];
554
- const basicSet = ["auto", "start", "end", "center", "stretch"];
555
- const justifyItems = basicSet.map((i) => [`justify-items-${i}`, { "justify-items": i }]);
556
- const justifySelfs = basicSet.map((i) => [`justify-self-${i}`, { "justify-self": i }]);
557
- const alignContents = [
531
+ const alignments = [
558
532
  ["content-start", { "align-content": "flex-start" }],
559
533
  ["content-end", { "align-content": "flex-end" }],
560
534
  ["content-center", { "align-content": "center" }],
561
535
  ["content-between", { "align-content": "space-between" }],
562
536
  ["content-around", { "align-content": "space-around" }],
563
- ["content-evenly", { "align-content": "space-evenly" }]
564
- ];
565
- const alignItems = [
537
+ ["content-evenly", { "align-content": "space-evenly" }],
566
538
  ["items-start", { "align-items": "flex-start" }],
567
539
  ["items-end", { "align-items": "flex-end" }],
568
540
  ["items-center", { "align-items": "center" }],
569
541
  ["items-baseline", { "align-items": "baseline" }],
570
- ["items-stretch", { "align-items": "stretch" }]
571
- ];
572
- const alignSelfs = [
542
+ ["items-stretch", { "align-items": "stretch" }],
573
543
  ["self-auto", { "align-self": "auto" }],
574
544
  ["self-start", { "align-self": "flex-start" }],
575
545
  ["self-end", { "align-self": "flex-end" }],
576
546
  ["self-center", { "align-self": "center" }],
577
547
  ["self-stretch", { "align-items": "stretch" }]
578
548
  ];
579
- const placeContents = [
549
+ const placements = [
580
550
  ["place-content-start", { "place-content": "start" }],
581
551
  ["place-content-end", { "place-content": "end" }],
582
552
  ["place-content-center", { "place-content": "center" }],
583
553
  ["place-content-between", { "place-content": "space-between" }],
584
554
  ["place-content-around", { "place-content": "space-around" }],
585
555
  ["place-content-evenly", { "place-content": "space-evenly" }],
586
- ["place-content-stretch", { "place-content": "stretch" }]
556
+ ["place-content-stretch", { "place-content": "stretch" }],
557
+ ...basicSet.map((i) => [`place-items-${i}`, { "place-items": i }]),
558
+ ...basicSet.map((i) => [`place-self-${i}`, { "place-self": i }])
587
559
  ];
588
- const placeItems = basicSet.map((i) => [`place-items-${i}`, { "place-items": i }]);
589
- const placeSelfs = basicSet.map((i) => [`place-self-${i}`, { "place-self": i }]);
590
560
  function handleInsetValue(v) {
591
561
  return { auto: "auto", full: "100%" }[v] ?? handler.bracket.fraction.cssvar.rem(v);
592
562
  }
@@ -777,17 +747,6 @@ const textTransforms = [
777
747
  ["case-capital", { "text-transform": "capitalize" }],
778
748
  ["case-normal", { "text-transform": "none" }]
779
749
  ];
780
- const textDecorations = [
781
- ["underline", { "text-decoration": "underline" }],
782
- ["line-through", { "text-decoration": "line-through" }],
783
- ["no-underline", { "text-decoration": "none" }]
784
- ];
785
- const textDecorationStyles = [
786
- ["underline-solid", { "text-decoration-style": "solid" }],
787
- ["underline-double", { "text-decoration-style": "double" }],
788
- ["underline-dotted", { "text-decoration-style": "dotted" }],
789
- ["underline-dashed", { "text-decoration-style": "dashed" }]
790
- ];
791
750
  const fontStyles = [
792
751
  ["italic", { "font-style": "italic" }],
793
752
  ["not-italic", { "font-style": "normal" }]
@@ -885,19 +844,12 @@ const variablesAbbrMap = {
885
844
  "backface": "backface-visibility",
886
845
  "whitespace": "white-space",
887
846
  "break": "word-break",
847
+ "b": "border-color",
848
+ "border": "border-color",
888
849
  "color": "color",
889
850
  "case": "text-transform",
890
- "write": "writing-mode",
891
- "write-orient": "text-orientation",
892
851
  "origin": "transform-origin",
893
852
  "bg": "background-color",
894
- "bg-blend": "background-blend-mode",
895
- "bg-clip": "-webkit-background-clip",
896
- "bg-gradient": "linear-gradient",
897
- "bg-origin-border": "background-origin",
898
- "bg-position": "background-position",
899
- "bg-repeat": "background-repeat",
900
- "bg-size": "background-size",
901
853
  "bg-opacity": "background-opacity",
902
854
  "tab": "tab-size",
903
855
  "underline": "text-decoration-thickness",
@@ -912,33 +864,61 @@ const variablesAbbrMap = {
912
864
  "content": "align-content",
913
865
  "items": "align-items",
914
866
  "self": "align-self",
915
- "object": "object-fit",
916
- "mix-blend": "mix-blend-mode",
917
- "animate-speed": "animation-speed"
867
+ "object": "object-fit"
918
868
  };
919
- const cssVariables = [[
920
- /^(.+)-\$(.+)$/,
921
- ([, name, varname]) => {
869
+ const cssVariables = [
870
+ [/^(.+)-\$(.+)$/, ([, name, varname]) => {
922
871
  const prop = variablesAbbrMap[name];
923
872
  if (prop) {
924
873
  return {
925
874
  [prop]: `var(--${varname})`
926
875
  };
927
876
  }
928
- }
929
- ]];
877
+ }],
878
+ [/^(?:border|b)-([^-]+)-\$(.+)$/, ([, a, v]) => {
879
+ if (a in directionMap)
880
+ return directionMap[a].map((i) => [`border${i}-color`, `var(--${v})`]);
881
+ }]
882
+ ];
930
883
 
931
884
  const questionMark = [
932
885
  [
933
886
  /^(where|\?)$/,
934
887
  (_, { constructCSS, generator }) => {
935
- if (generator.config.envMode === "dev")
888
+ if (generator.userConfig.envMode === "dev")
936
889
  return `@keyframes __un_qm{0%{box-shadow:inset 4px 4px #ff1e90, inset -4px -4px #ff1e90}100%{box-shadow:inset 8px 8px #3399ff, inset -8px -8px #3399ff}}
937
890
  ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
938
891
  }
939
892
  ]
940
893
  ];
941
894
 
895
+ const textDecorations = [
896
+ ["underline", { "text-decoration": "underline" }],
897
+ ["line-through", { "text-decoration": "line-through" }],
898
+ ["no-underline", { "text-decoration": "none" }],
899
+ ["decoration-underline", { "text-decoration": "underline" }],
900
+ ["decoration-line-through", { "text-decoration": "line-through" }],
901
+ ["decoration-none", { "text-decoration": "none" }],
902
+ [/^(?:underline|decoration)-(solid|double|dotted|dashed|wavy)$/, ([, d]) => ({ "text-decoration-style": d })],
903
+ [/^(?:underline|decoration)-([^-]+)$/, ([, s]) => ({ "text-decoration-thickness": ["auto", "from-font"].includes(s) ? s : handler.bracket.px(s) })],
904
+ [/^decoration-(.*)$/, ([, d]) => ({ "text-decoration-thickness": handler.bracket.px(d) })],
905
+ [/^underline-offset-([^-]+)$/, ([, s]) => {
906
+ const v = s === "auto" ? s : handler.bracket.px(s);
907
+ if (v != null)
908
+ return { "text-underline-offset": v };
909
+ }],
910
+ [/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
911
+ const result = colorResolver$1("text-decoration-color", "line")(match, ctx);
912
+ if (result) {
913
+ return {
914
+ "-webkit-text-decoration-color": result["text-decoration-color"],
915
+ ...result
916
+ };
917
+ }
918
+ }],
919
+ [/^(?:underline|decoration)-op(?:acity)?-?(.+)$/m, ([, opacity]) => ({ "--un-line-opacity": handler.bracket.percent(opacity) })]
920
+ ];
921
+
942
922
  const rules = [
943
923
  cssVariables,
944
924
  paddings,
@@ -954,12 +934,7 @@ const rules = [
954
934
  textIndents,
955
935
  textOverflows,
956
936
  textDecorations,
957
- textDecorationStyles,
958
- textDecorationColors,
959
- textDecorationLengths,
960
- textDecorationOffsets,
961
- textStrokeWidths,
962
- textStrokeColors,
937
+ textStrokes,
963
938
  textShadows,
964
939
  textTransforms,
965
940
  textAligns,
@@ -982,9 +957,6 @@ const rules = [
982
957
  userSelects,
983
958
  whitespaces,
984
959
  breaks,
985
- trackings,
986
- wordSpacings,
987
- leadings,
988
960
  overflows,
989
961
  outline,
990
962
  appearance,
@@ -992,14 +964,8 @@ const rules = [
992
964
  positions,
993
965
  orders,
994
966
  justifies,
995
- justifyItems,
996
- justifySelfs,
997
- alignContents,
998
- alignItems,
999
- alignSelfs,
1000
- placeContents,
1001
- placeItems,
1002
- placeSelfs,
967
+ alignments,
968
+ placements,
1003
969
  insets,
1004
970
  floats,
1005
971
  zIndexes,
@@ -1009,4 +975,4 @@ const rules = [
1009
975
  questionMark
1010
976
  ].flat(1);
1011
977
 
1012
- export { userSelects as $, justifies as A, orders as B, justifyItems as C, justifySelfs as D, alignContents as E, alignItems as F, alignSelfs as G, placeContents as H, placeItems as I, placeSelfs as J, insets as K, floats as L, zIndexes as M, boxSizing as N, questionMark as O, rings as P, boxShadows as Q, sizes as R, aspectRatio as S, paddings as T, margins as U, varEmpty as V, displays as W, appearances as X, cursors as Y, pointerEvents as Z, resizes as _, appearance as a, whitespaces as a0, contents as a1, breaks as a2, textOverflows as a3, textTransforms as a4, textDecorations as a5, textDecorationStyles as a6, fontStyles as a7, fontSmoothings as a8, transforms as a9, transitions as aa, fontsFamilies as ab, fontSizes as ac, fontWeights as ad, leadings as ae, trackings as af, wordSpacings as ag, tabSizes as ah, textDecorationLengths as ai, textDecorationOffsets as aj, textIndents as ak, textStrokeWidths as al, textShadows as am, fonts as an, cssVariables as ao, borderSizes as b, borderRadius as c, borderStyles as d, borders as e, parseColorUtil as f, colorResolver$1 as g, opacity as h, textColors as i, textDecorationColors as j, textStrokeColors as k, bgColors as l, borderColors as m, ringColors as n, outline as o, placeholder as p, ringOffsetColors as q, rules as r, fillColors as s, textAligns as t, flex as u, verticalAligns as v, gaps as w, grids as x, overflows as y, positions as z };
978
+ export { tabSizes as $, floats as A, zIndexes as B, boxSizing as C, questionMark as D, rings as E, boxShadows as F, sizes as G, aspectRatio as H, paddings as I, margins as J, varEmpty as K, displays as L, appearances as M, cursors as N, pointerEvents as O, resizes as P, userSelects as Q, whitespaces as R, contents as S, breaks as T, textOverflows as U, textTransforms as V, fontStyles as W, fontSmoothings as X, transforms as Y, transitions as Z, fonts as _, appearance as a, textIndents as a0, textStrokes as a1, textShadows as a2, cssVariables as a3, textDecorations as a4, borders as b, parseColorUtil as c, colorResolver$1 as d, opacity as e, textColors as f, bgColors as g, borderColors as h, ringColors as i, ringOffsetColors as j, fillColors as k, flex as l, gaps as m, grids as n, outline as o, placeholder as p, overflows as q, rules as r, positions as s, textAligns as t, justifies as u, verticalAligns as v, orders as w, alignments as x, placements as y, insets as z };
@@ -8,20 +8,22 @@ const variantBreakpoints = (matcher, _, theme) => {
8
8
  const variantEntries = Object.entries(theme.breakpoints || {}).map(([point, size], idx) => [point, size, idx]);
9
9
  for (const [point, size, idx] of variantEntries) {
10
10
  if (!regexCache[point])
11
- regexCache[point] = new RegExp(`^((?:[a|l]t-)?${point}[:-])`);
11
+ regexCache[point] = new RegExp(`^((?:[al]t-)?${point}[:-])`);
12
12
  const match = matcher.match(regexCache[point]);
13
13
  if (!match)
14
14
  continue;
15
15
  const [, pre] = match;
16
+ const m = matcher.slice(pre.length);
17
+ if (m === "container")
18
+ continue;
16
19
  let direction = "min";
17
- let order = parseInt(size);
20
+ let order = 1e3;
18
21
  if (pre.startsWith("lt-")) {
19
22
  direction = "max";
20
- order = -order;
23
+ order -= idx + 1;
24
+ } else {
25
+ order += idx + 1;
21
26
  }
22
- const m = matcher.slice(pre.length);
23
- if (m === "container")
24
- continue;
25
27
  if (pre.startsWith("at-") && idx < variantEntries.length - 1) {
26
28
  return {
27
29
  matcher: m,
@@ -6,20 +6,22 @@ const variantBreakpoints = (matcher, _, theme) => {
6
6
  const variantEntries = Object.entries(theme.breakpoints || {}).map(([point, size], idx) => [point, size, idx]);
7
7
  for (const [point, size, idx] of variantEntries) {
8
8
  if (!regexCache[point])
9
- regexCache[point] = new RegExp(`^((?:[a|l]t-)?${point}[:-])`);
9
+ regexCache[point] = new RegExp(`^((?:[al]t-)?${point}[:-])`);
10
10
  const match = matcher.match(regexCache[point]);
11
11
  if (!match)
12
12
  continue;
13
13
  const [, pre] = match;
14
+ const m = matcher.slice(pre.length);
15
+ if (m === "container")
16
+ continue;
14
17
  let direction = "min";
15
- let order = parseInt(size);
18
+ let order = 1e3;
16
19
  if (pre.startsWith("lt-")) {
17
20
  direction = "max";
18
- order = -order;
21
+ order -= idx + 1;
22
+ } else {
23
+ order += idx + 1;
19
24
  }
20
- const m = matcher.slice(pre.length);
21
- if (m === "container")
22
- continue;
23
25
  if (pre.startsWith("at-") && idx < variantEntries.length - 1) {
24
26
  return {
25
27
  matcher: m,
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ const core = require('@unocss/core');
4
+
3
5
  const directionMap = {
4
6
  "l": ["-left"],
5
7
  "r": ["-right"],
@@ -111,7 +113,7 @@ function global(str) {
111
113
  return str;
112
114
  }
113
115
 
114
- const handlers = {
116
+ const valueHandlers = {
115
117
  __proto__: null,
116
118
  rem: rem,
117
119
  px: px,
@@ -124,51 +126,17 @@ const handlers = {
124
126
  global: global
125
127
  };
126
128
 
127
- const handlersNames = Object.keys(handlers);
128
- const handler = function(str) {
129
- const s = this.__options?.sequence || [];
130
- this.__options.sequence = [];
131
- for (const n of s) {
132
- const res = handlers[n](str);
133
- if (res != null)
134
- return res;
135
- }
136
- return void 0;
137
- };
138
- function addProcessor(that, name) {
139
- if (!that.__options) {
140
- that.__options = {
141
- sequence: []
142
- };
143
- }
144
- that.__options.sequence.push(name);
145
- return that;
146
- }
147
- handlersNames.forEach((i) => {
148
- Object.defineProperty(handler, i, {
149
- enumerable: true,
150
- get() {
151
- return addProcessor(this, i);
152
- }
153
- });
154
- });
129
+ const handler = core.createValueHandler(valueHandlers);
130
+ const h = handler;
155
131
 
156
132
  function capitalize(str) {
157
133
  return str.charAt(0).toUpperCase() + str.slice(1);
158
134
  }
159
135
 
160
- exports.bracket = bracket;
161
136
  exports.capitalize = capitalize;
162
137
  exports.cornerMap = cornerMap;
163
- exports.cssvar = cssvar;
164
138
  exports.directionMap = directionMap;
165
- exports.fraction = fraction;
166
- exports.global = global;
139
+ exports.h = h;
167
140
  exports.handler = handler;
168
- exports.handlersNames = handlersNames;
169
- exports.number = number;
170
- exports.percent = percent;
171
- exports.px = px;
172
- exports.rem = rem;
173
- exports.time = time;
141
+ exports.valueHandlers = valueHandlers;
174
142
  exports.xyzMap = xyzMap;