@unocss/preset-mini 0.26.1 → 0.26.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.
@@ -72,11 +72,11 @@ const textStrokeWidth = {
72
72
  };
73
73
  const textShadow = {
74
74
  DEFAULT: ["0 0 1px rgba(0,0,0,0.2)", "0 0 1px rgba(1,0,5,0.1)"],
75
+ none: "0 0 #0000",
75
76
  sm: "1px 1px 3px rgba(36,37,47,0.25)",
76
77
  md: ["0 1px 2px rgba(30,29,39,0.19)", "1px 2px 4px rgba(54,64,147,0.18)"],
77
78
  lg: ["3px 3px 6px rgba(0,0,0,0.26)", "0 0 5px rgba(15,3,86,0.22)"],
78
- xl: ["1px 1px 3px rgba(0,0,0,0.29)", "2px 4px 7px rgba(73,64,125,0.35)"],
79
- none: "0 0 #0000"
79
+ xl: ["1px 1px 3px rgba(0,0,0,0.29)", "2px 4px 7px rgba(73,64,125,0.35)"]
80
80
  };
81
81
  const lineHeight = {
82
82
  none: "1",
@@ -104,9 +104,33 @@ const breakpoints = {
104
104
  "2xl": "1536px"
105
105
  };
106
106
  const verticalBreakpoints = { ...breakpoints };
107
+ const lineWidth = {
108
+ DEFAULT: "1px",
109
+ none: "0px"
110
+ };
111
+ const spacing = {
112
+ "DEFAULT": "1rem",
113
+ "none": "0rem",
114
+ "xs": "0.75rem",
115
+ "sm": "0.875rem",
116
+ "lg": "1.125rem",
117
+ "xl": "1.25rem",
118
+ "2xl": "1.5rem",
119
+ "3xl": "1.875rem",
120
+ "4xl": "2.25rem",
121
+ "5xl": "3rem",
122
+ "6xl": "3.75rem",
123
+ "7xl": "4.5rem",
124
+ "8xl": "6rem",
125
+ "9xl": "8rem"
126
+ };
127
+ const duration = {
128
+ DEFAULT: "150ms",
129
+ none: "0ms"
130
+ };
107
131
  const borderRadius = {
108
132
  "DEFAULT": "0.25rem",
109
- "none": "0px",
133
+ "none": "0rem",
110
134
  "sm": "0.125rem",
111
135
  "md": "0.375rem",
112
136
  "lg": "0.5rem",
@@ -117,13 +141,13 @@ const borderRadius = {
117
141
  };
118
142
  const boxShadow = {
119
143
  "DEFAULT": ["var(--un-shadow-inset) 0 1px 3px 0 rgba(0,0,0,0.1)", "var(--un-shadow-inset) 0 1px 2px -1px rgba(0,0,0,0.1)"],
144
+ "none": "0 0 #0000",
120
145
  "sm": "var(--un-shadow-inset) 0 1px 2px 0 rgba(0,0,0,0.05)",
121
146
  "md": ["var(--un-shadow-inset) 0 4px 6px -1px rgba(0,0,0,0.1)", "var(--un-shadow-inset) 0 2px 4px -2px rgba(0,0,0,0.1)"],
122
147
  "lg": ["var(--un-shadow-inset) 0 10px 15px -3px rgba(0,0,0,0.1)", "var(--un-shadow-inset) 0 4px 6px -4px rgba(0,0,0,0.1)"],
123
148
  "xl": ["var(--un-shadow-inset) 0 20px 25px -5px rgba(0,0,0,0.1)", "var(--un-shadow-inset) 0 8px 10px -6px rgba(0,0,0,0.1)"],
124
149
  "2xl": "var(--un-shadow-inset) 0 25px 50px -12px rgba(0,0,0,0.25)",
125
- "inner": "inset 0 2px 4px 0 rgba(0,0,0,0.05)",
126
- "none": "0 0 #0000"
150
+ "inner": "inset 0 2px 4px 0 rgba(0,0,0,0.05)"
127
151
  };
128
152
  const easing = {
129
153
  "DEFAULT": "cubic-bezier(0.4, 0, 0.2, 1)",
@@ -132,6 +156,10 @@ const easing = {
132
156
  "out": "cubic-bezier(0, 0, 0.2, 1)",
133
157
  "in-out": "cubic-bezier(0.4, 0, 0.2, 1)"
134
158
  };
159
+ const ringWidth = {
160
+ DEFAULT: "1px",
161
+ none: "0px"
162
+ };
135
163
 
136
164
  const blur = {
137
165
  "DEFAULT": "8px",
@@ -188,29 +216,6 @@ const maxHeight = {
188
216
  screen: "100vh"
189
217
  };
190
218
 
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
-
214
219
  const theme = {
215
220
  width,
216
221
  height,
@@ -240,12 +245,10 @@ const theme = {
240
245
  blur,
241
246
  dropShadow,
242
247
  easing,
243
- gridAutoColumn,
244
- gridAutoRow,
245
- gridColumn,
246
- gridRow,
247
- gridTemplateColumn,
248
- gridTemplateRow
248
+ lineWidth,
249
+ spacing,
250
+ duration,
251
+ ringWidth
249
252
  };
250
253
 
251
254
  exports.baseSize = baseSize;
@@ -254,20 +257,18 @@ exports.borderRadius = borderRadius;
254
257
  exports.boxShadow = boxShadow;
255
258
  exports.breakpoints = breakpoints;
256
259
  exports.dropShadow = dropShadow;
260
+ exports.duration = duration;
257
261
  exports.easing = easing;
258
262
  exports.fontFamily = fontFamily;
259
263
  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;
266
264
  exports.height = height;
267
265
  exports.letterSpacing = letterSpacing;
268
266
  exports.lineHeight = lineHeight;
267
+ exports.lineWidth = lineWidth;
269
268
  exports.maxHeight = maxHeight;
270
269
  exports.maxWidth = maxWidth;
270
+ exports.ringWidth = ringWidth;
271
+ exports.spacing = spacing;
271
272
  exports.textIndent = textIndent;
272
273
  exports.textShadow = textShadow;
273
274
  exports.textStrokeWidth = textStrokeWidth;
@@ -70,11 +70,11 @@ const textStrokeWidth = {
70
70
  };
71
71
  const textShadow = {
72
72
  DEFAULT: ["0 0 1px rgba(0,0,0,0.2)", "0 0 1px rgba(1,0,5,0.1)"],
73
+ none: "0 0 #0000",
73
74
  sm: "1px 1px 3px rgba(36,37,47,0.25)",
74
75
  md: ["0 1px 2px rgba(30,29,39,0.19)", "1px 2px 4px rgba(54,64,147,0.18)"],
75
76
  lg: ["3px 3px 6px rgba(0,0,0,0.26)", "0 0 5px rgba(15,3,86,0.22)"],
76
- xl: ["1px 1px 3px rgba(0,0,0,0.29)", "2px 4px 7px rgba(73,64,125,0.35)"],
77
- none: "0 0 #0000"
77
+ xl: ["1px 1px 3px rgba(0,0,0,0.29)", "2px 4px 7px rgba(73,64,125,0.35)"]
78
78
  };
79
79
  const lineHeight = {
80
80
  none: "1",
@@ -102,9 +102,33 @@ const breakpoints = {
102
102
  "2xl": "1536px"
103
103
  };
104
104
  const verticalBreakpoints = { ...breakpoints };
105
+ const lineWidth = {
106
+ DEFAULT: "1px",
107
+ none: "0px"
108
+ };
109
+ const spacing = {
110
+ "DEFAULT": "1rem",
111
+ "none": "0rem",
112
+ "xs": "0.75rem",
113
+ "sm": "0.875rem",
114
+ "lg": "1.125rem",
115
+ "xl": "1.25rem",
116
+ "2xl": "1.5rem",
117
+ "3xl": "1.875rem",
118
+ "4xl": "2.25rem",
119
+ "5xl": "3rem",
120
+ "6xl": "3.75rem",
121
+ "7xl": "4.5rem",
122
+ "8xl": "6rem",
123
+ "9xl": "8rem"
124
+ };
125
+ const duration = {
126
+ DEFAULT: "150ms",
127
+ none: "0ms"
128
+ };
105
129
  const borderRadius = {
106
130
  "DEFAULT": "0.25rem",
107
- "none": "0px",
131
+ "none": "0rem",
108
132
  "sm": "0.125rem",
109
133
  "md": "0.375rem",
110
134
  "lg": "0.5rem",
@@ -115,13 +139,13 @@ const borderRadius = {
115
139
  };
116
140
  const boxShadow = {
117
141
  "DEFAULT": ["var(--un-shadow-inset) 0 1px 3px 0 rgba(0,0,0,0.1)", "var(--un-shadow-inset) 0 1px 2px -1px rgba(0,0,0,0.1)"],
142
+ "none": "0 0 #0000",
118
143
  "sm": "var(--un-shadow-inset) 0 1px 2px 0 rgba(0,0,0,0.05)",
119
144
  "md": ["var(--un-shadow-inset) 0 4px 6px -1px rgba(0,0,0,0.1)", "var(--un-shadow-inset) 0 2px 4px -2px rgba(0,0,0,0.1)"],
120
145
  "lg": ["var(--un-shadow-inset) 0 10px 15px -3px rgba(0,0,0,0.1)", "var(--un-shadow-inset) 0 4px 6px -4px rgba(0,0,0,0.1)"],
121
146
  "xl": ["var(--un-shadow-inset) 0 20px 25px -5px rgba(0,0,0,0.1)", "var(--un-shadow-inset) 0 8px 10px -6px rgba(0,0,0,0.1)"],
122
147
  "2xl": "var(--un-shadow-inset) 0 25px 50px -12px rgba(0,0,0,0.25)",
123
- "inner": "inset 0 2px 4px 0 rgba(0,0,0,0.05)",
124
- "none": "0 0 #0000"
148
+ "inner": "inset 0 2px 4px 0 rgba(0,0,0,0.05)"
125
149
  };
126
150
  const easing = {
127
151
  "DEFAULT": "cubic-bezier(0.4, 0, 0.2, 1)",
@@ -130,6 +154,10 @@ const easing = {
130
154
  "out": "cubic-bezier(0, 0, 0.2, 1)",
131
155
  "in-out": "cubic-bezier(0.4, 0, 0.2, 1)"
132
156
  };
157
+ const ringWidth = {
158
+ DEFAULT: "1px",
159
+ none: "0px"
160
+ };
133
161
 
134
162
  const blur = {
135
163
  "DEFAULT": "8px",
@@ -186,29 +214,6 @@ const maxHeight = {
186
214
  screen: "100vh"
187
215
  };
188
216
 
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
-
212
217
  const theme = {
213
218
  width,
214
219
  height,
@@ -238,12 +243,10 @@ const theme = {
238
243
  blur,
239
244
  dropShadow,
240
245
  easing,
241
- gridAutoColumn,
242
- gridAutoRow,
243
- gridColumn,
244
- gridRow,
245
- gridTemplateColumn,
246
- gridTemplateRow
246
+ lineWidth,
247
+ spacing,
248
+ duration,
249
+ ringWidth
247
250
  };
248
251
 
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 };
252
+ 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, lineWidth as j, duration as k, lineHeight as l, borderRadius as m, boxShadow as n, easing as o, baseSize as p, width as q, ringWidth as r, spacing as s, theme as t, maxWidth as u, verticalBreakpoints as v, wordSpacing as w, height as x, maxHeight as y };
@@ -19,9 +19,9 @@ const textAligns = [
19
19
  ];
20
20
 
21
21
  const outline = [
22
- [/^outline-(?:width-|size-)?(.+)$/, ([, d]) => ({ "outline-width": utilities.handler.bracket.cssvar.px(d) })],
22
+ [/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) })],
23
23
  [/^outline-(?:color-)?(.+)$/, utilities.colorResolver("outline-color", "outline-color")],
24
- [/^outline-offset-(.+)$/, ([, d]) => ({ "outline-offset": utilities.handler.bracket.cssvar.px(d) })],
24
+ [/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) })],
25
25
  ["outline", { "outline-style": "solid" }],
26
26
  [/^outline-(auto|dashed|dotted|double|hidden|solid|groove|ridge|inset|outset|inherit|initial|revert|unset)$/, ([, c]) => ({ "outline-style": c })],
27
27
  ["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }]
@@ -104,8 +104,8 @@ const borderColorResolver = (direction) => ([, body], theme) => {
104
104
  };
105
105
  }
106
106
  };
107
- function handlerBorder(m) {
108
- const borderSizes = handlerBorderSize(m);
107
+ function handlerBorder(m, ctx) {
108
+ const borderSizes = handlerBorderSize(m, ctx);
109
109
  if (borderSizes) {
110
110
  return [
111
111
  ...borderSizes,
@@ -113,8 +113,8 @@ function handlerBorder(m) {
113
113
  ];
114
114
  }
115
115
  }
116
- function handlerBorderSize([, a = "", b = "1"]) {
117
- const v = utilities.handler.bracket.cssvar.px(b);
116
+ function handlerBorderSize([, a = "", b], { theme }) {
117
+ const v = theme.lineWidth?.[b || "DEFAULT"] ?? utilities.handler.bracket.cssvar.px(b || "1");
118
118
  if (a in utilities.directionMap && v != null)
119
119
  return utilities.directionMap[a].map((i) => [`border${i}-width`, v]);
120
120
  }
@@ -128,8 +128,8 @@ function handlerBorderOpacity([, a = "", opacity]) {
128
128
  if (a in utilities.directionMap && v != null)
129
129
  return utilities.directionMap[a].map((i) => [`--un-border${i}-opacity`, v]);
130
130
  }
131
- function handlerRounded([, a = "", s = "DEFAULT"], { theme }) {
132
- const v = theme.borderRadius?.[s] || utilities.handler.bracket.cssvar.fraction.rem(s);
131
+ function handlerRounded([, a = "", s], { theme }) {
132
+ const v = theme.borderRadius?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.fraction.rem(s || "1");
133
133
  if (a in utilities.cornerMap && v != null)
134
134
  return utilities.cornerMap[a].map((i) => [`border${i}-radius`, v]);
135
135
  }
@@ -158,18 +158,19 @@ const transitionProperty = (prop) => {
158
158
  return utilities.handler.properties(prop) ?? transitionPropertyGroup[prop];
159
159
  };
160
160
  const transitions = [
161
- [/^transition(?:-([a-z-]+(?:,[a-z-]+)*))?(?:-(\d+))?$/, ([, prop, duration = "150"]) => {
161
+ [/^transition(?:-([a-z-]+(?:,[a-z-]+)*))?(?:-(\d+))?$/, ([, prop, d], { theme }) => {
162
162
  const p = prop != null ? transitionProperty(prop) : [transitionPropertyGroup.colors, "opacity", "box-shadow", "transform", "filter", "backdrop-filter"].join(",");
163
163
  if (p) {
164
+ const duration = theme.duration?.[d || "DEFAULT"] ?? utilities.handler.time(d || "150");
164
165
  return {
165
166
  "transition-property": p,
166
167
  "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)",
167
- "transition-duration": `${duration}ms`
168
+ "transition-duration": duration
168
169
  };
169
170
  }
170
171
  }],
171
- [/^(?:transition-)?duration-(.+)$/, ([, d]) => ({ "transition-duration": utilities.handler.bracket.cssvar.time(d) })],
172
- [/^(?:transition-)?delay-(.+)$/, ([, d]) => ({ "transition-delay": utilities.handler.bracket.cssvar.time(d) })],
172
+ [/^(?:transition-)?duration-(.+)$/, ([, d], { theme }) => ({ "transition-duration": theme.duration?.[d || "DEFAULT"] ?? utilities.handler.bracket.cssvar.time(d) })],
173
+ [/^(?:transition-)?delay-(.+)$/, ([, d], { theme }) => ({ "transition-delay": theme.duration?.[d || "DEFAULT"] ?? utilities.handler.bracket.cssvar.time(d) })],
173
174
  [/^(?:transition-)?ease(?:-(.+))?$/, ([, d], { theme }) => ({ "transition-timing-function": theme.easing?.[d || "DEFAULT"] ?? utilities.handler.bracket.cssvar(d) })],
174
175
  [/^(?:transition-)?property-(.+)$/, ([, v]) => ({ "transition-property": utilities.handler.global(v) || transitionProperty(v) })],
175
176
  ["transition-none", { transition: "none" }]
@@ -188,7 +189,7 @@ const flex = [
188
189
  [/^(?:flex-)?shrink-0$/, () => ({ "flex-shrink": 0 })],
189
190
  [/^(?:flex-)?grow$/, () => ({ "flex-grow": 1 })],
190
191
  [/^(?:flex-)?grow-0$/, () => ({ "flex-grow": 0 })],
191
- [/^(?:flex-)?basis-(.+)$/, ([, d]) => ({ "flex-basis": utilities.handler.bracket.cssvar.auto.fraction.rem(d) })],
192
+ [/^(?:flex-)?basis-(.+)$/, ([, d], { theme }) => ({ "flex-basis": theme.spacing?.[d] ?? utilities.handler.bracket.cssvar.auto.fraction.rem(d) })],
192
193
  ["flex-row", { "flex-direction": "row" }],
193
194
  ["flex-row-reverse", { "flex-direction": "row-reverse" }],
194
195
  ["flex-col", { "flex-direction": "column" }],
@@ -222,7 +223,12 @@ const fonts = [
222
223
  }
223
224
  return { "font-size": utilities.handler.bracketOfLength.rem(s) };
224
225
  }],
225
- [/^text-size-(.+)$/, ([, s]) => ({ "font-size": utilities.handler.bracket.cssvar.rem(s) })],
226
+ [/^text-size-(.+)$/, ([, s], { theme }) => {
227
+ const themed = core.toArray(theme.fontSize?.[s]);
228
+ const size = themed?.[0] ?? utilities.handler.bracket.cssvar.rem(s);
229
+ if (size != null)
230
+ return { "font-size": size };
231
+ }],
226
232
  [/^(?:font|fw)-?([^-]+)$/, ([, s]) => ({ "font-weight": weightMap[s] || utilities.handler.number(s) })],
227
233
  [/^(?:leading|lh)-(.+)$/, ([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] || utilities.handler.bracket.cssvar.rem(s) })],
228
234
  [/^tracking-(.+)$/, ([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || utilities.handler.bracket.cssvar.rem(s) })],
@@ -268,8 +274,8 @@ const directions = {
268
274
  "x": "column-",
269
275
  "y": "row-"
270
276
  };
271
- const handleGap = ([, d = "", s]) => {
272
- const v = utilities.handler.bracket.cssvar.rem(s);
277
+ const handleGap = ([, d = "", s], { theme }) => {
278
+ const v = theme.spacing?.[s] ?? utilities.handler.bracket.cssvar.rem(s);
273
279
  if (v != null) {
274
280
  return {
275
281
  [`grid-${directions[d]}gap`]: v,
@@ -278,8 +284,8 @@ const handleGap = ([, d = "", s]) => {
278
284
  }
279
285
  };
280
286
  const gaps = [
281
- [/^(?:flex-|grid-)?gap-()([^-]+)$/, handleGap],
282
- [/^(?:flex-|grid-)?gap-([xy])-([^-]+)$/, handleGap]
287
+ [/^(?:flex-|grid-)?gap-?()(.+)$/, handleGap],
288
+ [/^(?:flex-|grid-)?gap-([xy])-?(.+)$/, handleGap]
283
289
  ];
284
290
 
285
291
  const rowCol = (s) => s.replace("col", "column");
@@ -401,21 +407,21 @@ const placements = [
401
407
  ["place-self-center", { "place-self": "center" }],
402
408
  ["place-self-stretch", { "place-self": "stretch" }]
403
409
  ];
404
- function handleInsetValue(v) {
405
- return utilities.handler.bracket.cssvar.auto.fraction.rem(v);
410
+ function handleInsetValue(v, { theme }) {
411
+ return theme.spacing?.[v] ?? utilities.handler.bracket.cssvar.auto.fraction.rem(v);
406
412
  }
407
- function handleInsetValues([, d, v]) {
408
- const r = handleInsetValue(v);
413
+ function handleInsetValues([, d, v], ctx) {
414
+ const r = handleInsetValue(v, ctx);
409
415
  if (r != null && d in utilities.insetMap)
410
416
  return utilities.insetMap[d].map((i) => [i.slice(1), r]);
411
417
  }
412
418
  const insets = [
413
- [/^(?:position-|pos-)?inset-(.+)$/, ([, v]) => ({ inset: handleInsetValue(v) })],
419
+ [/^(?:position-|pos-)?inset-(.+)$/, ([, v], ctx) => ({ inset: handleInsetValue(v, ctx) })],
414
420
  [/^(?:position-|pos-)?inset-([xy])-(.+)$/, handleInsetValues],
415
421
  [/^(?:position-|pos-)?inset-([rltbse])-(.+)$/, handleInsetValues],
416
422
  [/^(?:position-|pos-)?inset-(block|inline)-(.+)$/, handleInsetValues],
417
423
  [/^(?:position-|pos-)?inset-([bi][se])-(.+)$/, handleInsetValues],
418
- [/^(?:position-|pos-)?(top|left|right|bottom)-(.+)$/, ([, d, v]) => ({ [d]: handleInsetValue(v) })]
424
+ [/^(?:position-|pos-)?(top|left|right|bottom)-(.+)$/, ([, d, v], ctx) => ({ [d]: handleInsetValue(v, ctx) })]
419
425
  ];
420
426
  const floats = [
421
427
  ["float-left", { float: "left" }],
@@ -427,6 +433,7 @@ const floats = [
427
433
  ["clear-none", { clear: "none" }]
428
434
  ];
429
435
  const zIndexes = [
436
+ [/^z([\d.]+)$/, ([, v]) => ({ "z-index": utilities.handler.number(v) })],
430
437
  [/^z-(.+)$/, ([, v]) => ({ "z-index": utilities.handler.bracket.cssvar.auto.number(v) })]
431
438
  ];
432
439
  const boxSizing = [
@@ -512,8 +519,8 @@ const fontSmoothings = [
512
519
  ];
513
520
 
514
521
  const rings = [
515
- [/^ring(?:-(.+))?$/, ([, d]) => {
516
- const value = utilities.handler.px(d || "1");
522
+ [/^ring(?:-(.+))?$/, ([, d], { theme }) => {
523
+ const value = theme.ringWidth?.[d || "DEFAULT"] ?? utilities.handler.px(d || "1");
517
524
  if (value) {
518
525
  return [
519
526
  {
@@ -533,9 +540,9 @@ const rings = [
533
540
  ];
534
541
  }
535
542
  }],
536
- [/^ring-(?:width-|size-)(.+)$/, ([, d]) => ({ "--un-ring-width": utilities.handler.bracket.cssvar.px(d) })],
543
+ [/^ring-(?:width-|size-)(.+)$/, ([, d], { theme }) => ({ "--un-ring-width": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) })],
537
544
  ["ring-offset", { "--un-ring-offset-width": "1px" }],
538
- [/^ring-offset-(?:width-|size-)?(.+)$/, ([, d]) => ({ "--un-ring-offset-width": utilities.handler.bracket.cssvar.px(d) })],
545
+ [/^ring-offset-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "--un-ring-offset-width": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) })],
539
546
  [/^ring-(.+)$/, utilities.colorResolver("--un-ring-color", "ring")],
540
547
  [/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": utilities.handler.bracket.percent(opacity) })],
541
548
  [/^ring-offset-(.+)$/, utilities.colorResolver("--un-ring-offset-color", "ring-offset")],
@@ -588,7 +595,7 @@ function getSizeValue(minmax, hw, theme, prop) {
588
595
  return utilities.handler.bracket.cssvar.auto.fraction.rem(prop);
589
596
  }
590
597
  const sizes = [
591
- [/^(min-|max-)?([wh])-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
598
+ [/^(min-|max-)?([wh])-?(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
592
599
  [/^(min-|max-)?(block|inline)-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
593
600
  [/^(min-|max-)?(h)-screen-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: theme.verticalBreakpoints?.[s] })],
594
601
  [/^(min-|max-)?(w)-screen-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: theme.breakpoints?.[s] })]
@@ -706,8 +713,8 @@ const transforms = [
706
713
  ["transform-cpu", transformCpu],
707
714
  ["transform-none", { transform: "none" }]
708
715
  ];
709
- function handleTranslate([, d, b]) {
710
- const v = utilities.handler.bracket.cssvar.fraction.rem(b);
716
+ function handleTranslate([, d, b], { theme }) {
717
+ const v = theme.spacing?.[b] ?? utilities.handler.bracket.cssvar.fraction.rem(b);
711
718
  if (v != null) {
712
719
  return [
713
720
  transformBase,
@@ -809,7 +816,7 @@ ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
809
816
 
810
817
  const textDecorations = [
811
818
  [/^(?:decoration-)?(underline|overline|line-through)$/, ([, s]) => ({ "text-decoration-line": s })],
812
- [/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s]) => ({ "text-decoration-thickness": utilities.handler.bracket.cssvar.px(s) })],
819
+ [/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? utilities.handler.bracket.cssvar.px(s) })],
813
820
  [/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s })],
814
821
  [/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
815
822
  const result = utilities.colorResolver("text-decoration-color", "line")(match, ctx);
@@ -821,7 +828,7 @@ const textDecorations = [
821
828
  }
822
829
  }],
823
830
  [/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": utilities.handler.bracket.percent(opacity) })],
824
- [/^(?:underline|decoration)-offset-(.+)$/, ([, s]) => ({ "text-underline-offset": utilities.handler.auto.bracket.cssvar.px(s) })],
831
+ [/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? utilities.handler.auto.bracket.cssvar.px(s) })],
825
832
  [/^(?:underline|decoration)-(solid|double|dotted|dashed|wavy|inherit|initial|revert|unset)$/, ([, d]) => ({ "text-decoration-style": d })],
826
833
  ["no-underline", { "text-decoration": "none" }],
827
834
  ["decoration-none", { "text-decoration": "none" }]
@@ -831,9 +838,9 @@ const svgUtilities = [
831
838
  [/^fill-(.+)$/, utilities.colorResolver("fill", "fill")],
832
839
  [/^fill-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-fill-opacity": utilities.handler.bracket.percent(opacity) })],
833
840
  ["fill-none", { fill: "none" }],
834
- [/^stroke-(?:width-|size-)?(.+)$/, ([, s]) => ({ "stroke-width": utilities.handler.bracket.cssvar.fraction.px.number(s) })],
841
+ [/^stroke-(?:width-|size-)?(.+)$/, ([, s], { theme }) => ({ "stroke-width": theme.lineWidth?.[s] ?? utilities.handler.bracket.cssvar.fraction.px.number(s) })],
835
842
  [/^stroke-dash-(.+)$/, ([, s]) => ({ "stroke-dasharray": utilities.handler.bracket.cssvar.number(s) })],
836
- [/^stroke-offset-(.+)$/, ([, s]) => ({ "stroke-dashoffset": utilities.handler.bracket.cssvar.px.numberWithUnit(s) })],
843
+ [/^stroke-offset-(.+)$/, ([, s], { theme }) => ({ "stroke-dashoffset": theme.lineWidth?.[s] ?? utilities.handler.bracket.cssvar.px.numberWithUnit(s) })],
837
844
  [/^stroke-(.+)$/, utilities.colorResolver("stroke", "stroke")],
838
845
  [/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity": utilities.handler.bracket.percent(opacity) })],
839
846
  ["stroke-cap-square", { "stroke-linecap": "square" }],
@@ -17,9 +17,9 @@ const textAligns = [
17
17
  ];
18
18
 
19
19
  const outline = [
20
- [/^outline-(?:width-|size-)?(.+)$/, ([, d]) => ({ "outline-width": handler.bracket.cssvar.px(d) })],
20
+ [/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ?? handler.bracket.cssvar.px(d) })],
21
21
  [/^outline-(?:color-)?(.+)$/, colorResolver("outline-color", "outline-color")],
22
- [/^outline-offset-(.+)$/, ([, d]) => ({ "outline-offset": handler.bracket.cssvar.px(d) })],
22
+ [/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ?? handler.bracket.cssvar.px(d) })],
23
23
  ["outline", { "outline-style": "solid" }],
24
24
  [/^outline-(auto|dashed|dotted|double|hidden|solid|groove|ridge|inset|outset|inherit|initial|revert|unset)$/, ([, c]) => ({ "outline-style": c })],
25
25
  ["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }]
@@ -102,8 +102,8 @@ const borderColorResolver = (direction) => ([, body], theme) => {
102
102
  };
103
103
  }
104
104
  };
105
- function handlerBorder(m) {
106
- const borderSizes = handlerBorderSize(m);
105
+ function handlerBorder(m, ctx) {
106
+ const borderSizes = handlerBorderSize(m, ctx);
107
107
  if (borderSizes) {
108
108
  return [
109
109
  ...borderSizes,
@@ -111,8 +111,8 @@ function handlerBorder(m) {
111
111
  ];
112
112
  }
113
113
  }
114
- function handlerBorderSize([, a = "", b = "1"]) {
115
- const v = handler.bracket.cssvar.px(b);
114
+ function handlerBorderSize([, a = "", b], { theme }) {
115
+ const v = theme.lineWidth?.[b || "DEFAULT"] ?? handler.bracket.cssvar.px(b || "1");
116
116
  if (a in directionMap && v != null)
117
117
  return directionMap[a].map((i) => [`border${i}-width`, v]);
118
118
  }
@@ -126,8 +126,8 @@ function handlerBorderOpacity([, a = "", opacity]) {
126
126
  if (a in directionMap && v != null)
127
127
  return directionMap[a].map((i) => [`--un-border${i}-opacity`, v]);
128
128
  }
129
- function handlerRounded([, a = "", s = "DEFAULT"], { theme }) {
130
- const v = theme.borderRadius?.[s] || handler.bracket.cssvar.fraction.rem(s);
129
+ function handlerRounded([, a = "", s], { theme }) {
130
+ const v = theme.borderRadius?.[s || "DEFAULT"] || handler.bracket.cssvar.fraction.rem(s || "1");
131
131
  if (a in cornerMap && v != null)
132
132
  return cornerMap[a].map((i) => [`border${i}-radius`, v]);
133
133
  }
@@ -156,18 +156,19 @@ const transitionProperty = (prop) => {
156
156
  return handler.properties(prop) ?? transitionPropertyGroup[prop];
157
157
  };
158
158
  const transitions = [
159
- [/^transition(?:-([a-z-]+(?:,[a-z-]+)*))?(?:-(\d+))?$/, ([, prop, duration = "150"]) => {
159
+ [/^transition(?:-([a-z-]+(?:,[a-z-]+)*))?(?:-(\d+))?$/, ([, prop, d], { theme }) => {
160
160
  const p = prop != null ? transitionProperty(prop) : [transitionPropertyGroup.colors, "opacity", "box-shadow", "transform", "filter", "backdrop-filter"].join(",");
161
161
  if (p) {
162
+ const duration = theme.duration?.[d || "DEFAULT"] ?? handler.time(d || "150");
162
163
  return {
163
164
  "transition-property": p,
164
165
  "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)",
165
- "transition-duration": `${duration}ms`
166
+ "transition-duration": duration
166
167
  };
167
168
  }
168
169
  }],
169
- [/^(?:transition-)?duration-(.+)$/, ([, d]) => ({ "transition-duration": handler.bracket.cssvar.time(d) })],
170
- [/^(?:transition-)?delay-(.+)$/, ([, d]) => ({ "transition-delay": handler.bracket.cssvar.time(d) })],
170
+ [/^(?:transition-)?duration-(.+)$/, ([, d], { theme }) => ({ "transition-duration": theme.duration?.[d || "DEFAULT"] ?? handler.bracket.cssvar.time(d) })],
171
+ [/^(?:transition-)?delay-(.+)$/, ([, d], { theme }) => ({ "transition-delay": theme.duration?.[d || "DEFAULT"] ?? handler.bracket.cssvar.time(d) })],
171
172
  [/^(?:transition-)?ease(?:-(.+))?$/, ([, d], { theme }) => ({ "transition-timing-function": theme.easing?.[d || "DEFAULT"] ?? handler.bracket.cssvar(d) })],
172
173
  [/^(?:transition-)?property-(.+)$/, ([, v]) => ({ "transition-property": handler.global(v) || transitionProperty(v) })],
173
174
  ["transition-none", { transition: "none" }]
@@ -186,7 +187,7 @@ const flex = [
186
187
  [/^(?:flex-)?shrink-0$/, () => ({ "flex-shrink": 0 })],
187
188
  [/^(?:flex-)?grow$/, () => ({ "flex-grow": 1 })],
188
189
  [/^(?:flex-)?grow-0$/, () => ({ "flex-grow": 0 })],
189
- [/^(?:flex-)?basis-(.+)$/, ([, d]) => ({ "flex-basis": handler.bracket.cssvar.auto.fraction.rem(d) })],
190
+ [/^(?:flex-)?basis-(.+)$/, ([, d], { theme }) => ({ "flex-basis": theme.spacing?.[d] ?? handler.bracket.cssvar.auto.fraction.rem(d) })],
190
191
  ["flex-row", { "flex-direction": "row" }],
191
192
  ["flex-row-reverse", { "flex-direction": "row-reverse" }],
192
193
  ["flex-col", { "flex-direction": "column" }],
@@ -220,7 +221,12 @@ const fonts = [
220
221
  }
221
222
  return { "font-size": handler.bracketOfLength.rem(s) };
222
223
  }],
223
- [/^text-size-(.+)$/, ([, s]) => ({ "font-size": handler.bracket.cssvar.rem(s) })],
224
+ [/^text-size-(.+)$/, ([, s], { theme }) => {
225
+ const themed = toArray(theme.fontSize?.[s]);
226
+ const size = themed?.[0] ?? handler.bracket.cssvar.rem(s);
227
+ if (size != null)
228
+ return { "font-size": size };
229
+ }],
224
230
  [/^(?:font|fw)-?([^-]+)$/, ([, s]) => ({ "font-weight": weightMap[s] || handler.number(s) })],
225
231
  [/^(?:leading|lh)-(.+)$/, ([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] || handler.bracket.cssvar.rem(s) })],
226
232
  [/^tracking-(.+)$/, ([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || handler.bracket.cssvar.rem(s) })],
@@ -266,8 +272,8 @@ const directions = {
266
272
  "x": "column-",
267
273
  "y": "row-"
268
274
  };
269
- const handleGap = ([, d = "", s]) => {
270
- const v = handler.bracket.cssvar.rem(s);
275
+ const handleGap = ([, d = "", s], { theme }) => {
276
+ const v = theme.spacing?.[s] ?? handler.bracket.cssvar.rem(s);
271
277
  if (v != null) {
272
278
  return {
273
279
  [`grid-${directions[d]}gap`]: v,
@@ -276,8 +282,8 @@ const handleGap = ([, d = "", s]) => {
276
282
  }
277
283
  };
278
284
  const gaps = [
279
- [/^(?:flex-|grid-)?gap-()([^-]+)$/, handleGap],
280
- [/^(?:flex-|grid-)?gap-([xy])-([^-]+)$/, handleGap]
285
+ [/^(?:flex-|grid-)?gap-?()(.+)$/, handleGap],
286
+ [/^(?:flex-|grid-)?gap-([xy])-?(.+)$/, handleGap]
281
287
  ];
282
288
 
283
289
  const rowCol = (s) => s.replace("col", "column");
@@ -399,21 +405,21 @@ const placements = [
399
405
  ["place-self-center", { "place-self": "center" }],
400
406
  ["place-self-stretch", { "place-self": "stretch" }]
401
407
  ];
402
- function handleInsetValue(v) {
403
- return handler.bracket.cssvar.auto.fraction.rem(v);
408
+ function handleInsetValue(v, { theme }) {
409
+ return theme.spacing?.[v] ?? handler.bracket.cssvar.auto.fraction.rem(v);
404
410
  }
405
- function handleInsetValues([, d, v]) {
406
- const r = handleInsetValue(v);
411
+ function handleInsetValues([, d, v], ctx) {
412
+ const r = handleInsetValue(v, ctx);
407
413
  if (r != null && d in insetMap)
408
414
  return insetMap[d].map((i) => [i.slice(1), r]);
409
415
  }
410
416
  const insets = [
411
- [/^(?:position-|pos-)?inset-(.+)$/, ([, v]) => ({ inset: handleInsetValue(v) })],
417
+ [/^(?:position-|pos-)?inset-(.+)$/, ([, v], ctx) => ({ inset: handleInsetValue(v, ctx) })],
412
418
  [/^(?:position-|pos-)?inset-([xy])-(.+)$/, handleInsetValues],
413
419
  [/^(?:position-|pos-)?inset-([rltbse])-(.+)$/, handleInsetValues],
414
420
  [/^(?:position-|pos-)?inset-(block|inline)-(.+)$/, handleInsetValues],
415
421
  [/^(?:position-|pos-)?inset-([bi][se])-(.+)$/, handleInsetValues],
416
- [/^(?:position-|pos-)?(top|left|right|bottom)-(.+)$/, ([, d, v]) => ({ [d]: handleInsetValue(v) })]
422
+ [/^(?:position-|pos-)?(top|left|right|bottom)-(.+)$/, ([, d, v], ctx) => ({ [d]: handleInsetValue(v, ctx) })]
417
423
  ];
418
424
  const floats = [
419
425
  ["float-left", { float: "left" }],
@@ -425,6 +431,7 @@ const floats = [
425
431
  ["clear-none", { clear: "none" }]
426
432
  ];
427
433
  const zIndexes = [
434
+ [/^z([\d.]+)$/, ([, v]) => ({ "z-index": handler.number(v) })],
428
435
  [/^z-(.+)$/, ([, v]) => ({ "z-index": handler.bracket.cssvar.auto.number(v) })]
429
436
  ];
430
437
  const boxSizing = [
@@ -510,8 +517,8 @@ const fontSmoothings = [
510
517
  ];
511
518
 
512
519
  const rings = [
513
- [/^ring(?:-(.+))?$/, ([, d]) => {
514
- const value = handler.px(d || "1");
520
+ [/^ring(?:-(.+))?$/, ([, d], { theme }) => {
521
+ const value = theme.ringWidth?.[d || "DEFAULT"] ?? handler.px(d || "1");
515
522
  if (value) {
516
523
  return [
517
524
  {
@@ -531,9 +538,9 @@ const rings = [
531
538
  ];
532
539
  }
533
540
  }],
534
- [/^ring-(?:width-|size-)(.+)$/, ([, d]) => ({ "--un-ring-width": handler.bracket.cssvar.px(d) })],
541
+ [/^ring-(?:width-|size-)(.+)$/, ([, d], { theme }) => ({ "--un-ring-width": theme.lineWidth?.[d] ?? handler.bracket.cssvar.px(d) })],
535
542
  ["ring-offset", { "--un-ring-offset-width": "1px" }],
536
- [/^ring-offset-(?:width-|size-)?(.+)$/, ([, d]) => ({ "--un-ring-offset-width": handler.bracket.cssvar.px(d) })],
543
+ [/^ring-offset-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "--un-ring-offset-width": theme.lineWidth?.[d] ?? handler.bracket.cssvar.px(d) })],
537
544
  [/^ring-(.+)$/, colorResolver("--un-ring-color", "ring")],
538
545
  [/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": handler.bracket.percent(opacity) })],
539
546
  [/^ring-offset-(.+)$/, colorResolver("--un-ring-offset-color", "ring-offset")],
@@ -586,7 +593,7 @@ function getSizeValue(minmax, hw, theme, prop) {
586
593
  return handler.bracket.cssvar.auto.fraction.rem(prop);
587
594
  }
588
595
  const sizes = [
589
- [/^(min-|max-)?([wh])-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
596
+ [/^(min-|max-)?([wh])-?(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
590
597
  [/^(min-|max-)?(block|inline)-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
591
598
  [/^(min-|max-)?(h)-screen-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: theme.verticalBreakpoints?.[s] })],
592
599
  [/^(min-|max-)?(w)-screen-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: theme.breakpoints?.[s] })]
@@ -704,8 +711,8 @@ const transforms = [
704
711
  ["transform-cpu", transformCpu],
705
712
  ["transform-none", { transform: "none" }]
706
713
  ];
707
- function handleTranslate([, d, b]) {
708
- const v = handler.bracket.cssvar.fraction.rem(b);
714
+ function handleTranslate([, d, b], { theme }) {
715
+ const v = theme.spacing?.[b] ?? handler.bracket.cssvar.fraction.rem(b);
709
716
  if (v != null) {
710
717
  return [
711
718
  transformBase,
@@ -807,7 +814,7 @@ ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
807
814
 
808
815
  const textDecorations = [
809
816
  [/^(?:decoration-)?(underline|overline|line-through)$/, ([, s]) => ({ "text-decoration-line": s })],
810
- [/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s]) => ({ "text-decoration-thickness": handler.bracket.cssvar.px(s) })],
817
+ [/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? handler.bracket.cssvar.px(s) })],
811
818
  [/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s })],
812
819
  [/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
813
820
  const result = colorResolver("text-decoration-color", "line")(match, ctx);
@@ -819,7 +826,7 @@ const textDecorations = [
819
826
  }
820
827
  }],
821
828
  [/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": handler.bracket.percent(opacity) })],
822
- [/^(?:underline|decoration)-offset-(.+)$/, ([, s]) => ({ "text-underline-offset": handler.auto.bracket.cssvar.px(s) })],
829
+ [/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? handler.auto.bracket.cssvar.px(s) })],
823
830
  [/^(?:underline|decoration)-(solid|double|dotted|dashed|wavy|inherit|initial|revert|unset)$/, ([, d]) => ({ "text-decoration-style": d })],
824
831
  ["no-underline", { "text-decoration": "none" }],
825
832
  ["decoration-none", { "text-decoration": "none" }]
@@ -829,9 +836,9 @@ const svgUtilities = [
829
836
  [/^fill-(.+)$/, colorResolver("fill", "fill")],
830
837
  [/^fill-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-fill-opacity": handler.bracket.percent(opacity) })],
831
838
  ["fill-none", { fill: "none" }],
832
- [/^stroke-(?:width-|size-)?(.+)$/, ([, s]) => ({ "stroke-width": handler.bracket.cssvar.fraction.px.number(s) })],
839
+ [/^stroke-(?:width-|size-)?(.+)$/, ([, s], { theme }) => ({ "stroke-width": theme.lineWidth?.[s] ?? handler.bracket.cssvar.fraction.px.number(s) })],
833
840
  [/^stroke-dash-(.+)$/, ([, s]) => ({ "stroke-dasharray": handler.bracket.cssvar.number(s) })],
834
- [/^stroke-offset-(.+)$/, ([, s]) => ({ "stroke-dashoffset": handler.bracket.cssvar.px.numberWithUnit(s) })],
841
+ [/^stroke-offset-(.+)$/, ([, s], { theme }) => ({ "stroke-dashoffset": theme.lineWidth?.[s] ?? handler.bracket.cssvar.px.numberWithUnit(s) })],
835
842
  [/^stroke-(.+)$/, colorResolver("stroke", "stroke")],
836
843
  [/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity": handler.bracket.percent(opacity) })],
837
844
  ["stroke-cap-square", { "stroke-linecap": "square" }],
@@ -14,7 +14,7 @@ function hex2rgba(hex = "") {
14
14
  }
15
15
  function parseCssColor(str = "") {
16
16
  const color = parseColor$1(str);
17
- if (color == null)
17
+ if (color == null || color === false)
18
18
  return;
19
19
  const { type: casedType, components, alpha } = color;
20
20
  const type = casedType.toLowerCase();
@@ -22,7 +22,7 @@ function parseCssColor(str = "") {
22
22
  return;
23
23
  if (["rgba", "hsla"].includes(type) && alpha == null)
24
24
  return;
25
- if (cssColorFunctions.includes(type) && components.length !== 3)
25
+ if (cssColorFunctions.includes(type) && ![1, 3].includes(components.length))
26
26
  return;
27
27
  return { type, components, alpha };
28
28
  }
@@ -98,12 +98,16 @@ function parseCssCommaColorFunction(color) {
98
98
  return;
99
99
  const [, type, componentString] = match;
100
100
  const components = getComponents(componentString, ",", 5);
101
- if (components && [3, 4].includes(components.length)) {
102
- return {
103
- type,
104
- components: components.slice(0, 3),
105
- alpha: components[3]
106
- };
101
+ if (components) {
102
+ if ([3, 4].includes(components.length)) {
103
+ return {
104
+ type,
105
+ components: components.slice(0, 3),
106
+ alpha: components[3]
107
+ };
108
+ } else if (components.length !== 1) {
109
+ return false;
110
+ }
107
111
  }
108
112
  }
109
113
  const cssColorFunctionsRe = new RegExp(`^(${cssColorFunctions.join("|")})\\((.+)\\)$`, "i");
@@ -500,8 +504,8 @@ const valueHandlers = {
500
504
  const handler = core.createValueHandler(valueHandlers);
501
505
  const h = handler;
502
506
 
503
- const directionSize = (propertyPrefix) => ([_, direction, size]) => {
504
- const v = handler.bracket.cssvar.auto.fraction.rem(size);
507
+ const directionSize = (propertyPrefix) => ([_, direction, size], { theme }) => {
508
+ const v = theme.spacing?.[size || "DEFAULT"] ?? handler.bracket.cssvar.auto.fraction.rem(size);
505
509
  if (v != null)
506
510
  return directionMap[direction].map((i) => [`${propertyPrefix}${i}`, v]);
507
511
  };
@@ -12,7 +12,7 @@ function hex2rgba(hex = "") {
12
12
  }
13
13
  function parseCssColor(str = "") {
14
14
  const color = parseColor$1(str);
15
- if (color == null)
15
+ if (color == null || color === false)
16
16
  return;
17
17
  const { type: casedType, components, alpha } = color;
18
18
  const type = casedType.toLowerCase();
@@ -20,7 +20,7 @@ function parseCssColor(str = "") {
20
20
  return;
21
21
  if (["rgba", "hsla"].includes(type) && alpha == null)
22
22
  return;
23
- if (cssColorFunctions.includes(type) && components.length !== 3)
23
+ if (cssColorFunctions.includes(type) && ![1, 3].includes(components.length))
24
24
  return;
25
25
  return { type, components, alpha };
26
26
  }
@@ -96,12 +96,16 @@ function parseCssCommaColorFunction(color) {
96
96
  return;
97
97
  const [, type, componentString] = match;
98
98
  const components = getComponents(componentString, ",", 5);
99
- if (components && [3, 4].includes(components.length)) {
100
- return {
101
- type,
102
- components: components.slice(0, 3),
103
- alpha: components[3]
104
- };
99
+ if (components) {
100
+ if ([3, 4].includes(components.length)) {
101
+ return {
102
+ type,
103
+ components: components.slice(0, 3),
104
+ alpha: components[3]
105
+ };
106
+ } else if (components.length !== 1) {
107
+ return false;
108
+ }
105
109
  }
106
110
  }
107
111
  const cssColorFunctionsRe = new RegExp(`^(${cssColorFunctions.join("|")})\\((.+)\\)$`, "i");
@@ -498,8 +502,8 @@ const valueHandlers = {
498
502
  const handler = createValueHandler(valueHandlers);
499
503
  const h = handler;
500
504
 
501
- const directionSize = (propertyPrefix) => ([_, direction, size]) => {
502
- const v = handler.bracket.cssvar.auto.fraction.rem(size);
505
+ const directionSize = (propertyPrefix) => ([_, direction, size], { theme }) => {
506
+ const v = theme.spacing?.[size || "DEFAULT"] ?? handler.bracket.cssvar.auto.fraction.rem(size);
503
507
  if (v != null)
504
508
  return directionMap[direction].map((i) => [`${propertyPrefix}${i}`, v]);
505
509
  };
@@ -1,4 +1,4 @@
1
- import { T as Theme } from './types-20b16474';
1
+ import { T as Theme } from './types-f7b2c653';
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-e269d6e0';
2
- import './types-20b16474';
1
+ export { c as colors } from './colors-ce2fecb8';
2
+ import './types-f7b2c653';
@@ -1,4 +1,4 @@
1
- import { T as Theme } from './types-20b16474';
1
+ import { T as Theme } from './types-f7b2c653';
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-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';
2
+ import { T as Theme } from './types-f7b2c653';
3
+ export { T as Theme, a as ThemeAnimation } from './types-f7b2c653';
4
+ export { t as theme } from './default-e6d1b2e8';
5
+ export { c as colors } from './colors-ce2fecb8';
6
+ export { p as parseColor } from './utilities-820bcff8';
7
7
 
8
8
  interface PresetMiniOptions extends PresetOptions {
9
9
  /**
package/dist/rules.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { Rule } from '@unocss/core';
2
- import { T as Theme } from './types-20b16474';
2
+ import { T as Theme } from './types-f7b2c653';
3
3
 
4
4
  declare const verticalAligns: Rule[];
5
5
  declare const textAligns: Rule[];
6
6
 
7
- declare const outline: Rule[];
7
+ declare const outline: Rule<Theme>[];
8
8
  declare const appearance: Rule[];
9
9
  declare const willChange: Rule[];
10
10
 
@@ -22,7 +22,7 @@ declare const bgColors: Rule[];
22
22
 
23
23
  declare const rules: Rule[];
24
24
 
25
- declare const flex: Rule[];
25
+ declare const flex: Rule<Theme>[];
26
26
 
27
27
  declare const gaps: Rule[];
28
28
 
@@ -72,7 +72,7 @@ declare const textTransforms: Rule[];
72
72
  declare const fontStyles: Rule[];
73
73
  declare const fontSmoothings: Rule[];
74
74
 
75
- declare const svgUtilities: Rule[];
75
+ declare const svgUtilities: Rule<Theme>[];
76
76
 
77
77
  declare const transforms: Rule[];
78
78
 
@@ -87,6 +87,6 @@ declare const textShadows: Rule<Theme>[];
87
87
  declare const cssVariables: Rule[];
88
88
  declare const cssProperty: Rule[];
89
89
 
90
- declare const textDecorations: Rule[];
90
+ declare const textDecorations: Rule<Theme>[];
91
91
 
92
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/theme.cjs CHANGED
@@ -14,20 +14,18 @@ exports.borderRadius = _default.borderRadius;
14
14
  exports.boxShadow = _default.boxShadow;
15
15
  exports.breakpoints = _default.breakpoints;
16
16
  exports.dropShadow = _default.dropShadow;
17
+ exports.duration = _default.duration;
17
18
  exports.easing = _default.easing;
18
19
  exports.fontFamily = _default.fontFamily;
19
20
  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;
26
21
  exports.height = _default.height;
27
22
  exports.letterSpacing = _default.letterSpacing;
28
23
  exports.lineHeight = _default.lineHeight;
24
+ exports.lineWidth = _default.lineWidth;
29
25
  exports.maxHeight = _default.maxHeight;
30
26
  exports.maxWidth = _default.maxWidth;
27
+ exports.ringWidth = _default.ringWidth;
28
+ exports.spacing = _default.spacing;
31
29
  exports.textIndent = _default.textIndent;
32
30
  exports.textShadow = _default.textShadow;
33
31
  exports.textStrokeWidth = _default.textStrokeWidth;
package/dist/theme.d.ts CHANGED
@@ -1,7 +1,7 @@
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';
1
+ export { c as colors } from './colors-ce2fecb8';
2
+ export { t as theme } from './default-e6d1b2e8';
3
+ import { T as Theme } from './types-f7b2c653';
4
+ export { T as Theme, a as ThemeAnimation } from './types-f7b2c653';
5
5
 
6
6
  declare const blur: {
7
7
  DEFAULT: string;
@@ -36,25 +36,29 @@ 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;
39
+ declare const breakpoints: {
41
40
  sm: string;
42
- base: string;
41
+ md: string;
43
42
  lg: string;
44
43
  xl: string;
45
44
  '2xl': string;
46
- '3xl': string;
47
- '4xl': string;
48
- '5xl': string;
49
- '6xl': string;
50
- '7xl': string;
51
- '8xl': string;
52
- '9xl': string;
53
45
  };
54
- declare const gridAutoRow: {
46
+ declare const verticalBreakpoints: {
47
+ sm: string;
48
+ md: string;
49
+ lg: string;
50
+ xl: string;
51
+ '2xl': string;
52
+ };
53
+ declare const lineWidth: {
54
+ DEFAULT: string;
55
+ none: string;
56
+ };
57
+ declare const spacing: {
58
+ DEFAULT: string;
59
+ none: string;
55
60
  xs: string;
56
61
  sm: string;
57
- base: string;
58
62
  lg: string;
59
63
  xl: string;
60
64
  '2xl': string;
@@ -66,29 +70,10 @@ declare const gridAutoRow: {
66
70
  '8xl': string;
67
71
  '9xl': string;
68
72
  };
69
- declare const gridColumn: {};
70
- declare const gridRow: {};
71
- declare const gridTemplateColumn: {
72
- none: string;
73
- };
74
- declare const gridTemplateRow: {
73
+ declare const duration: {
74
+ DEFAULT: string;
75
75
  none: string;
76
76
  };
77
-
78
- declare const breakpoints: {
79
- sm: string;
80
- md: string;
81
- lg: string;
82
- xl: string;
83
- '2xl': string;
84
- };
85
- declare const verticalBreakpoints: {
86
- sm: string;
87
- md: string;
88
- lg: string;
89
- xl: string;
90
- '2xl': string;
91
- };
92
77
  declare const borderRadius: {
93
78
  DEFAULT: string;
94
79
  none: string;
@@ -102,13 +87,13 @@ declare const borderRadius: {
102
87
  };
103
88
  declare const boxShadow: {
104
89
  DEFAULT: string[];
90
+ none: string;
105
91
  sm: string;
106
92
  md: string[];
107
93
  lg: string[];
108
94
  xl: string[];
109
95
  '2xl': string;
110
96
  inner: string;
111
- none: string;
112
97
  };
113
98
  declare const easing: {
114
99
  DEFAULT: string;
@@ -117,6 +102,10 @@ declare const easing: {
117
102
  out: string;
118
103
  'in-out': string;
119
104
  };
105
+ declare const ringWidth: {
106
+ DEFAULT: string;
107
+ none: string;
108
+ };
120
109
 
121
110
  declare const baseSize: {
122
111
  xs: string;
@@ -197,4 +186,4 @@ declare const maxHeight: {
197
186
  none: string;
198
187
  };
199
188
 
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 };
189
+ export { baseSize, blur, borderRadius, boxShadow, breakpoints, dropShadow, duration, easing, fontFamily, fontSize, height, letterSpacing, lineHeight, lineWidth, maxHeight, maxWidth, ringWidth, spacing, 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 { 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';
2
+ export { p as baseSize, b as blur, m as borderRadius, n as boxShadow, i as breakpoints, d as dropShadow, k as duration, o as easing, f as fontFamily, a as fontSize, x as height, h as letterSpacing, l as lineHeight, j as lineWidth, y as maxHeight, u as maxWidth, r as ringWidth, s as spacing, c as textIndent, g as textShadow, e as textStrokeWidth, t as theme, v as verticalBreakpoints, q as width, w as wordSpacing } from './chunks/default.mjs';
@@ -30,6 +30,10 @@ interface Theme {
30
30
  textIndent?: Record<string, string>;
31
31
  textShadow?: Record<string, string | string[]>;
32
32
  textStrokeWidth?: Record<string, string>;
33
+ ringWidth?: Record<string, string>;
34
+ lineWidth?: Record<string, string>;
35
+ spacing?: Record<string, string>;
36
+ duration?: Record<string, string>;
33
37
  blur?: Record<string, string>;
34
38
  dropShadow?: Record<string, string | string[]>;
35
39
  easing?: Record<string, string>;
@@ -1,5 +1,5 @@
1
- import { CSSEntries, ParsedColorValue, RuleContext, CSSObject } from '@unocss/core';
2
- import { T as Theme } from './types-20b16474';
1
+ import { RuleContext, CSSEntries, ParsedColorValue, CSSObject } from '@unocss/core';
2
+ import { T as Theme } from './types-f7b2c653';
3
3
 
4
4
  /**
5
5
  * Provide {@link DynamicMatcher} function returning spacing definition. See spacing rules.
@@ -8,7 +8,7 @@ import { T as Theme } from './types-20b16474';
8
8
  * @return {@link DynamicMatcher} object.
9
9
  * @see {@link directionMap}
10
10
  */
11
- declare const directionSize: (propertyPrefix: string) => ([_, direction, size]: string[]) => CSSEntries | undefined;
11
+ declare const directionSize: (propertyPrefix: string) => ([_, direction, size]: string[], { theme }: RuleContext<Theme>) => CSSEntries | undefined;
12
12
  /**
13
13
  * Parse color string into {@link ParsedColorValue} (if possible). Color value will first be matched to theme object before parsing.
14
14
  * See also color.tests.ts for more examples.
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, h as hasParseableColor, p as parseColor } from './utilities-9f0998a3';
4
- import './types-20b16474';
3
+ export { c as colorResolver, a as colorableShadows, d as directionSize, h as hasParseableColor, p as parseColor } from './utilities-820bcff8';
4
+ import './types-f7b2c653';
5
5
 
6
6
  declare function hex2rgba(hex?: string): RGBAColorValue | undefined;
7
7
  declare function parseCssColor(str?: string): CSSColorValue | undefined;
@@ -1,9 +1,9 @@
1
1
  import { Variant, VariantFunction, VariantObject } from '@unocss/core';
2
- import { T as Theme } from './types-20b16474';
2
+ import { T as Theme } from './types-f7b2c653';
3
3
  import { PresetMiniOptions } from './index';
4
- import './default-c3837f44';
5
- import './colors-e269d6e0';
6
- import './utilities-9f0998a3';
4
+ import './default-e6d1b2e8';
5
+ import './colors-ce2fecb8';
6
+ import './utilities-820bcff8';
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.26.1",
3
+ "version": "0.26.4",
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.26.1"
64
+ "@unocss/core": "0.26.4"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "unbuild",