@unocss/preset-mini 0.24.3 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -188,6 +188,29 @@ const maxHeight = {
188
188
  screen: "100vh"
189
189
  };
190
190
 
191
+ const gridAutoColumn = {
192
+ "xs": "0.75rem",
193
+ "sm": "0.875rem",
194
+ "base": "1rem",
195
+ "lg": "1.125rem",
196
+ "xl": "1.25rem",
197
+ "2xl": "1.5rem",
198
+ "3xl": "1.875rem",
199
+ "4xl": "2.25rem",
200
+ "5xl": "3rem",
201
+ "6xl": "3.75rem",
202
+ "7xl": "4.5rem",
203
+ "8xl": "6rem",
204
+ "9xl": "8rem"
205
+ };
206
+ const gridAutoRow = gridAutoColumn;
207
+ const gridColumn = {};
208
+ const gridRow = gridColumn;
209
+ const gridTemplateColumn = {
210
+ none: "none"
211
+ };
212
+ const gridTemplateRow = gridTemplateColumn;
213
+
191
214
  const theme = {
192
215
  width,
193
216
  height,
@@ -216,7 +239,13 @@ const theme = {
216
239
  textStrokeWidth,
217
240
  blur,
218
241
  dropShadow,
219
- easing
242
+ easing,
243
+ gridAutoColumn,
244
+ gridAutoRow,
245
+ gridColumn,
246
+ gridRow,
247
+ gridTemplateColumn,
248
+ gridTemplateRow
220
249
  };
221
250
 
222
251
  exports.baseSize = baseSize;
@@ -228,6 +257,12 @@ exports.dropShadow = dropShadow;
228
257
  exports.easing = easing;
229
258
  exports.fontFamily = fontFamily;
230
259
  exports.fontSize = fontSize;
260
+ exports.gridAutoColumn = gridAutoColumn;
261
+ exports.gridAutoRow = gridAutoRow;
262
+ exports.gridColumn = gridColumn;
263
+ exports.gridRow = gridRow;
264
+ exports.gridTemplateColumn = gridTemplateColumn;
265
+ exports.gridTemplateRow = gridTemplateRow;
231
266
  exports.height = height;
232
267
  exports.letterSpacing = letterSpacing;
233
268
  exports.lineHeight = lineHeight;
@@ -186,6 +186,29 @@ const maxHeight = {
186
186
  screen: "100vh"
187
187
  };
188
188
 
189
+ const gridAutoColumn = {
190
+ "xs": "0.75rem",
191
+ "sm": "0.875rem",
192
+ "base": "1rem",
193
+ "lg": "1.125rem",
194
+ "xl": "1.25rem",
195
+ "2xl": "1.5rem",
196
+ "3xl": "1.875rem",
197
+ "4xl": "2.25rem",
198
+ "5xl": "3rem",
199
+ "6xl": "3.75rem",
200
+ "7xl": "4.5rem",
201
+ "8xl": "6rem",
202
+ "9xl": "8rem"
203
+ };
204
+ const gridAutoRow = gridAutoColumn;
205
+ const gridColumn = {};
206
+ const gridRow = gridColumn;
207
+ const gridTemplateColumn = {
208
+ none: "none"
209
+ };
210
+ const gridTemplateRow = gridTemplateColumn;
211
+
189
212
  const theme = {
190
213
  width,
191
214
  height,
@@ -214,7 +237,13 @@ const theme = {
214
237
  textStrokeWidth,
215
238
  blur,
216
239
  dropShadow,
217
- easing
240
+ easing,
241
+ gridAutoColumn,
242
+ gridAutoRow,
243
+ gridColumn,
244
+ gridRow,
245
+ gridTemplateColumn,
246
+ gridTemplateRow
218
247
  };
219
248
 
220
- export { fontSize as a, blur as b, textIndent as c, dropShadow as d, textStrokeWidth as e, fontFamily as f, textShadow as g, letterSpacing as h, breakpoints as i, borderRadius as j, boxShadow as k, lineHeight as l, easing as m, baseSize as n, width as o, maxWidth as p, height as q, maxHeight as r, theme as t, verticalBreakpoints as v, wordSpacing as w };
249
+ export { maxHeight as A, fontSize as a, blur as b, textIndent as c, dropShadow as d, textStrokeWidth as e, fontFamily as f, textShadow as g, letterSpacing as h, gridAutoColumn as i, gridAutoRow as j, gridColumn as k, lineHeight as l, gridRow as m, gridTemplateColumn as n, gridTemplateRow as o, breakpoints as p, borderRadius as q, boxShadow as r, easing as s, theme as t, baseSize as u, verticalBreakpoints as v, wordSpacing as w, width as x, maxWidth as y, height as z };
@@ -75,10 +75,7 @@ const borders = [
75
75
  ["border-hidden", { "border-style": "hidden" }],
76
76
  ["border-none", { "border-style": "none" }]
77
77
  ];
78
- const borderHasColor = (color, { theme }) => {
79
- return color !== void 0 && !!utilities.parseColor(color, theme)?.color;
80
- };
81
- const borderColorResolver = (direction) => ([, body], { theme }) => {
78
+ const borderColorResolver = (direction) => ([, body], theme) => {
82
79
  const data = utilities.parseColor(body, theme);
83
80
  if (!data)
84
81
  return;
@@ -121,9 +118,9 @@ function handlerBorderSize([, a = "", b = "1"]) {
121
118
  if (a in utilities.directionMap && v != null)
122
119
  return utilities.directionMap[a].map((i) => [`border${i}-width`, v]);
123
120
  }
124
- function handlerBorderColor([, a = "", c], ctx) {
125
- if (a in utilities.directionMap && borderHasColor(c, ctx)) {
126
- return Object.assign({}, ...utilities.directionMap[a].map((i) => borderColorResolver(i)(["", c], ctx)));
121
+ function handlerBorderColor([, a = "", c], { theme }) {
122
+ if (a in utilities.directionMap && utilities.hasParseableColor(c, theme)) {
123
+ return Object.assign({}, ...utilities.directionMap[a].map((i) => borderColorResolver(i)(["", c], theme)));
127
124
  }
128
125
  }
129
126
  function handlerBorderOpacity([, a = "", opacity]) {
@@ -223,7 +220,7 @@ const fonts = [
223
220
  "line-height": height
224
221
  };
225
222
  }
226
- return { "font-size": utilities.handler.bracket.rem(s) };
223
+ return { "font-size": utilities.handler.bracketOfLength.rem(s) };
227
224
  }],
228
225
  [/^text-size-(.+)$/, ([, s]) => ({ "font-size": utilities.handler.bracket.cssvar.rem(s) })],
229
226
  [/^(?:font|fw)-?([^-]+)$/, ([, s]) => ({ "font-weight": weightMap[s] || utilities.handler.number(s) })],
@@ -286,11 +283,12 @@ const gaps = [
286
283
  ];
287
284
 
288
285
  const rowCol = (s) => s.replace("col", "column");
289
- const autoDirection = (selector, theme) => {
290
- const v = theme.fontSize?.[selector];
286
+ const rowColTheme = (s) => s[0] === "r" ? "Row" : "Column";
287
+ const autoDirection = (c, theme, prop) => {
288
+ const v = theme[`gridAuto${rowColTheme(c)}`]?.[prop];
291
289
  if (v != null)
292
- return core.toArray(v)[0];
293
- switch (selector) {
290
+ return v;
291
+ switch (prop) {
294
292
  case "min":
295
293
  return "min-content";
296
294
  case "max":
@@ -298,12 +296,14 @@ const autoDirection = (selector, theme) => {
298
296
  case "fr":
299
297
  return "minmax(0,1fr)";
300
298
  }
301
- return utilities.handler.bracket.cssvar.auto.rem(selector);
299
+ return utilities.handler.bracket.cssvar.auto.rem(prop);
302
300
  };
303
301
  const grids = [
304
302
  ["grid", { display: "grid" }],
305
303
  ["inline-grid", { display: "inline-grid" }],
306
- [/^(?:grid-)?(row|col)-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}`]: utilities.handler.bracket.cssvar.auto(v) })],
304
+ [/^(?:grid-)?(row|col)-(.+)$/, ([, c, v], { theme }) => ({
305
+ [`grid-${rowCol(c)}`]: theme[`grid${rowColTheme(c)}`]?.[v] ?? utilities.handler.bracket.cssvar.auto(v)
306
+ })],
307
307
  [/^(?:grid-)?(row|col)-span-(.+)$/, ([, c, s]) => {
308
308
  if (s === "full")
309
309
  return { [`grid-${rowCol(c)}`]: "1/-1" };
@@ -313,10 +313,12 @@ const grids = [
313
313
  }],
314
314
  [/^(?:grid-)?(row|col)-start-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-start`]: utilities.handler.bracket.cssvar(v) ?? v })],
315
315
  [/^(?:grid-)?(row|col)-end-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]: utilities.handler.bracket.cssvar(v) ?? v })],
316
- [/^(?:grid-)?auto-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({ [`grid-auto-${rowCol(c)}`]: autoDirection(v, theme) })],
316
+ [/^(?:grid-)?auto-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({ [`grid-auto-${rowCol(c)}`]: autoDirection(c, theme, v) })],
317
317
  [/^(?:grid-auto-flow|auto-flow|grid-flow)-(.+)$/, ([, v]) => ({ "grid-auto-flow": utilities.handler.bracket.cssvar(v) })],
318
318
  [/^(?:grid-auto-flow|auto-flow|grid-flow)-((?:row|col)(?:-dense)?)$/, ([, v]) => ({ "grid-auto-flow": rowCol(v).replace("-", " ") })],
319
- [/^grid-(rows|cols)-(.+)$/, ([, c, v]) => ({ [`grid-template-${rowCol(c)}`]: utilities.handler.bracket.cssvar(v) })],
319
+ [/^grid-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({
320
+ [`grid-template-${rowCol(c)}`]: theme[`gridTemplate${rowColTheme(c)}`]?.[v] ?? utilities.handler.bracket.cssvar(v)
321
+ })],
320
322
  [/^grid-(rows|cols)-minmax-([\w.-]+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(auto-fill,minmax(${d},1fr))` })],
321
323
  [/^grid-(rows|cols)-(\d+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(${d},minmax(0,1fr))` })],
322
324
  ["grid-rows-none", { "grid-template-rows": "none" }],
@@ -472,6 +474,7 @@ const whitespaces = [
472
474
  [/^(?:whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap)$/, ([, v]) => ({ "white-space": v })]
473
475
  ];
474
476
  const contents = [
477
+ [/^content-\[(.+)\]$/, ([, v]) => ({ content: `"${v}"` })],
475
478
  ["content-empty", { content: '""' }],
476
479
  ["content-none", { content: '""' }]
477
480
  ];
@@ -508,45 +511,19 @@ const fontSmoothings = [
508
511
  }]
509
512
  ];
510
513
 
511
- const shadowBase = {
512
- [core.CONTROL_SHORTCUT_NO_MERGE]: "",
513
- "--un-ring-offset-shadow": "0 0 #0000",
514
- "--un-ring-shadow": "0 0 #0000",
515
- "--un-shadow-inset": varEmpty,
516
- "--un-shadow": "0 0 #0000"
517
- };
518
- const boxShadows = [
519
- [/^shadow(?:-(.+))?$/, ([, d], { theme }) => {
520
- const v = theme.boxShadow?.[d || "DEFAULT"];
521
- if (v) {
522
- return [
523
- shadowBase,
524
- {
525
- "--un-shadow": utilities.colorableShadows(v, "--un-shadow-color").join(","),
526
- "box-shadow": "var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow)"
527
- }
528
- ];
529
- }
530
- }],
531
- [/^shadow-(.+)$/, utilities.colorResolver("--un-shadow-color", "shadow")],
532
- [/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": utilities.handler.bracket.percent(opacity) })],
533
- ["shadow-inset", { "--un-shadow-inset": "inset" }]
534
- ];
535
-
536
- const ringBase = {
537
- ...shadowBase,
538
- "--un-ring-inset": varEmpty,
539
- "--un-ring-offset-width": "0px",
540
- "--un-ring-offset-color": "#fff",
541
- "--un-ring-width": "0px",
542
- "--un-ring-color": "rgba(147,197,253,0.5)"
543
- };
544
514
  const rings = [
545
515
  [/^ring(?:-(.+))?$/, ([, d]) => {
546
516
  const value = utilities.handler.px(d || "1");
547
517
  if (value) {
548
518
  return [
549
- ringBase,
519
+ {
520
+ [core.CONTROL_SHORTCUT_NO_MERGE]: "",
521
+ "--un-ring-inset": varEmpty,
522
+ "--un-ring-offset-width": "0px",
523
+ "--un-ring-offset-color": "#fff",
524
+ "--un-ring-width": "0px",
525
+ "--un-ring-color": "rgba(147,197,253,0.5)"
526
+ },
550
527
  {
551
528
  "--un-ring-width": value,
552
529
  "--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)",
@@ -566,6 +543,28 @@ const rings = [
566
543
  ["ring-inset", { "--un-ring-inset": "inset" }]
567
544
  ];
568
545
 
546
+ const boxShadows = [
547
+ [/^shadow(?:-(.+))?$/, ([, d], { theme }) => {
548
+ const v = theme.boxShadow?.[d || "DEFAULT"];
549
+ if (v) {
550
+ return [
551
+ {
552
+ [core.CONTROL_SHORTCUT_NO_MERGE]: "",
553
+ "--un-shadow-inset": varEmpty,
554
+ "--un-shadow": "0 0 #0000"
555
+ },
556
+ {
557
+ "--un-shadow": utilities.colorableShadows(v, "--un-shadow-color").join(","),
558
+ "box-shadow": "var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow)"
559
+ }
560
+ ];
561
+ }
562
+ }],
563
+ [/^shadow-(.+)$/, utilities.colorResolver("--un-shadow-color", "shadow")],
564
+ [/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": utilities.handler.bracket.percent(opacity) })],
565
+ ["shadow-inset", { "--un-shadow-inset": "inset" }]
566
+ ];
567
+
569
568
  const sizeMapping = {
570
569
  h: "height",
571
570
  w: "width",
@@ -941,7 +940,6 @@ exports.questionMark = questionMark;
941
940
  exports.resizes = resizes;
942
941
  exports.rings = rings;
943
942
  exports.rules = rules;
944
- exports.shadowBase = shadowBase;
945
943
  exports.sizes = sizes;
946
944
  exports.svgUtilities = svgUtilities;
947
945
  exports.tabSizes = tabSizes;
@@ -1,4 +1,4 @@
1
- import { h as handler, c as colorResolver, d as directionMap, p as parseColor, a as colorToString, b as cornerMap, e as colorableShadows, i as insetMap, f as directionSize, g as positionMap, x as xyzMap } from './utilities.mjs';
1
+ import { h as handler, c as colorResolver, d as directionMap, a as hasParseableColor, p as parseColor, b as colorToString, e as cornerMap, f as colorableShadows, i as insetMap, g as directionSize, j as positionMap, x as xyzMap } from './utilities.mjs';
2
2
  import { toArray, CONTROL_SHORTCUT_NO_MERGE } from '@unocss/core';
3
3
 
4
4
  const verticalAlignAlias = {
@@ -73,10 +73,7 @@ const borders = [
73
73
  ["border-hidden", { "border-style": "hidden" }],
74
74
  ["border-none", { "border-style": "none" }]
75
75
  ];
76
- const borderHasColor = (color, { theme }) => {
77
- return color !== void 0 && !!parseColor(color, theme)?.color;
78
- };
79
- const borderColorResolver = (direction) => ([, body], { theme }) => {
76
+ const borderColorResolver = (direction) => ([, body], theme) => {
80
77
  const data = parseColor(body, theme);
81
78
  if (!data)
82
79
  return;
@@ -119,9 +116,9 @@ function handlerBorderSize([, a = "", b = "1"]) {
119
116
  if (a in directionMap && v != null)
120
117
  return directionMap[a].map((i) => [`border${i}-width`, v]);
121
118
  }
122
- function handlerBorderColor([, a = "", c], ctx) {
123
- if (a in directionMap && borderHasColor(c, ctx)) {
124
- return Object.assign({}, ...directionMap[a].map((i) => borderColorResolver(i)(["", c], ctx)));
119
+ function handlerBorderColor([, a = "", c], { theme }) {
120
+ if (a in directionMap && hasParseableColor(c, theme)) {
121
+ return Object.assign({}, ...directionMap[a].map((i) => borderColorResolver(i)(["", c], theme)));
125
122
  }
126
123
  }
127
124
  function handlerBorderOpacity([, a = "", opacity]) {
@@ -221,7 +218,7 @@ const fonts = [
221
218
  "line-height": height
222
219
  };
223
220
  }
224
- return { "font-size": handler.bracket.rem(s) };
221
+ return { "font-size": handler.bracketOfLength.rem(s) };
225
222
  }],
226
223
  [/^text-size-(.+)$/, ([, s]) => ({ "font-size": handler.bracket.cssvar.rem(s) })],
227
224
  [/^(?:font|fw)-?([^-]+)$/, ([, s]) => ({ "font-weight": weightMap[s] || handler.number(s) })],
@@ -284,11 +281,12 @@ const gaps = [
284
281
  ];
285
282
 
286
283
  const rowCol = (s) => s.replace("col", "column");
287
- const autoDirection = (selector, theme) => {
288
- const v = theme.fontSize?.[selector];
284
+ const rowColTheme = (s) => s[0] === "r" ? "Row" : "Column";
285
+ const autoDirection = (c, theme, prop) => {
286
+ const v = theme[`gridAuto${rowColTheme(c)}`]?.[prop];
289
287
  if (v != null)
290
- return toArray(v)[0];
291
- switch (selector) {
288
+ return v;
289
+ switch (prop) {
292
290
  case "min":
293
291
  return "min-content";
294
292
  case "max":
@@ -296,12 +294,14 @@ const autoDirection = (selector, theme) => {
296
294
  case "fr":
297
295
  return "minmax(0,1fr)";
298
296
  }
299
- return handler.bracket.cssvar.auto.rem(selector);
297
+ return handler.bracket.cssvar.auto.rem(prop);
300
298
  };
301
299
  const grids = [
302
300
  ["grid", { display: "grid" }],
303
301
  ["inline-grid", { display: "inline-grid" }],
304
- [/^(?:grid-)?(row|col)-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}`]: handler.bracket.cssvar.auto(v) })],
302
+ [/^(?:grid-)?(row|col)-(.+)$/, ([, c, v], { theme }) => ({
303
+ [`grid-${rowCol(c)}`]: theme[`grid${rowColTheme(c)}`]?.[v] ?? handler.bracket.cssvar.auto(v)
304
+ })],
305
305
  [/^(?:grid-)?(row|col)-span-(.+)$/, ([, c, s]) => {
306
306
  if (s === "full")
307
307
  return { [`grid-${rowCol(c)}`]: "1/-1" };
@@ -311,10 +311,12 @@ const grids = [
311
311
  }],
312
312
  [/^(?:grid-)?(row|col)-start-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-start`]: handler.bracket.cssvar(v) ?? v })],
313
313
  [/^(?:grid-)?(row|col)-end-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]: handler.bracket.cssvar(v) ?? v })],
314
- [/^(?:grid-)?auto-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({ [`grid-auto-${rowCol(c)}`]: autoDirection(v, theme) })],
314
+ [/^(?:grid-)?auto-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({ [`grid-auto-${rowCol(c)}`]: autoDirection(c, theme, v) })],
315
315
  [/^(?:grid-auto-flow|auto-flow|grid-flow)-(.+)$/, ([, v]) => ({ "grid-auto-flow": handler.bracket.cssvar(v) })],
316
316
  [/^(?:grid-auto-flow|auto-flow|grid-flow)-((?:row|col)(?:-dense)?)$/, ([, v]) => ({ "grid-auto-flow": rowCol(v).replace("-", " ") })],
317
- [/^grid-(rows|cols)-(.+)$/, ([, c, v]) => ({ [`grid-template-${rowCol(c)}`]: handler.bracket.cssvar(v) })],
317
+ [/^grid-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({
318
+ [`grid-template-${rowCol(c)}`]: theme[`gridTemplate${rowColTheme(c)}`]?.[v] ?? handler.bracket.cssvar(v)
319
+ })],
318
320
  [/^grid-(rows|cols)-minmax-([\w.-]+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(auto-fill,minmax(${d},1fr))` })],
319
321
  [/^grid-(rows|cols)-(\d+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(${d},minmax(0,1fr))` })],
320
322
  ["grid-rows-none", { "grid-template-rows": "none" }],
@@ -470,6 +472,7 @@ const whitespaces = [
470
472
  [/^(?:whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap)$/, ([, v]) => ({ "white-space": v })]
471
473
  ];
472
474
  const contents = [
475
+ [/^content-\[(.+)\]$/, ([, v]) => ({ content: `"${v}"` })],
473
476
  ["content-empty", { content: '""' }],
474
477
  ["content-none", { content: '""' }]
475
478
  ];
@@ -506,45 +509,19 @@ const fontSmoothings = [
506
509
  }]
507
510
  ];
508
511
 
509
- const shadowBase = {
510
- [CONTROL_SHORTCUT_NO_MERGE]: "",
511
- "--un-ring-offset-shadow": "0 0 #0000",
512
- "--un-ring-shadow": "0 0 #0000",
513
- "--un-shadow-inset": varEmpty,
514
- "--un-shadow": "0 0 #0000"
515
- };
516
- const boxShadows = [
517
- [/^shadow(?:-(.+))?$/, ([, d], { theme }) => {
518
- const v = theme.boxShadow?.[d || "DEFAULT"];
519
- if (v) {
520
- return [
521
- shadowBase,
522
- {
523
- "--un-shadow": colorableShadows(v, "--un-shadow-color").join(","),
524
- "box-shadow": "var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow)"
525
- }
526
- ];
527
- }
528
- }],
529
- [/^shadow-(.+)$/, colorResolver("--un-shadow-color", "shadow")],
530
- [/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": handler.bracket.percent(opacity) })],
531
- ["shadow-inset", { "--un-shadow-inset": "inset" }]
532
- ];
533
-
534
- const ringBase = {
535
- ...shadowBase,
536
- "--un-ring-inset": varEmpty,
537
- "--un-ring-offset-width": "0px",
538
- "--un-ring-offset-color": "#fff",
539
- "--un-ring-width": "0px",
540
- "--un-ring-color": "rgba(147,197,253,0.5)"
541
- };
542
512
  const rings = [
543
513
  [/^ring(?:-(.+))?$/, ([, d]) => {
544
514
  const value = handler.px(d || "1");
545
515
  if (value) {
546
516
  return [
547
- ringBase,
517
+ {
518
+ [CONTROL_SHORTCUT_NO_MERGE]: "",
519
+ "--un-ring-inset": varEmpty,
520
+ "--un-ring-offset-width": "0px",
521
+ "--un-ring-offset-color": "#fff",
522
+ "--un-ring-width": "0px",
523
+ "--un-ring-color": "rgba(147,197,253,0.5)"
524
+ },
548
525
  {
549
526
  "--un-ring-width": value,
550
527
  "--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)",
@@ -564,6 +541,28 @@ const rings = [
564
541
  ["ring-inset", { "--un-ring-inset": "inset" }]
565
542
  ];
566
543
 
544
+ const boxShadows = [
545
+ [/^shadow(?:-(.+))?$/, ([, d], { theme }) => {
546
+ const v = theme.boxShadow?.[d || "DEFAULT"];
547
+ if (v) {
548
+ return [
549
+ {
550
+ [CONTROL_SHORTCUT_NO_MERGE]: "",
551
+ "--un-shadow-inset": varEmpty,
552
+ "--un-shadow": "0 0 #0000"
553
+ },
554
+ {
555
+ "--un-shadow": colorableShadows(v, "--un-shadow-color").join(","),
556
+ "box-shadow": "var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow)"
557
+ }
558
+ ];
559
+ }
560
+ }],
561
+ [/^shadow-(.+)$/, colorResolver("--un-shadow-color", "shadow")],
562
+ [/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": handler.bracket.percent(opacity) })],
563
+ ["shadow-inset", { "--un-shadow-inset": "inset" }]
564
+ ];
565
+
567
566
  const sizeMapping = {
568
567
  h: "height",
569
568
  w: "width",
@@ -903,4 +902,4 @@ const rules = [
903
902
  questionMark
904
903
  ].flat(1);
905
904
 
906
- export { cssVariables as $, boxShadows as A, sizes as B, aspectRatio as C, paddings as D, margins as E, varEmpty as F, displays as G, appearances as H, cursors as I, pointerEvents as J, resizes as K, userSelects as L, whitespaces as M, contents as N, breaks as O, textOverflows as P, textTransforms as Q, fontStyles as R, fontSmoothings as S, svgUtilities as T, transforms as U, transitions as V, fonts as W, tabSizes as X, textIndents as Y, textStrokes as Z, textShadows as _, appearance as a, cssProperty as a0, textDecorations as a1, borders as b, opacity as c, textColors as d, bgColors as e, flex as f, gaps as g, grids as h, overflows as i, justifies as j, orders as k, alignments as l, placements as m, insets as n, outline as o, positions as p, floats as q, rules as r, boxSizing as s, textAligns as t, questionMark as u, verticalAligns as v, willChange as w, rings as x, shadowBase as y, zIndexes as z };
905
+ export { cssProperty as $, sizes as A, aspectRatio as B, paddings as C, margins as D, varEmpty as E, displays as F, appearances as G, cursors as H, pointerEvents as I, resizes as J, userSelects as K, whitespaces as L, contents as M, breaks as N, textOverflows as O, textTransforms as P, fontStyles as Q, fontSmoothings as R, svgUtilities as S, transforms as T, transitions as U, fonts as V, tabSizes as W, textIndents as X, textStrokes as Y, textShadows as Z, cssVariables as _, appearance as a, textDecorations as a0, borders as b, opacity as c, textColors as d, bgColors as e, flex as f, gaps as g, grids as h, overflows as i, justifies as j, orders as k, alignments as l, placements as m, insets as n, outline as o, positions as p, floats as q, rules as r, boxSizing as s, textAligns as t, questionMark as u, verticalAligns as v, willChange as w, rings as x, boxShadows as y, zIndexes as z };
@@ -61,15 +61,17 @@ const variantCombinators = [
61
61
  scopeMatcher(true, "peer", "&&-c~&&-s")
62
62
  ];
63
63
 
64
- const variantMotions = [
65
- variants$1.variantParentMatcher("motion-reduce", "@media (prefers-reduced-motion: reduce)"),
66
- variants$1.variantParentMatcher("motion-safe", "@media (prefers-reduced-motion: no-preference)")
67
- ];
68
- const variantOrientations = [
69
- variants$1.variantParentMatcher("landscape", "@media (orientation: landscape)"),
70
- variants$1.variantParentMatcher("portrait", "@media (orientation: portrait)")
71
- ];
72
64
  const variantPrint = variants$1.variantParentMatcher("print", "@media print");
65
+ const variantCustomMedia = (matcher, { theme }) => {
66
+ const match = matcher.match(/^media-([_\d\w]+)[:-]/);
67
+ if (match) {
68
+ const media = theme.media?.[match[1]] ?? `(--${match[1]})`;
69
+ return {
70
+ matcher: matcher.slice(match[0].length),
71
+ parent: `@media ${media}`
72
+ };
73
+ }
74
+ };
73
75
 
74
76
  const variantColorsMediaOrClass = (options = {}) => {
75
77
  if (options?.dark === "class") {
@@ -89,9 +91,20 @@ const variantLanguageDirections = [
89
91
  variants$1.variantMatcher("ltr", (input) => `[dir="ltr"] $$ ${input}`)
90
92
  ];
91
93
 
94
+ const variantSelector = {
95
+ match(matcher) {
96
+ const match = matcher.match(/^selector-\[(.+?)\][:-]/);
97
+ if (match) {
98
+ return {
99
+ matcher: matcher.slice(match[0].length),
100
+ selector: () => match[1]
101
+ };
102
+ }
103
+ }
104
+ };
92
105
  const variantLayer = {
93
106
  match(matcher) {
94
- const match = matcher.match(/layer-([\d\w]+)[:-]/);
107
+ const match = matcher.match(/^layer-([_\d\w]+)[:-]/);
95
108
  if (match) {
96
109
  return {
97
110
  matcher: matcher.slice(match[0].length),
@@ -100,6 +113,17 @@ const variantLayer = {
100
113
  }
101
114
  }
102
115
  };
116
+ const variantScope = {
117
+ match(matcher) {
118
+ const match = matcher.match(/^scope-([_\d\w]+)[:-]/);
119
+ if (match) {
120
+ return {
121
+ matcher: matcher.slice(match[0].length),
122
+ selector: (s) => `.${match[1]} $$ ${s}`
123
+ };
124
+ }
125
+ }
126
+ };
103
127
  const variantImportant = {
104
128
  match(matcher) {
105
129
  if (matcher.startsWith("!")) {
@@ -291,12 +315,12 @@ const partClasses = {
291
315
  };
292
316
 
293
317
  const variants = (options) => [
318
+ variantSelector,
294
319
  variantLayer,
295
320
  variantNegative,
296
321
  variantImportant,
297
322
  variantPrint,
298
- ...variantOrientations,
299
- ...variantMotions,
323
+ variantCustomMedia,
300
324
  variantBreakpoints,
301
325
  ...variantCombinators,
302
326
  variantPseudoClasses,
@@ -305,22 +329,24 @@ const variants = (options) => [
305
329
  variantPseudoElements,
306
330
  partClasses,
307
331
  ...variantColorsMediaOrClass(options),
308
- ...variantLanguageDirections
332
+ ...variantLanguageDirections,
333
+ variantScope
309
334
  ];
310
335
 
311
336
  exports.partClasses = partClasses;
312
337
  exports.variantBreakpoints = variantBreakpoints;
313
338
  exports.variantColorsMediaOrClass = variantColorsMediaOrClass;
314
339
  exports.variantCombinators = variantCombinators;
340
+ exports.variantCustomMedia = variantCustomMedia;
315
341
  exports.variantImportant = variantImportant;
316
342
  exports.variantLanguageDirections = variantLanguageDirections;
317
343
  exports.variantLayer = variantLayer;
318
- exports.variantMotions = variantMotions;
319
344
  exports.variantNegative = variantNegative;
320
- exports.variantOrientations = variantOrientations;
321
345
  exports.variantPrint = variantPrint;
322
346
  exports.variantPseudoClassFunctions = variantPseudoClassFunctions;
323
347
  exports.variantPseudoClasses = variantPseudoClasses;
324
348
  exports.variantPseudoElements = variantPseudoElements;
349
+ exports.variantScope = variantScope;
350
+ exports.variantSelector = variantSelector;
325
351
  exports.variantTaggedPseudoClasses = variantTaggedPseudoClasses;
326
352
  exports.variants = variants;
@@ -59,15 +59,17 @@ const variantCombinators = [
59
59
  scopeMatcher(true, "peer", "&&-c~&&-s")
60
60
  ];
61
61
 
62
- const variantMotions = [
63
- variantParentMatcher("motion-reduce", "@media (prefers-reduced-motion: reduce)"),
64
- variantParentMatcher("motion-safe", "@media (prefers-reduced-motion: no-preference)")
65
- ];
66
- const variantOrientations = [
67
- variantParentMatcher("landscape", "@media (orientation: landscape)"),
68
- variantParentMatcher("portrait", "@media (orientation: portrait)")
69
- ];
70
62
  const variantPrint = variantParentMatcher("print", "@media print");
63
+ const variantCustomMedia = (matcher, { theme }) => {
64
+ const match = matcher.match(/^media-([_\d\w]+)[:-]/);
65
+ if (match) {
66
+ const media = theme.media?.[match[1]] ?? `(--${match[1]})`;
67
+ return {
68
+ matcher: matcher.slice(match[0].length),
69
+ parent: `@media ${media}`
70
+ };
71
+ }
72
+ };
71
73
 
72
74
  const variantColorsMediaOrClass = (options = {}) => {
73
75
  if (options?.dark === "class") {
@@ -87,9 +89,20 @@ const variantLanguageDirections = [
87
89
  variantMatcher("ltr", (input) => `[dir="ltr"] $$ ${input}`)
88
90
  ];
89
91
 
92
+ const variantSelector = {
93
+ match(matcher) {
94
+ const match = matcher.match(/^selector-\[(.+?)\][:-]/);
95
+ if (match) {
96
+ return {
97
+ matcher: matcher.slice(match[0].length),
98
+ selector: () => match[1]
99
+ };
100
+ }
101
+ }
102
+ };
90
103
  const variantLayer = {
91
104
  match(matcher) {
92
- const match = matcher.match(/layer-([\d\w]+)[:-]/);
105
+ const match = matcher.match(/^layer-([_\d\w]+)[:-]/);
93
106
  if (match) {
94
107
  return {
95
108
  matcher: matcher.slice(match[0].length),
@@ -98,6 +111,17 @@ const variantLayer = {
98
111
  }
99
112
  }
100
113
  };
114
+ const variantScope = {
115
+ match(matcher) {
116
+ const match = matcher.match(/^scope-([_\d\w]+)[:-]/);
117
+ if (match) {
118
+ return {
119
+ matcher: matcher.slice(match[0].length),
120
+ selector: (s) => `.${match[1]} $$ ${s}`
121
+ };
122
+ }
123
+ }
124
+ };
101
125
  const variantImportant = {
102
126
  match(matcher) {
103
127
  if (matcher.startsWith("!")) {
@@ -289,12 +313,12 @@ const partClasses = {
289
313
  };
290
314
 
291
315
  const variants = (options) => [
316
+ variantSelector,
292
317
  variantLayer,
293
318
  variantNegative,
294
319
  variantImportant,
295
320
  variantPrint,
296
- ...variantOrientations,
297
- ...variantMotions,
321
+ variantCustomMedia,
298
322
  variantBreakpoints,
299
323
  ...variantCombinators,
300
324
  variantPseudoClasses,
@@ -303,7 +327,8 @@ const variants = (options) => [
303
327
  variantPseudoElements,
304
328
  partClasses,
305
329
  ...variantColorsMediaOrClass(options),
306
- ...variantLanguageDirections
330
+ ...variantLanguageDirections,
331
+ variantScope
307
332
  ];
308
333
 
309
- export { variantBreakpoints as a, variantCombinators as b, variantMotions as c, variantOrientations as d, variantPrint as e, variantColorsMediaOrClass as f, variantLanguageDirections as g, variantLayer as h, variantImportant as i, variantNegative as j, variantPseudoElements as k, variantPseudoClasses as l, variantPseudoClassFunctions as m, variantTaggedPseudoClasses as n, partClasses as p, variants as v };
334
+ export { variantBreakpoints as a, variantCombinators as b, variantPrint as c, variantCustomMedia as d, variantColorsMediaOrClass as e, variantLanguageDirections as f, variantSelector as g, variantLayer as h, variantScope as i, variantImportant as j, variantNegative as k, variantPseudoElements as l, variantPseudoClasses as m, variantPseudoClassFunctions as n, variantTaggedPseudoClasses as o, partClasses as p, variants as v };