@unocss/preset-mini 0.16.0 → 0.16.4

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,6 +1,6 @@
1
1
  import { hex2rgba, toArray } from '@unocss/core';
2
- import { h as handler, d as directionMap, c as cornerMap, a as capitalize, x as xyzMap } from './index.mjs';
3
- import { C as CONTROL_BYPASS_PSEUDO } from './pseudo.mjs';
2
+ import { h as handler, d as directionMap, c as cornerMap, a as capitalize, b as directionSize, x as xyzMap } from './utilities.mjs';
3
+ import { C as CONTROL_BYPASS_PSEUDO_CLASS } from './pseudo.mjs';
4
4
 
5
5
  const verticalAlignAlias = {
6
6
  mid: "middle",
@@ -19,7 +19,8 @@ const textAligns = [
19
19
 
20
20
  const parseColorUtil = (body, theme) => {
21
21
  const [main, opacity2] = body.split(/(?:\/|:)/);
22
- const [name, no = "DEFAULT"] = main.replace(/([a-z])([0-9])/g, "$1-$2").split(/-/g);
22
+ const colors = main.replace(/([a-z])([0-9])/g, "$1-$2").split(/-/g);
23
+ const [name] = colors;
23
24
  if (!name)
24
25
  return;
25
26
  let color;
@@ -30,8 +31,16 @@ const parseColorUtil = (body, theme) => {
30
31
  if (bracketOrMain.startsWith("hex-"))
31
32
  color = bracketOrMain.slice(4);
32
33
  color = color || bracket;
34
+ let no = "DEFAULT";
33
35
  if (!color) {
34
- const colorData = theme.colors?.[name];
36
+ let colorData = theme.colors?.[name];
37
+ if (colorData) {
38
+ [, no = no] = colors;
39
+ } else {
40
+ if (colors.slice(-1)[0].match(/^\d+$/))
41
+ no = colors.pop();
42
+ colorData = theme.colors?.[colors.join("-").replace(/(-[a-z])/g, (n) => n.slice(1).toUpperCase())];
43
+ }
35
44
  if (typeof colorData === "string")
36
45
  color = colorData;
37
46
  else if (no && colorData)
@@ -94,16 +103,136 @@ const ringOffsetColors = [
94
103
  [/^ring-offset-(.+)$/, colorResolver$1("--un-ring-offset-color", "ring-offset")],
95
104
  [/^ring-offset-op(?:acity)?-?(.+)$/m, ([, opacity2]) => ({ "--un-ring-offset-opacity": handler.bracket.percent(opacity2) })]
96
105
  ];
97
- const fillColors = [
98
- ["fill-none", { fill: "none" }],
99
- [/^fill-(.+)$/, colorResolver$1("fill", "fill")],
100
- [/^fill-op(?:acity)?-?(.+)$/m, ([, opacity2]) => ({ "--un-fill-opacity": handler.bracket.percent(opacity2) })]
106
+
107
+ const cssBasicProps = [
108
+ "color",
109
+ "border-color",
110
+ "background-color",
111
+ "flex-grow",
112
+ "flex",
113
+ "flex-shrink",
114
+ "caret-color",
115
+ "font",
116
+ "gap",
117
+ "opacity",
118
+ "visibility",
119
+ "z-index",
120
+ "font-weight",
121
+ "zoom",
122
+ "text-shadow",
123
+ "transform",
124
+ "box-shadow"
125
+ ];
126
+ const cssPositionProps = [
127
+ "backround-position",
128
+ "left",
129
+ "right",
130
+ "top",
131
+ "bottom",
132
+ "object-position"
133
+ ];
134
+ const cssSizeProps = [
135
+ "max-height",
136
+ "min-height",
137
+ "max-width",
138
+ "min-width",
139
+ "height",
140
+ "width",
141
+ "border-width",
142
+ "margin",
143
+ "padding",
144
+ "outline-width",
145
+ "outline-offset",
146
+ "font-size",
147
+ "line-height",
148
+ "text-indent",
149
+ "vertical-align",
150
+ "border-spacing",
151
+ "letter-spacing",
152
+ "word-spacing"
153
+ ];
154
+ const cssEnhanceProps = ["stroke", "filter", "backdrop-filter", "fill", "mask", "mask-size", "mask-border", "clip-path", "clip"];
155
+ const cssProps = [
156
+ ...cssBasicProps,
157
+ ...cssPositionProps,
158
+ ...cssSizeProps,
159
+ ...cssEnhanceProps
160
+ ];
161
+ const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
162
+ const displays = [
163
+ ["inline", { display: "inline" }],
164
+ ["block", { display: "block" }],
165
+ ["inline-block", { display: "inline-block" }],
166
+ ["contents", { display: "contents" }],
167
+ ["flow-root", { display: "flow-root" }],
168
+ ["list-item", { display: "list-item" }],
169
+ ["hidden", { display: "none" }]
170
+ ];
171
+ const appearances = [
172
+ ["visible", { visibility: "visible" }],
173
+ ["invisible", { visibility: "hidden" }],
174
+ ["backface-visible", { "backface-visibility": "visible" }],
175
+ ["backface-hidden", { "backface-visibility": "hidden" }]
176
+ ];
177
+ const cursors = [
178
+ [/^cursor-(.+)$/, ([, c]) => ({ cursor: c })]
179
+ ];
180
+ const pointerEvents = [
181
+ ["pointer-events-none", { "pointer-events": "none" }],
182
+ ["pointer-events-auto", { "pointer-events": "auto" }]
183
+ ];
184
+ const resizes = [
185
+ ["resize-none", { resize: "none" }],
186
+ ["resize-x", { resize: "horizontal" }],
187
+ ["resize-y", { resize: "vertical" }],
188
+ ["resize", { resize: "both" }]
189
+ ];
190
+ const userSelects = [
191
+ [/^select-(none|text|all|auto)$/, ([, v]) => ({ "user-select": v })]
192
+ ];
193
+ const whitespaces = [
194
+ [/^(?:whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap)$/, ([, v]) => ({ "white-space": v })]
195
+ ];
196
+ const contents = [
197
+ ["content-empty", { content: '""' }]
198
+ ];
199
+ const breaks = [
200
+ ["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }],
201
+ ["break-word", { "overflow-wrap": "break-word" }],
202
+ ["break-all", { "word-break": "break-all" }]
203
+ ];
204
+ const textOverflows = [
205
+ ["truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
206
+ ["text-ellipsis", { "text-overflow": "ellipsis" }],
207
+ ["text-clip", { "text-overflow": "clip" }]
208
+ ];
209
+ const textTransforms = [
210
+ ["case-upper", { "text-transform": "uppercase" }],
211
+ ["case-lower", { "text-transform": "lowercase" }],
212
+ ["case-capital", { "text-transform": "capitalize" }],
213
+ ["case-normal", { "text-transform": "none" }]
214
+ ];
215
+ const fontStyles = [
216
+ ["italic", { "font-style": "italic" }],
217
+ ["not-italic", { "font-style": "normal" }]
218
+ ];
219
+ const fontSmoothings = [
220
+ ["antialiased", {
221
+ "-webkit-font-smoothing": "antialiased",
222
+ "-moz-osx-font-smoothing": "grayscale",
223
+ "font-smoothing": "grayscale"
224
+ }],
225
+ ["subpixel-antialiased", {
226
+ "-webkit-font-smoothing": "auto",
227
+ "-moz-osx-font-smoothing": "auto",
228
+ "font-smoothing": "auto"
229
+ }]
101
230
  ];
102
231
 
103
232
  const outlineStyle = ["none", "auto", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset", "inherit", "initial", "revert", "unset"];
104
233
  const parseOutlineSize = (s) => {
105
234
  const propName = ["width", "offset"].find((item) => s.startsWith(item)) || "width";
106
- const size = handler.bracket.fraction.rem(s.replace(/^(offset\-|width\-)/, ""));
235
+ const size = handler.bracket.fraction.rem(s.replace(/^(offset\-|width\-|size\-)/, ""));
107
236
  if (size) {
108
237
  return {
109
238
  [`outline-${propName}`]: size
@@ -128,15 +257,15 @@ const outline = [
128
257
  "outline-style": d
129
258
  };
130
259
  }
131
- const sizeSheet = parseOutlineSize(d);
132
- if (sizeSheet)
133
- return sizeSheet;
134
260
  const colorSheet = colorResolver$1("outline-color", "outline-color")([
135
261
  match[0],
136
262
  match[1].replace(/^color-/, "")
137
263
  ], config);
138
264
  if (colorSheet)
139
265
  return colorSheet;
266
+ const sizeSheet = parseOutlineSize(d);
267
+ if (sizeSheet)
268
+ return sizeSheet;
140
269
  }
141
270
  ]
142
271
  ];
@@ -161,11 +290,29 @@ const placeholder = [
161
290
  }
162
291
  ]
163
292
  ];
293
+ const cssPropsStr = cssProps.join(", ");
294
+ const validateProperty$1 = (prop) => {
295
+ if (prop && !cssProps.includes(prop))
296
+ return;
297
+ return prop || cssPropsStr;
298
+ };
299
+ const willChange = [
300
+ [/^will-change-(.*)/, ([, p]) => {
301
+ const w = validateProperty$1(p) || handler.global(p);
302
+ if (w)
303
+ return { "will-change": w };
304
+ }]
305
+ ];
164
306
 
165
307
  const borders = [
166
308
  [/^border$/, handlerBorder],
167
- [/^(?:border|b)(?:-([^-]+))?$/, handlerBorder],
168
- [/^(?:border|b)(?:-([^-]+))?(?:-([^-]+))?$/, handlerBorder],
309
+ [/^(?:border|b)()-(.+)$/, handlerBorder],
310
+ [/^(?:border|b)-([^-]+)(?:-(.+))?$/, handlerBorder],
311
+ [/^(?:border|b)()-size-(.+)$/, handlerBorderSize],
312
+ [/^(?:border|b)-([^-]+)-size-(.+)$/, handlerBorderSize],
313
+ [/^(?:border|b)()-(.+)$/, handlerBorderColor],
314
+ [/^(?:border|b)-([^-]+)(?:-(.+))?$/, handlerBorderColor],
315
+ [/^(?:border|b)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-border-opacity": handler.bracket.percent(opacity) })],
169
316
  ["border-solid", { "border-style": "solid" }],
170
317
  ["border-dashed", { "border-style": "dashed" }],
171
318
  ["border-dotted", { "border-style": "dotted" }],
@@ -173,20 +320,37 @@ const borders = [
173
320
  ["border-none", { "border-style": "none" }],
174
321
  [/^(?:border-)?(?:rounded|rd)$/, handlerRounded],
175
322
  [/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?$/, handlerRounded],
176
- [/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?(?:-([^-]+))?$/, handlerRounded],
177
- [/^(?:border|b)-(.+)$/, colorResolver$1("border-color", "border")],
178
- [/^(?:border|b)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-border-opacity": handler.bracket.percent(opacity) })]
323
+ [/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?(?:-([^-]+))?$/, handlerRounded]
179
324
  ];
180
- function handlerBorder([, a, b]) {
325
+ function handlerBorder(m) {
326
+ const borderSizes = handlerBorderSize(m);
327
+ if (borderSizes) {
328
+ return [
329
+ ...borderSizes,
330
+ ["border-style", "solid"]
331
+ ];
332
+ }
333
+ }
334
+ function handlerBorderSize([, a, b]) {
181
335
  const [d, s = "1"] = directionMap[a] ? [a, b] : ["", a];
182
336
  const v = handler.bracket.px(s);
183
337
  if (v != null) {
184
338
  return [
185
- ...directionMap[d].map((i) => [`border${i}-width`, v]),
186
- ["border-style", "solid"]
339
+ ...directionMap[d].map((i) => [`border${i}-width`, v])
187
340
  ];
188
341
  }
189
342
  }
343
+ function handlerBorderColor([, a, c], ctx) {
344
+ if (c !== void 0) {
345
+ const ofColor = colorResolver$1("border-color", "border")(["", c], ctx);
346
+ if (ofColor) {
347
+ const borders2 = directionMap[directionMap[a] ? a : ""].map((i) => colorResolver$1(`border${i}-color`, "border")(["", c], ctx));
348
+ const borderObject = {};
349
+ Object.assign(borderObject, ...borders2);
350
+ return borderObject;
351
+ }
352
+ }
353
+ }
190
354
  function handlerRounded([, a, b], { theme }) {
191
355
  const [d, s = "DEFAULT"] = cornerMap[a] ? [a, b] : ["", a];
192
356
  const v = theme.borderRadius?.[s] || handler.bracket.fraction.rem(s);
@@ -194,64 +358,10 @@ function handlerRounded([, a, b], { theme }) {
194
358
  return cornerMap[d].map((i) => [`border${i}-radius`, v]);
195
359
  }
196
360
 
197
- const transitionBasicProps = [
198
- "color",
199
- "border-color",
200
- "background-color",
201
- "flex-grow",
202
- "flex",
203
- "flex-shrink",
204
- "caret-color",
205
- "font",
206
- "gap",
207
- "opacity",
208
- "visibility",
209
- "z-index",
210
- "font-weight",
211
- "zoom",
212
- "text-shadow",
213
- "transform",
214
- "box-shadow"
215
- ];
216
- const transitionPositionProps = [
217
- "backround-position",
218
- "left",
219
- "right",
220
- "top",
221
- "bottom",
222
- "object-position"
223
- ];
224
- const transitionSizeProps = [
225
- "max-height",
226
- "min-height",
227
- "max-width",
228
- "min-width",
229
- "height",
230
- "width",
231
- "border-width",
232
- "margin",
233
- "padding",
234
- "outline-width",
235
- "outline-offset",
236
- "font-size",
237
- "line-height",
238
- "text-indent",
239
- "vertical-align",
240
- "border-spacing",
241
- "letter-spacing",
242
- "word-spacing"
243
- ];
244
361
  const transitionSwitchProps = ["all", "none"];
245
- const transitionEnhanceProps = ["stroke", "filter", "backdrop-filter", "fill", "mask", "mask-size", "mask-border", "clip-path", "clip"];
246
- const transitionProps = [
247
- ...transitionBasicProps,
248
- ...transitionPositionProps,
249
- ...transitionSizeProps,
250
- ...transitionEnhanceProps
251
- ];
252
- const transitionPropsStr = transitionProps.join(", ");
362
+ const transitionPropsStr = cssProps.join(", ");
253
363
  const validateProperty = (prop) => {
254
- if (prop && ![...transitionProps, ...transitionSwitchProps].includes(prop))
364
+ if (prop && ![...cssProps, ...transitionSwitchProps].includes(prop))
255
365
  return;
256
366
  return prop || transitionPropsStr;
257
367
  };
@@ -576,8 +686,8 @@ const rings = [
576
686
  "--un-ring-color": "rgba(59, 130, 246, .5)",
577
687
  "--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)",
578
688
  "--un-ring-shadow": `var(--un-ring-inset) 0 0 0 calc(${value} + var(--un-ring-offset-width)) var(--un-ring-color)`,
579
- "-webkit-box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow, 0 0 #0000);",
580
- "box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow, 0 0 #0000);"
689
+ "-webkit-box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow, 0 0 #0000)",
690
+ "box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow, 0 0 #0000)"
581
691
  };
582
692
  }
583
693
  }],
@@ -657,11 +767,6 @@ const aspectRatio = [
657
767
  }]
658
768
  ];
659
769
 
660
- const directionSize = (prefix) => ([_, direction, size]) => {
661
- const v = handler.bracket.rem.fraction.cssvar(size);
662
- if (v)
663
- return directionMap[direction].map((i) => [prefix + i, v]);
664
- };
665
770
  const paddings = [
666
771
  [/^pa?()-?(-?.+)$/, directionSize("padding")],
667
772
  [/^p-?([xy])-?(-?.+)$/, directionSize("padding")],
@@ -673,84 +778,13 @@ const margins = [
673
778
  [/^m-?([rltbse])-?(-?.+)$/, directionSize("margin")]
674
779
  ];
675
780
 
676
- const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
677
- const displays = [
678
- ["inline", { display: "inline" }],
679
- ["block", { display: "block" }],
680
- ["inline-block", { display: "inline-block" }],
681
- ["contents", { display: "contents" }],
682
- ["flow-root", { display: "flow-root" }],
683
- ["list-item", { display: "list-item" }],
684
- ["hidden", { display: "none" }]
685
- ];
686
- const appearances = [
687
- ["visible", { visibility: "visible" }],
688
- ["invisible", { visibility: "hidden" }],
689
- ["backface-visible", { "backface-visibility": "visible" }],
690
- ["backface-hidden", { "backface-visibility": "hidden" }]
691
- ];
692
- const cursors = [
693
- [/^cursor-(.+)$/, ([, c]) => ({ cursor: c })]
694
- ];
695
- const pointerEvents = [
696
- ["pointer-events-none", { "pointer-events": "none" }],
697
- ["pointer-events-auto", { "pointer-events": "auto" }]
698
- ];
699
- const resizes = [
700
- ["resize-none", { resize: "none" }],
701
- ["resize-x", { resize: "horizontal" }],
702
- ["resize-y", { resize: "vertical" }],
703
- ["resize", { resize: "both" }]
704
- ];
705
- const userSelects = [
706
- [/^select-(none|text|all|auto)$/, ([, v]) => ({ "user-select": v })]
707
- ];
708
- const whitespaces = [
709
- [/^(?:whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap)$/, ([, v]) => ({ "white-space": v })]
710
- ];
711
- const contents = [
712
- ["content-empty", { content: '""' }]
713
- ];
714
- const breaks = [
715
- ["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }],
716
- ["break-word", { "overflow-wrap": "break-word" }],
717
- ["break-all", { "word-break": "break-all" }]
718
- ];
719
- const textOverflows = [
720
- ["truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
721
- ["text-ellipsis", { "text-overflow": "ellipsis" }],
722
- ["text-clip", { "text-overflow": "clip" }]
723
- ];
724
- const textTransforms = [
725
- ["case-upper", { "text-transform": "uppercase" }],
726
- ["case-lower", { "text-transform": "lowercase" }],
727
- ["case-capital", { "text-transform": "capitalize" }],
728
- ["case-normal", { "text-transform": "none" }]
729
- ];
730
- const fontStyles = [
731
- ["italic", { "font-style": "italic" }],
732
- ["not-italic", { "font-style": "normal" }]
733
- ];
734
- const fontSmoothings = [
735
- ["antialiased", {
736
- "-webkit-font-smoothing": "antialiased",
737
- "-moz-osx-font-smoothing": "grayscale",
738
- "font-smoothing": "grayscale"
739
- }],
740
- ["subpixel-antialiased", {
741
- "-webkit-font-smoothing": "auto",
742
- "-moz-osx-font-smoothing": "auto",
743
- "font-smoothing": "auto"
744
- }]
745
- ];
746
-
747
781
  const transformGpu = {
748
782
  transform: "rotate(var(--un-rotate)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) translate3d(var(--un-translate-x), var(--un-translate-y), var(--un-translate-z))",
749
- [CONTROL_BYPASS_PSEUDO]: ""
783
+ [CONTROL_BYPASS_PSEUDO_CLASS]: ""
750
784
  };
751
785
  const transformCpu = {
752
786
  transform: "rotate(var(--un-rotate)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z))",
753
- [CONTROL_BYPASS_PSEUDO]: ""
787
+ [CONTROL_BYPASS_PSEUDO_CLASS]: ""
754
788
  };
755
789
  const transformBase = {
756
790
  "--un-rotate": 0,
@@ -767,11 +801,12 @@ const transformBase = {
767
801
  const transforms = [
768
802
  ["transform", transformBase],
769
803
  [/^preserve-(3d|flat)$/, ([, value]) => ({ "transform-style": value === "3d" ? `preserve-${value}` : value })],
770
- [/^translate()-([^-]+)$/, handleTranslate],
771
- [/^translate-([xyz])-([^-]+)$/, handleTranslate],
772
- [/^scale()-([^-]+)$/, handleScale],
773
- [/^scale-([xyz])-([^-]+)$/, handleScale],
774
- [/^rotate-([^-]+)(?:deg)?$/, handleRotate],
804
+ [/^translate()-(.+)$/, handleTranslate],
805
+ [/^translate-([xyz])-(.+)$/, handleTranslate],
806
+ [/^scale()-(.+)$/, handleScale],
807
+ [/^scale-([xyz])-(.+)$/, handleScale],
808
+ [/^rotate-(.+)$/, handleRotate],
809
+ [/^rotate-((?!\[)[^-]+?)(?:deg)?$/, handleRotateWithUnit],
775
810
  ["transform-gpu", transformGpu],
776
811
  ["transform-cpu", transformCpu],
777
812
  ["transform-none", { transform: "none" }],
@@ -807,7 +842,7 @@ function handleScale([, d, b]) {
807
842
  ];
808
843
  }
809
844
  }
810
- function handleRotate([, b]) {
845
+ function handleRotateWithUnit([, b]) {
811
846
  const v = handler.bracket.number(b);
812
847
  if (v != null) {
813
848
  return [
@@ -816,6 +851,15 @@ function handleRotate([, b]) {
816
851
  ];
817
852
  }
818
853
  }
854
+ function handleRotate([, b]) {
855
+ const v = handler.bracket(b);
856
+ if (v != null) {
857
+ return [
858
+ transformBase,
859
+ { "--un-rotate": v }
860
+ ];
861
+ }
862
+ }
819
863
 
820
864
  const variablesAbbrMap = {
821
865
  "visible": "visibility",
@@ -824,6 +868,8 @@ const variablesAbbrMap = {
824
868
  "backface": "backface-visibility",
825
869
  "whitespace": "white-space",
826
870
  "break": "word-break",
871
+ "b": "border-color",
872
+ "border": "border-color",
827
873
  "color": "color",
828
874
  "case": "text-transform",
829
875
  "origin": "transform-origin",
@@ -844,23 +890,26 @@ const variablesAbbrMap = {
844
890
  "self": "align-self",
845
891
  "object": "object-fit"
846
892
  };
847
- const cssVariables = [[
848
- /^(.+)-\$(.+)$/,
849
- ([, name, varname]) => {
893
+ const cssVariables = [
894
+ [/^(.+)-\$(.+)$/, ([, name, varname]) => {
850
895
  const prop = variablesAbbrMap[name];
851
896
  if (prop) {
852
897
  return {
853
898
  [prop]: `var(--${varname})`
854
899
  };
855
900
  }
856
- }
857
- ]];
901
+ }],
902
+ [/^(?:border|b)-([^-]+)-\$(.+)$/, ([, a, v]) => {
903
+ if (a in directionMap)
904
+ return directionMap[a].map((i) => [`border${i}-color`, `var(--${v})`]);
905
+ }]
906
+ ];
858
907
 
859
908
  const questionMark = [
860
909
  [
861
910
  /^(where|\?)$/,
862
911
  (_, { constructCSS, generator }) => {
863
- if (generator.config.envMode === "dev")
912
+ if (generator.userConfig.envMode === "dev")
864
913
  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}}
865
914
  ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
866
915
  }
@@ -894,6 +943,20 @@ const textDecorations = [
894
943
  [/^(?:underline|decoration)-op(?:acity)?-?(.+)$/m, ([, opacity]) => ({ "--un-line-opacity": handler.bracket.percent(opacity) })]
895
944
  ];
896
945
 
946
+ const svgUtilities = [
947
+ [/^fill-(.+)$/, colorResolver$1("fill", "fill")],
948
+ [/^fill-op(?:acity)?-?(.+)$/m, ([, opacity]) => ({ "--un-fill-opacity": handler.bracket.percent(opacity) })],
949
+ ["fill-none", { fill: "none" }],
950
+ [/^stroke-(?:size-|width-)?(.+)$/, ([, s]) => {
951
+ const v = handler.bracket.fraction.px.number(s);
952
+ if (v)
953
+ return { "stroke-width": v };
954
+ }],
955
+ [/^stroke-(.+)$/, colorResolver$1("stroke", "stroke")],
956
+ [/^stroke-op(?:acity)?-?(.+)$/m, ([, opacity]) => ({ "--un-stroke-opacity": handler.bracket.percent(opacity) })],
957
+ ["stroke-none", { stroke: "none" }]
958
+ ];
959
+
897
960
  const rules = [
898
961
  cssVariables,
899
962
  paddings,
@@ -901,7 +964,7 @@ const rules = [
901
964
  displays,
902
965
  opacity,
903
966
  bgColors,
904
- fillColors,
967
+ svgUtilities,
905
968
  borders,
906
969
  contents,
907
970
  fonts,
@@ -947,7 +1010,8 @@ const rules = [
947
1010
  boxSizing,
948
1011
  transitions,
949
1012
  transforms,
1013
+ willChange,
950
1014
  questionMark
951
1015
  ].flat(1);
952
1016
 
953
- 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 };
1017
+ export { transitions as $, floats as A, zIndexes as B, boxSizing as C, questionMark as D, rings as E, boxShadows as F, sizes as G, aspectRatio as H, paddings as I, margins as J, cssProps as K, varEmpty as L, displays as M, appearances as N, cursors as O, pointerEvents as P, resizes as Q, userSelects as R, whitespaces as S, contents as T, breaks as U, textOverflows as V, textTransforms as W, fontStyles as X, fontSmoothings as Y, svgUtilities as Z, transforms as _, appearance as a, fonts as a0, tabSizes as a1, textIndents as a2, textStrokes as a3, textShadows as a4, cssVariables as a5, textDecorations as a6, borders as b, parseColorUtil as c, colorResolver$1 as d, opacity as e, textColors as f, bgColors as g, borderColors as h, ringColors as i, ringOffsetColors as j, flex as k, gaps as l, grids as m, overflows as n, outline as o, placeholder as p, positions as q, rules as r, justifies as s, textAligns as t, orders as u, verticalAligns as v, willChange as w, alignments as x, placements as y, insets as z };
@@ -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,
@@ -35,10 +37,13 @@ const variantBreakpoints = (matcher, _, theme) => {
35
37
  }
36
38
  };
37
39
 
38
- const variantChildren = [
39
- variants$1.variantMatcher("children", (input) => `${input} > *`),
40
+ const variantCombinators = [
40
41
  variants$1.variantMatcher("all", (input) => `${input} *`),
41
- variants$1.variantMatcher("next", (input) => `${input}+*`)
42
+ variants$1.variantMatcher("children", (input) => `${input}>*`),
43
+ variants$1.variantMatcher("next", (input) => `${input}+*`),
44
+ variants$1.variantMatcher("sibling", (input) => `${input}+*`),
45
+ variants$1.variantMatcher("siblings", (input) => `${input}~*`),
46
+ variants$1.variantMatcher("svg", (input) => `${input} svg *`)
42
47
  ];
43
48
 
44
49
  const variantColorsClass = [
@@ -113,15 +118,15 @@ const variants = [
113
118
  variantNegative,
114
119
  variantImportant,
115
120
  variantBreakpoints,
116
- ...variantChildren,
121
+ ...variantCombinators,
117
122
  pseudo.variantPseudoClasses,
118
123
  pseudo.variantPseudoElements
119
124
  ];
120
125
 
121
126
  exports.variantBreakpoints = variantBreakpoints;
122
- exports.variantChildren = variantChildren;
123
127
  exports.variantColorsClass = variantColorsClass;
124
128
  exports.variantColorsMedia = variantColorsMedia;
129
+ exports.variantCombinators = variantCombinators;
125
130
  exports.variantImportant = variantImportant;
126
131
  exports.variantNegative = variantNegative;
127
132
  exports.variantSpace = variantSpace;