@unocss/preset-mini 0.25.1 → 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" }],
@@ -509,45 +511,19 @@ const fontSmoothings = [
509
511
  }]
510
512
  ];
511
513
 
512
- const shadowBase = {
513
- [core.CONTROL_SHORTCUT_NO_MERGE]: "",
514
- "--un-ring-offset-shadow": "0 0 #0000",
515
- "--un-ring-shadow": "0 0 #0000",
516
- "--un-shadow-inset": varEmpty,
517
- "--un-shadow": "0 0 #0000"
518
- };
519
- const boxShadows = [
520
- [/^shadow(?:-(.+))?$/, ([, d], { theme }) => {
521
- const v = theme.boxShadow?.[d || "DEFAULT"];
522
- if (v) {
523
- return [
524
- shadowBase,
525
- {
526
- "--un-shadow": utilities.colorableShadows(v, "--un-shadow-color").join(","),
527
- "box-shadow": "var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow)"
528
- }
529
- ];
530
- }
531
- }],
532
- [/^shadow-(.+)$/, utilities.colorResolver("--un-shadow-color", "shadow")],
533
- [/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": utilities.handler.bracket.percent(opacity) })],
534
- ["shadow-inset", { "--un-shadow-inset": "inset" }]
535
- ];
536
-
537
- const ringBase = {
538
- ...shadowBase,
539
- "--un-ring-inset": varEmpty,
540
- "--un-ring-offset-width": "0px",
541
- "--un-ring-offset-color": "#fff",
542
- "--un-ring-width": "0px",
543
- "--un-ring-color": "rgba(147,197,253,0.5)"
544
- };
545
514
  const rings = [
546
515
  [/^ring(?:-(.+))?$/, ([, d]) => {
547
516
  const value = utilities.handler.px(d || "1");
548
517
  if (value) {
549
518
  return [
550
- 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
+ },
551
527
  {
552
528
  "--un-ring-width": value,
553
529
  "--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)",
@@ -567,6 +543,28 @@ const rings = [
567
543
  ["ring-inset", { "--un-ring-inset": "inset" }]
568
544
  ];
569
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
+
570
568
  const sizeMapping = {
571
569
  h: "height",
572
570
  w: "width",
@@ -942,7 +940,6 @@ exports.questionMark = questionMark;
942
940
  exports.resizes = resizes;
943
941
  exports.rings = rings;
944
942
  exports.rules = rules;
945
- exports.shadowBase = shadowBase;
946
943
  exports.sizes = sizes;
947
944
  exports.svgUtilities = svgUtilities;
948
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" }],
@@ -507,45 +509,19 @@ const fontSmoothings = [
507
509
  }]
508
510
  ];
509
511
 
510
- const shadowBase = {
511
- [CONTROL_SHORTCUT_NO_MERGE]: "",
512
- "--un-ring-offset-shadow": "0 0 #0000",
513
- "--un-ring-shadow": "0 0 #0000",
514
- "--un-shadow-inset": varEmpty,
515
- "--un-shadow": "0 0 #0000"
516
- };
517
- const boxShadows = [
518
- [/^shadow(?:-(.+))?$/, ([, d], { theme }) => {
519
- const v = theme.boxShadow?.[d || "DEFAULT"];
520
- if (v) {
521
- return [
522
- shadowBase,
523
- {
524
- "--un-shadow": colorableShadows(v, "--un-shadow-color").join(","),
525
- "box-shadow": "var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow)"
526
- }
527
- ];
528
- }
529
- }],
530
- [/^shadow-(.+)$/, colorResolver("--un-shadow-color", "shadow")],
531
- [/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": handler.bracket.percent(opacity) })],
532
- ["shadow-inset", { "--un-shadow-inset": "inset" }]
533
- ];
534
-
535
- const ringBase = {
536
- ...shadowBase,
537
- "--un-ring-inset": varEmpty,
538
- "--un-ring-offset-width": "0px",
539
- "--un-ring-offset-color": "#fff",
540
- "--un-ring-width": "0px",
541
- "--un-ring-color": "rgba(147,197,253,0.5)"
542
- };
543
512
  const rings = [
544
513
  [/^ring(?:-(.+))?$/, ([, d]) => {
545
514
  const value = handler.px(d || "1");
546
515
  if (value) {
547
516
  return [
548
- 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
+ },
549
525
  {
550
526
  "--un-ring-width": value,
551
527
  "--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)",
@@ -565,6 +541,28 @@ const rings = [
565
541
  ["ring-inset", { "--un-ring-inset": "inset" }]
566
542
  ];
567
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
+
568
566
  const sizeMapping = {
569
567
  h: "height",
570
568
  w: "width",
@@ -904,4 +902,4 @@ const rules = [
904
902
  questionMark
905
903
  ].flat(1);
906
904
 
907
- 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 };
@@ -7,7 +7,7 @@ function hex2rgba(hex = "") {
7
7
  const color = parseHexColor(hex);
8
8
  if (color != null) {
9
9
  const { components, alpha } = color;
10
- if (alpha === void 0)
10
+ if (alpha == null)
11
11
  return components;
12
12
  return [...components, alpha];
13
13
  }
@@ -20,7 +20,7 @@ function parseCssColor(str = "") {
20
20
  const type = casedType.toLowerCase();
21
21
  if (components.length === 0)
22
22
  return;
23
- if (["rgba", "hsla"].includes(type) && alpha === void 0)
23
+ if (["rgba", "hsla"].includes(type) && alpha == null)
24
24
  return;
25
25
  if (cssColorFunctions.includes(type) && components.length !== 3)
26
26
  return;
@@ -420,13 +420,30 @@ function fraction(str) {
420
420
  if (!Number.isNaN(num))
421
421
  return `${round(num * 100)}%`;
422
422
  }
423
- function bracket(str) {
424
- if (str && str[0] === "[" && str[str.length - 1] === "]") {
425
- return str.slice(1, -1).replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/([^\\])_/g, "$1 ").replace(/calc\((.*)/g, (v) => {
426
- return v.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ");
427
- });
423
+ function bracketWithType(str, type) {
424
+ if (str && str.startsWith("[") && str.endsWith("]")) {
425
+ let base;
426
+ const match = str.match(/^\[(color|length):/i);
427
+ if (!match)
428
+ base = str.slice(1, -1);
429
+ else if (type && match[1] === type)
430
+ base = str.slice(match[0].length, -1);
431
+ if (base !== void 0) {
432
+ return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/([^\\])_/g, "$1 ").replace(/calc\((.*)/g, (v) => {
433
+ return v.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ");
434
+ });
435
+ }
428
436
  }
429
437
  }
438
+ function bracket(str) {
439
+ return bracketWithType(str);
440
+ }
441
+ function bracketOfColor(str) {
442
+ return bracketWithType(str, "color");
443
+ }
444
+ function bracketOfLength(str) {
445
+ return bracketWithType(str, "length");
446
+ }
430
447
  function cssvar(str) {
431
448
  if (str.match(/^\$\S/))
432
449
  return `var(--${core.escapeSelector(str.slice(1))})`;
@@ -471,6 +488,8 @@ const valueHandlers = {
471
488
  percent: percent,
472
489
  fraction: fraction,
473
490
  bracket: bracket,
491
+ bracketOfColor: bracketOfColor,
492
+ bracketOfLength: bracketOfLength,
474
493
  cssvar: cssvar,
475
494
  time: time,
476
495
  degree: degree,
@@ -483,18 +502,25 @@ const h = handler;
483
502
 
484
503
  const directionSize = (propertyPrefix) => ([_, direction, size]) => {
485
504
  const v = handler.bracket.cssvar.auto.fraction.rem(size);
486
- if (v !== void 0)
505
+ if (v != null)
487
506
  return directionMap[direction].map((i) => [`${propertyPrefix}${i}`, v]);
488
507
  };
489
508
  const getThemeColor = (theme, colors) => theme.colors?.[colors.join("-").replace(/(-[a-z])/g, (n) => n.slice(1).toUpperCase())];
490
509
  const parseColor = (body, theme) => {
491
- const [main, opacity] = body.split(/(?:\/|:)/);
510
+ const split = body.split(/(?:\/|:)/);
511
+ let main, opacity;
512
+ if (split[0] === "[color") {
513
+ main = split.slice(0, 2).join(":");
514
+ opacity = split[2];
515
+ } else {
516
+ [main, opacity] = split;
517
+ }
492
518
  const colors = main.replace(/([a-z])([0-9])/g, "$1-$2").split(/-/g);
493
519
  const [name] = colors;
494
520
  if (!name)
495
521
  return;
496
522
  let color;
497
- const bracket = handler.bracket(main);
523
+ const bracket = handler.bracketOfColor(main);
498
524
  const bracketOrMain = bracket || main;
499
525
  if (bracketOrMain.startsWith("#"))
500
526
  color = bracketOrMain;
@@ -567,6 +593,9 @@ const colorableShadows = (shadows, colorVar) => {
567
593
  }
568
594
  return colored;
569
595
  };
596
+ const hasParseableColor = (color, theme) => {
597
+ return color != null && !!parseColor(color, theme)?.color;
598
+ };
570
599
 
571
600
  exports.colorResolver = colorResolver;
572
601
  exports.colorToString = colorToString;
@@ -577,6 +606,7 @@ exports.directionSize = directionSize;
577
606
  exports.getComponents = getComponents;
578
607
  exports.h = h;
579
608
  exports.handler = handler;
609
+ exports.hasParseableColor = hasParseableColor;
580
610
  exports.hex2rgba = hex2rgba;
581
611
  exports.insetMap = insetMap;
582
612
  exports.parseColor = parseColor;
@@ -5,7 +5,7 @@ function hex2rgba(hex = "") {
5
5
  const color = parseHexColor(hex);
6
6
  if (color != null) {
7
7
  const { components, alpha } = color;
8
- if (alpha === void 0)
8
+ if (alpha == null)
9
9
  return components;
10
10
  return [...components, alpha];
11
11
  }
@@ -18,7 +18,7 @@ function parseCssColor(str = "") {
18
18
  const type = casedType.toLowerCase();
19
19
  if (components.length === 0)
20
20
  return;
21
- if (["rgba", "hsla"].includes(type) && alpha === void 0)
21
+ if (["rgba", "hsla"].includes(type) && alpha == null)
22
22
  return;
23
23
  if (cssColorFunctions.includes(type) && components.length !== 3)
24
24
  return;
@@ -418,13 +418,30 @@ function fraction(str) {
418
418
  if (!Number.isNaN(num))
419
419
  return `${round(num * 100)}%`;
420
420
  }
421
- function bracket(str) {
422
- if (str && str[0] === "[" && str[str.length - 1] === "]") {
423
- return str.slice(1, -1).replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/([^\\])_/g, "$1 ").replace(/calc\((.*)/g, (v) => {
424
- return v.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ");
425
- });
421
+ function bracketWithType(str, type) {
422
+ if (str && str.startsWith("[") && str.endsWith("]")) {
423
+ let base;
424
+ const match = str.match(/^\[(color|length):/i);
425
+ if (!match)
426
+ base = str.slice(1, -1);
427
+ else if (type && match[1] === type)
428
+ base = str.slice(match[0].length, -1);
429
+ if (base !== void 0) {
430
+ return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/([^\\])_/g, "$1 ").replace(/calc\((.*)/g, (v) => {
431
+ return v.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ");
432
+ });
433
+ }
426
434
  }
427
435
  }
436
+ function bracket(str) {
437
+ return bracketWithType(str);
438
+ }
439
+ function bracketOfColor(str) {
440
+ return bracketWithType(str, "color");
441
+ }
442
+ function bracketOfLength(str) {
443
+ return bracketWithType(str, "length");
444
+ }
428
445
  function cssvar(str) {
429
446
  if (str.match(/^\$\S/))
430
447
  return `var(--${escapeSelector(str.slice(1))})`;
@@ -469,6 +486,8 @@ const valueHandlers = {
469
486
  percent: percent,
470
487
  fraction: fraction,
471
488
  bracket: bracket,
489
+ bracketOfColor: bracketOfColor,
490
+ bracketOfLength: bracketOfLength,
472
491
  cssvar: cssvar,
473
492
  time: time,
474
493
  degree: degree,
@@ -481,18 +500,25 @@ const h = handler;
481
500
 
482
501
  const directionSize = (propertyPrefix) => ([_, direction, size]) => {
483
502
  const v = handler.bracket.cssvar.auto.fraction.rem(size);
484
- if (v !== void 0)
503
+ if (v != null)
485
504
  return directionMap[direction].map((i) => [`${propertyPrefix}${i}`, v]);
486
505
  };
487
506
  const getThemeColor = (theme, colors) => theme.colors?.[colors.join("-").replace(/(-[a-z])/g, (n) => n.slice(1).toUpperCase())];
488
507
  const parseColor = (body, theme) => {
489
- const [main, opacity] = body.split(/(?:\/|:)/);
508
+ const split = body.split(/(?:\/|:)/);
509
+ let main, opacity;
510
+ if (split[0] === "[color") {
511
+ main = split.slice(0, 2).join(":");
512
+ opacity = split[2];
513
+ } else {
514
+ [main, opacity] = split;
515
+ }
490
516
  const colors = main.replace(/([a-z])([0-9])/g, "$1-$2").split(/-/g);
491
517
  const [name] = colors;
492
518
  if (!name)
493
519
  return;
494
520
  let color;
495
- const bracket = handler.bracket(main);
521
+ const bracket = handler.bracketOfColor(main);
496
522
  const bracketOrMain = bracket || main;
497
523
  if (bracketOrMain.startsWith("#"))
498
524
  color = bracketOrMain;
@@ -565,5 +591,8 @@ const colorableShadows = (shadows, colorVar) => {
565
591
  }
566
592
  return colored;
567
593
  };
594
+ const hasParseableColor = (color, theme) => {
595
+ return color != null && !!parseColor(color, theme)?.color;
596
+ };
568
597
 
569
- export { colorToString as a, cornerMap as b, colorResolver as c, directionMap as d, colorableShadows as e, directionSize as f, positionMap as g, handler as h, insetMap as i, hex2rgba as j, parseCssColor as k, getComponents as l, h as m, parseColor as p, valueHandlers as v, xyzMap as x };
598
+ export { hasParseableColor as a, colorToString as b, colorResolver as c, directionMap as d, cornerMap as e, colorableShadows as f, directionSize as g, handler as h, insetMap as i, positionMap as j, hex2rgba as k, parseCssColor as l, getComponents as m, h as n, parseColor as p, valueHandlers as v, xyzMap as x };
@@ -1,4 +1,4 @@
1
- import { T as Theme } from './types-ef1d7462';
1
+ import { T as Theme } from './types-20b16474';
2
2
 
3
3
  declare const colors: Theme['colors'];
4
4
 
package/dist/colors.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { c as colors } from './colors-0db1b382';
2
- import './types-ef1d7462';
1
+ export { c as colors } from './colors-e269d6e0';
2
+ import './types-20b16474';
@@ -1,4 +1,4 @@
1
- import { T as Theme } from './types-ef1d7462';
1
+ import { T as Theme } from './types-20b16474';
2
2
 
3
3
  declare const theme: Theme;
4
4
 
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { PresetOptions, Preset } from '@unocss/core';
2
- import { T as Theme } from './types-ef1d7462';
3
- export { T as Theme, a as ThemeAnimation } from './types-ef1d7462';
4
- export { t as theme } from './default-3eaf5bb0';
5
- export { c as colors } from './colors-0db1b382';
6
- export { p as parseColor } from './utilities-43c87ad4';
2
+ import { T as Theme } from './types-20b16474';
3
+ export { T as Theme, a as ThemeAnimation } from './types-20b16474';
4
+ export { t as theme } from './default-c3837f44';
5
+ export { c as colors } from './colors-e269d6e0';
6
+ export { p as parseColor } from './utilities-9f0998a3';
7
7
 
8
8
  interface PresetMiniOptions extends PresetOptions {
9
9
  /**
package/dist/rules.cjs CHANGED
@@ -44,7 +44,6 @@ exports.questionMark = _default.questionMark;
44
44
  exports.resizes = _default.resizes;
45
45
  exports.rings = _default.rings;
46
46
  exports.rules = _default.rules;
47
- exports.shadowBase = _default.shadowBase;
48
47
  exports.sizes = _default.sizes;
49
48
  exports.svgUtilities = _default.svgUtilities;
50
49
  exports.tabSizes = _default.tabSizes;
package/dist/rules.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Rule } from '@unocss/core';
2
- import { T as Theme } from './types-ef1d7462';
2
+ import { T as Theme } from './types-20b16474';
3
3
 
4
4
  declare const verticalAligns: Rule[];
5
5
  declare const textAligns: Rule[];
@@ -26,7 +26,7 @@ declare const flex: Rule[];
26
26
 
27
27
  declare const gaps: Rule[];
28
28
 
29
- declare const grids: Rule[];
29
+ declare const grids: Rule<Theme>[];
30
30
 
31
31
  declare const overflows: Rule[];
32
32
 
@@ -49,13 +49,6 @@ declare const questionMark: Rule[];
49
49
 
50
50
  declare const rings: Rule<Theme>[];
51
51
 
52
- declare const shadowBase: {
53
- "$$shortcut-no-merge": string;
54
- '--un-ring-offset-shadow': string;
55
- '--un-ring-shadow': string;
56
- '--un-shadow-inset': string;
57
- '--un-shadow': string;
58
- };
59
52
  declare const boxShadows: Rule<Theme>[];
60
53
 
61
54
  declare const sizes: Rule<Theme>[];
@@ -96,4 +89,4 @@ declare const cssProperty: Rule[];
96
89
 
97
90
  declare const textDecorations: Rule[];
98
91
 
99
- export { alignments, appearance, appearances, aspectRatio, bgColors, borders, boxShadows, boxSizing, breaks, contents, cssProperty, cssVariables, cursors, displays, flex, floats, fontSmoothings, fontStyles, fonts, gaps, grids, insets, justifies, margins, opacity, orders, outline, overflows, paddings, placements, pointerEvents, positions, questionMark, resizes, rings, rules, shadowBase, sizes, svgUtilities, tabSizes, textAligns, textColors, textDecorations, textIndents, textOverflows, textShadows, textStrokes, textTransforms, transforms, transitions, userSelects, varEmpty, verticalAligns, whitespaces, willChange, zIndexes };
92
+ export { alignments, appearance, appearances, aspectRatio, bgColors, borders, boxShadows, boxSizing, breaks, contents, cssProperty, cssVariables, cursors, displays, flex, floats, fontSmoothings, fontStyles, fonts, gaps, grids, insets, justifies, margins, opacity, orders, outline, overflows, paddings, placements, pointerEvents, positions, questionMark, resizes, rings, rules, sizes, svgUtilities, tabSizes, textAligns, textColors, textDecorations, textIndents, textOverflows, textShadows, textStrokes, textTransforms, transforms, transitions, userSelects, varEmpty, verticalAligns, whitespaces, willChange, zIndexes };
package/dist/rules.mjs CHANGED
@@ -1,3 +1,3 @@
1
- export { l as alignments, a as appearance, H as appearances, C as aspectRatio, e as bgColors, b as borders, A as boxShadows, s as boxSizing, O as breaks, N as contents, a0 as cssProperty, $ as cssVariables, I as cursors, G as displays, f as flex, q as floats, S as fontSmoothings, R as fontStyles, W as fonts, g as gaps, h as grids, n as insets, j as justifies, E as margins, c as opacity, k as orders, o as outline, i as overflows, D as paddings, m as placements, J as pointerEvents, p as positions, u as questionMark, K as resizes, x as rings, r as rules, y as shadowBase, B as sizes, T as svgUtilities, X as tabSizes, t as textAligns, d as textColors, a1 as textDecorations, Y as textIndents, P as textOverflows, _ as textShadows, Z as textStrokes, Q as textTransforms, U as transforms, V as transitions, L as userSelects, F as varEmpty, v as verticalAligns, M as whitespaces, w as willChange, z as zIndexes } from './chunks/default2.mjs';
1
+ export { l as alignments, a as appearance, G as appearances, B as aspectRatio, e as bgColors, b as borders, y as boxShadows, s as boxSizing, N as breaks, M as contents, $ as cssProperty, _ as cssVariables, H as cursors, F as displays, f as flex, q as floats, R as fontSmoothings, Q as fontStyles, V as fonts, g as gaps, h as grids, n as insets, j as justifies, D as margins, c as opacity, k as orders, o as outline, i as overflows, C as paddings, m as placements, I as pointerEvents, p as positions, u as questionMark, J as resizes, x as rings, r as rules, A as sizes, S as svgUtilities, W as tabSizes, t as textAligns, d as textColors, a0 as textDecorations, X as textIndents, O as textOverflows, Z as textShadows, Y as textStrokes, P as textTransforms, T as transforms, U as transitions, K as userSelects, E as varEmpty, v as verticalAligns, L as whitespaces, w as willChange, z as zIndexes } from './chunks/default2.mjs';
2
2
  import './chunks/utilities.mjs';
3
3
  import '@unocss/core';
package/dist/theme.cjs CHANGED
@@ -17,6 +17,12 @@ exports.dropShadow = _default.dropShadow;
17
17
  exports.easing = _default.easing;
18
18
  exports.fontFamily = _default.fontFamily;
19
19
  exports.fontSize = _default.fontSize;
20
+ exports.gridAutoColumn = _default.gridAutoColumn;
21
+ exports.gridAutoRow = _default.gridAutoRow;
22
+ exports.gridColumn = _default.gridColumn;
23
+ exports.gridRow = _default.gridRow;
24
+ exports.gridTemplateColumn = _default.gridTemplateColumn;
25
+ exports.gridTemplateRow = _default.gridTemplateRow;
20
26
  exports.height = _default.height;
21
27
  exports.letterSpacing = _default.letterSpacing;
22
28
  exports.lineHeight = _default.lineHeight;
package/dist/theme.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { c as colors } from './colors-0db1b382';
2
- export { t as theme } from './default-3eaf5bb0';
3
- import { T as Theme } from './types-ef1d7462';
4
- export { T as Theme, a as ThemeAnimation } from './types-ef1d7462';
1
+ export { c as colors } from './colors-e269d6e0';
2
+ export { t as theme } from './default-c3837f44';
3
+ import { T as Theme } from './types-20b16474';
4
+ export { T as Theme, a as ThemeAnimation } from './types-20b16474';
5
5
 
6
6
  declare const blur: {
7
7
  DEFAULT: string;
@@ -36,6 +36,45 @@ declare const lineHeight: Theme['lineHeight'];
36
36
  declare const letterSpacing: Theme['letterSpacing'];
37
37
  declare const wordSpacing: Theme['wordSpacing'];
38
38
 
39
+ declare const gridAutoColumn: {
40
+ xs: string;
41
+ sm: string;
42
+ base: string;
43
+ lg: string;
44
+ xl: string;
45
+ '2xl': string;
46
+ '3xl': string;
47
+ '4xl': string;
48
+ '5xl': string;
49
+ '6xl': string;
50
+ '7xl': string;
51
+ '8xl': string;
52
+ '9xl': string;
53
+ };
54
+ declare const gridAutoRow: {
55
+ xs: string;
56
+ sm: string;
57
+ base: string;
58
+ lg: string;
59
+ xl: string;
60
+ '2xl': string;
61
+ '3xl': string;
62
+ '4xl': string;
63
+ '5xl': string;
64
+ '6xl': string;
65
+ '7xl': string;
66
+ '8xl': string;
67
+ '9xl': string;
68
+ };
69
+ declare const gridColumn: {};
70
+ declare const gridRow: {};
71
+ declare const gridTemplateColumn: {
72
+ none: string;
73
+ };
74
+ declare const gridTemplateRow: {
75
+ none: string;
76
+ };
77
+
39
78
  declare const breakpoints: {
40
79
  sm: string;
41
80
  md: string;
@@ -158,4 +197,4 @@ declare const maxHeight: {
158
197
  none: string;
159
198
  };
160
199
 
161
- export { baseSize, blur, borderRadius, boxShadow, breakpoints, dropShadow, easing, fontFamily, fontSize, height, letterSpacing, lineHeight, maxHeight, maxWidth, textIndent, textShadow, textStrokeWidth, verticalBreakpoints, width, wordSpacing };
200
+ export { baseSize, blur, borderRadius, boxShadow, breakpoints, dropShadow, easing, fontFamily, fontSize, gridAutoColumn, gridAutoRow, gridColumn, gridRow, gridTemplateColumn, gridTemplateRow, height, letterSpacing, lineHeight, maxHeight, maxWidth, textIndent, textShadow, textStrokeWidth, verticalBreakpoints, width, wordSpacing };
package/dist/theme.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  export { c as colors } from './chunks/colors.mjs';
2
- export { n as baseSize, b as blur, j as borderRadius, k as boxShadow, i as breakpoints, d as dropShadow, m as easing, f as fontFamily, a as fontSize, q as height, h as letterSpacing, l as lineHeight, r as maxHeight, p as maxWidth, c as textIndent, g as textShadow, e as textStrokeWidth, t as theme, v as verticalBreakpoints, o as width, w as wordSpacing } from './chunks/default.mjs';
2
+ export { u as baseSize, b as blur, q as borderRadius, r as boxShadow, p as breakpoints, d as dropShadow, s as easing, f as fontFamily, a as fontSize, i as gridAutoColumn, j as gridAutoRow, k as gridColumn, m as gridRow, n as gridTemplateColumn, o as gridTemplateRow, z as height, h as letterSpacing, l as lineHeight, A as maxHeight, y as maxWidth, c as textIndent, g as textShadow, e as textStrokeWidth, t as theme, v as verticalBreakpoints, x as width, w as wordSpacing } from './chunks/default.mjs';
@@ -35,6 +35,12 @@ interface Theme {
35
35
  easing?: Record<string, string>;
36
36
  media?: Record<string, string>;
37
37
  animation?: ThemeAnimation;
38
+ gridAutoColumn?: Record<string, string>;
39
+ gridAutoRow?: Record<string, string>;
40
+ gridColumn?: Record<string, string>;
41
+ gridRow?: Record<string, string>;
42
+ gridTemplateColumn?: Record<string, string>;
43
+ gridTemplateRow?: Record<string, string>;
38
44
  }
39
45
 
40
46
  export { Theme as T, ThemeAnimation as a };
@@ -1,23 +1,22 @@
1
- import { DynamicMatcher, ParsedColorValue } from '@unocss/core';
2
- import { T as Theme } from './types-ef1d7462';
1
+ import { CSSEntries, ParsedColorValue, RuleContext, CSSObject } from '@unocss/core';
2
+ import { T as Theme } from './types-20b16474';
3
3
 
4
4
  /**
5
5
  * Provide {@link DynamicMatcher} function returning spacing definition. See spacing rules.
6
6
  *
7
7
  * @param {string} propertyPrefix - Property for the css value to be created. Postfix will be appended according to direction matched.
8
- * @return {DynamicMatcher} {@link DynamicMatcher}
8
+ * @return {@link DynamicMatcher} object.
9
9
  * @see {@link directionMap}
10
10
  */
11
- declare const directionSize: (propertyPrefix: string) => DynamicMatcher;
11
+ declare const directionSize: (propertyPrefix: string) => ([_, direction, size]: string[]) => CSSEntries | undefined;
12
12
  /**
13
- * Parse color string into rgba (if possible) with opacity. Color value will be matched to theme object before converting to rgb value.
13
+ * Parse color string into {@link ParsedColorValue} (if possible). Color value will first be matched to theme object before parsing.
14
+ * See also color.tests.ts for more examples.
14
15
  *
15
16
  * @example Parseable strings:
16
17
  * 'red' // From theme, if 'red' is available
17
18
  * 'red-100' // From theme, plus scale
18
19
  * 'red-100/20' // From theme, plus scale/opacity
19
- * '#f12' // Hex color
20
- * 'hex-f12' // Alternative hex color
21
20
  * '[rgb(100,2,3)]/[var(--op)]' // Bracket with rgb color and bracket with opacity
22
21
  *
23
22
  * @param {string} body - Color string to be parsed.
@@ -36,21 +35,22 @@ declare const parseColor: (body: string, theme: Theme) => ParsedColorValue | und
36
35
  *
37
36
  * @example Resolving 'red-100' from theme:
38
37
  * colorResolver('background-color', 'background')('', 'red-100')
39
- * return { '--un-background-opacity': '1', 'background-color': 'rgb(254,226,226,var(--un-bg-opacity))' }
38
+ * return { '--un-background-opacity': '1', 'background-color': 'rgba(254,226,226,var(--un-bg-opacity))' }
40
39
  *
41
40
  * @example Resolving 'red-100/20' from theme:
42
41
  * colorResolver('background-color', 'background')('', 'red-100/20')
43
- * return { 'background-color': 'rgb(204,251,241,0.22)' }
42
+ * return { 'background-color': 'rgba(204,251,241,0.22)' }
44
43
  *
45
44
  * @example Resolving 'hex-124':
46
45
  * colorResolver('color', 'text')('', 'hex-124')
47
- * return { '--un-text-opacity': '1', 'color': 'rgb(17,34,68,var(--un-text-opacity))' }
46
+ * return { '--un-text-opacity': '1', 'color': 'rgba(17,34,68,var(--un-text-opacity))' }
48
47
  *
49
48
  * @param {string} property - Property for the css value to be created.
50
49
  * @param {string} varName - Base name for the opacity variable.
51
- * @return {DynamicMatcher} {@link DynamicMatcher} object.
50
+ * @return {@link DynamicMatcher} object.
52
51
  */
53
- declare const colorResolver: (property: string, varName: string) => DynamicMatcher;
52
+ declare const colorResolver: (property: string, varName: string) => ([, body]: string[], { theme }: RuleContext<Theme>) => CSSObject | undefined;
54
53
  declare const colorableShadows: (shadows: string | string[], colorVar: string) => string[];
54
+ declare const hasParseableColor: (color: string | undefined, theme: Theme) => boolean;
55
55
 
56
- export { colorableShadows as a, colorResolver as c, directionSize as d, parseColor as p };
56
+ export { colorableShadows as a, colorResolver as c, directionSize as d, hasParseableColor as h, parseColor as p };
package/dist/utils.cjs CHANGED
@@ -17,6 +17,7 @@ exports.directionSize = utilities.directionSize;
17
17
  exports.getComponents = utilities.getComponents;
18
18
  exports.h = utilities.h;
19
19
  exports.handler = utilities.handler;
20
+ exports.hasParseableColor = utilities.hasParseableColor;
20
21
  exports.hex2rgba = utilities.hex2rgba;
21
22
  exports.insetMap = utilities.insetMap;
22
23
  exports.parseColor = utilities.parseColor;
package/dist/utils.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _unocss_core from '@unocss/core';
2
2
  import { RGBAColorValue, CSSColorValue, VariantHandler } from '@unocss/core';
3
- export { c as colorResolver, a as colorableShadows, d as directionSize, p as parseColor } from './utilities-43c87ad4';
4
- import './types-ef1d7462';
3
+ export { c as colorResolver, a as colorableShadows, d as directionSize, h as hasParseableColor, p as parseColor } from './utilities-9f0998a3';
4
+ import './types-20b16474';
5
5
 
6
6
  declare function hex2rgba(hex?: string): RGBAColorValue | undefined;
7
7
  declare function parseCssColor(str?: string): CSSColorValue | undefined;
@@ -22,6 +22,8 @@ declare function number(str: string): string | undefined;
22
22
  declare function percent(str: string): string | undefined;
23
23
  declare function fraction(str: string): string | undefined;
24
24
  declare function bracket(str: string): string | undefined;
25
+ declare function bracketOfColor(str: string): string | undefined;
26
+ declare function bracketOfLength(str: string): string | undefined;
25
27
  declare function cssvar(str: string): string | undefined;
26
28
  declare function time(str: string): string | undefined;
27
29
  declare function degree(str: string): string | undefined;
@@ -36,6 +38,8 @@ declare const handlers_number: typeof number;
36
38
  declare const handlers_percent: typeof percent;
37
39
  declare const handlers_fraction: typeof fraction;
38
40
  declare const handlers_bracket: typeof bracket;
41
+ declare const handlers_bracketOfColor: typeof bracketOfColor;
42
+ declare const handlers_bracketOfLength: typeof bracketOfLength;
39
43
  declare const handlers_cssvar: typeof cssvar;
40
44
  declare const handlers_time: typeof time;
41
45
  declare const handlers_degree: typeof degree;
@@ -51,6 +55,8 @@ declare namespace handlers {
51
55
  handlers_percent as percent,
52
56
  handlers_fraction as fraction,
53
57
  handlers_bracket as bracket,
58
+ handlers_bracketOfColor as bracketOfColor,
59
+ handlers_bracketOfLength as bracketOfLength,
54
60
  handlers_cssvar as cssvar,
55
61
  handlers_time as time,
56
62
  handlers_degree as degree,
@@ -59,8 +65,8 @@ declare namespace handlers {
59
65
  };
60
66
  }
61
67
 
62
- declare const handler: _unocss_core.ValueHandler<"number" | "auto" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "cssvar" | "time" | "degree" | "global" | "properties">;
63
- declare const h: _unocss_core.ValueHandler<"number" | "auto" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "cssvar" | "time" | "degree" | "global" | "properties">;
68
+ declare const handler: _unocss_core.ValueHandler<"number" | "auto" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "cssvar" | "time" | "degree" | "global" | "properties">;
69
+ declare const h: _unocss_core.ValueHandler<"number" | "auto" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "cssvar" | "time" | "degree" | "global" | "properties">;
64
70
 
65
71
  declare const variantMatcher: (name: string, selector?: ((input: string) => string | undefined) | undefined) => (input: string) => VariantHandler | undefined;
66
72
  declare const variantParentMatcher: (name: string, parent: string) => (input: string) => VariantHandler | undefined;
package/dist/utils.mjs CHANGED
@@ -1,3 +1,3 @@
1
- export { c as colorResolver, a as colorToString, e as colorableShadows, b as cornerMap, d as directionMap, f as directionSize, l as getComponents, m as h, h as handler, j as hex2rgba, i as insetMap, p as parseColor, k as parseCssColor, g as positionMap, v as valueHandlers, x as xyzMap } from './chunks/utilities.mjs';
1
+ export { c as colorResolver, b as colorToString, f as colorableShadows, e as cornerMap, d as directionMap, g as directionSize, m as getComponents, n as h, h as handler, a as hasParseableColor, k as hex2rgba, i as insetMap, p as parseColor, l as parseCssColor, j as positionMap, v as valueHandlers, x as xyzMap } from './chunks/utilities.mjs';
2
2
  export { a as variantMatcher, v as variantParentMatcher } from './chunks/variants.mjs';
3
3
  import '@unocss/core';
@@ -1,9 +1,9 @@
1
1
  import { Variant, VariantFunction, VariantObject } from '@unocss/core';
2
- import { T as Theme } from './types-ef1d7462';
2
+ import { T as Theme } from './types-20b16474';
3
3
  import { PresetMiniOptions } from './index';
4
- import './default-3eaf5bb0';
5
- import './colors-0db1b382';
6
- import './utilities-43c87ad4';
4
+ import './default-c3837f44';
5
+ import './colors-e269d6e0';
6
+ import './utilities-9f0998a3';
7
7
 
8
8
  declare const variantBreakpoints: Variant<Theme>;
9
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-mini",
3
- "version": "0.25.1",
3
+ "version": "0.26.0",
4
4
  "description": "The minimal preset for UnoCSS",
5
5
  "keywords": [
6
6
  "unocss",
@@ -61,7 +61,7 @@
61
61
  "*.css"
62
62
  ],
63
63
  "dependencies": {
64
- "@unocss/core": "0.25.1"
64
+ "@unocss/core": "0.26.0"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "unbuild",