@unocss/preset-mini 0.18.1 → 0.20.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/default.cjs +6 -6
- package/dist/chunks/default.mjs +6 -6
- package/dist/chunks/default2.cjs +43 -115
- package/dist/chunks/default2.mjs +53 -125
- package/dist/chunks/default3.cjs +46 -26
- package/dist/chunks/default3.mjs +43 -26
- package/dist/chunks/pseudo.cjs +23 -20
- package/dist/chunks/pseudo.mjs +23 -20
- package/dist/chunks/utilities.cjs +20 -9
- package/dist/chunks/utilities.mjs +20 -9
- package/dist/chunks/variants.cjs +17 -2
- package/dist/chunks/variants.mjs +17 -3
- package/dist/index.cjs +21 -7
- package/dist/index.d.ts +6 -2
- package/dist/index.mjs +21 -7
- package/dist/utils.cjs +1 -0
- package/dist/utils.d.ts +2 -1
- package/dist/utils.mjs +1 -1
- package/dist/variants.cjs +5 -2
- package/dist/variants.d.ts +13 -8
- package/dist/variants.mjs +1 -1
- package/package.json +2 -2
package/dist/chunks/default.cjs
CHANGED
|
@@ -115,12 +115,12 @@ const borderRadius = {
|
|
|
115
115
|
"full": "9999px"
|
|
116
116
|
};
|
|
117
117
|
const boxShadow = {
|
|
118
|
-
"DEFAULT": "0 1px 3px 0 rgba(var(--un-shadow-color), 0.1), 0 1px 2px 0 rgba(var(--un-shadow-color), 0.06)",
|
|
119
|
-
"sm": "0 1px 2px 0 rgba(var(--un-shadow-color), 0.05)",
|
|
120
|
-
"md": "0 4px 6px -1px rgba(var(--un-shadow-color), 0.1), 0 2px 4px -1px rgba(var(--un-shadow-color), 0.06)",
|
|
121
|
-
"lg": "0 10px 15px -3px rgba(var(--un-shadow-color), 0.1), 0 4px 6px -2px rgba(var(--un-shadow-color), 0.05)",
|
|
122
|
-
"xl": "0 20px 25px -5px rgba(var(--un-shadow-color), 0.1), 0 10px 10px -5px rgba(var(--un-shadow-color), 0.04)",
|
|
123
|
-
"2xl": "25px 50px -12px rgba(var(--un-shadow-color), 0.25)",
|
|
118
|
+
"DEFAULT": "var(--un-shadow-inset) 0 1px 3px 0 rgba(var(--un-shadow-color), 0.1), var(--un-shadow-inset) 0 1px 2px 0 rgba(var(--un-shadow-color), 0.06)",
|
|
119
|
+
"sm": "var(--un-shadow-inset) 0 1px 2px 0 rgba(var(--un-shadow-color), 0.05)",
|
|
120
|
+
"md": "var(--un-shadow-inset) 0 4px 6px -1px rgba(var(--un-shadow-color), 0.1), var(--un-shadow-inset) 0 2px 4px -1px rgba(var(--un-shadow-color), 0.06)",
|
|
121
|
+
"lg": "var(--un-shadow-inset) 0 10px 15px -3px rgba(var(--un-shadow-color), 0.1), var(--un-shadow-inset) 0 4px 6px -2px rgba(var(--un-shadow-color), 0.05)",
|
|
122
|
+
"xl": "var(--un-shadow-inset) 0 20px 25px -5px rgba(var(--un-shadow-color), 0.1), var(--un-shadow-inset) 0 10px 10px -5px rgba(var(--un-shadow-color), 0.04)",
|
|
123
|
+
"2xl": "var(--un-shadow-inset) 0 25px 50px -12px rgba(var(--un-shadow-color), 0.25)",
|
|
124
124
|
"inner": "inset 0 2px 4px 0 rgba(var(--un-shadow-color), 0.06)",
|
|
125
125
|
"none": "none"
|
|
126
126
|
};
|
package/dist/chunks/default.mjs
CHANGED
|
@@ -113,12 +113,12 @@ const borderRadius = {
|
|
|
113
113
|
"full": "9999px"
|
|
114
114
|
};
|
|
115
115
|
const boxShadow = {
|
|
116
|
-
"DEFAULT": "0 1px 3px 0 rgba(var(--un-shadow-color), 0.1), 0 1px 2px 0 rgba(var(--un-shadow-color), 0.06)",
|
|
117
|
-
"sm": "0 1px 2px 0 rgba(var(--un-shadow-color), 0.05)",
|
|
118
|
-
"md": "0 4px 6px -1px rgba(var(--un-shadow-color), 0.1), 0 2px 4px -1px rgba(var(--un-shadow-color), 0.06)",
|
|
119
|
-
"lg": "0 10px 15px -3px rgba(var(--un-shadow-color), 0.1), 0 4px 6px -2px rgba(var(--un-shadow-color), 0.05)",
|
|
120
|
-
"xl": "0 20px 25px -5px rgba(var(--un-shadow-color), 0.1), 0 10px 10px -5px rgba(var(--un-shadow-color), 0.04)",
|
|
121
|
-
"2xl": "25px 50px -12px rgba(var(--un-shadow-color), 0.25)",
|
|
116
|
+
"DEFAULT": "var(--un-shadow-inset) 0 1px 3px 0 rgba(var(--un-shadow-color), 0.1), var(--un-shadow-inset) 0 1px 2px 0 rgba(var(--un-shadow-color), 0.06)",
|
|
117
|
+
"sm": "var(--un-shadow-inset) 0 1px 2px 0 rgba(var(--un-shadow-color), 0.05)",
|
|
118
|
+
"md": "var(--un-shadow-inset) 0 4px 6px -1px rgba(var(--un-shadow-color), 0.1), var(--un-shadow-inset) 0 2px 4px -1px rgba(var(--un-shadow-color), 0.06)",
|
|
119
|
+
"lg": "var(--un-shadow-inset) 0 10px 15px -3px rgba(var(--un-shadow-color), 0.1), var(--un-shadow-inset) 0 4px 6px -2px rgba(var(--un-shadow-color), 0.05)",
|
|
120
|
+
"xl": "var(--un-shadow-inset) 0 20px 25px -5px rgba(var(--un-shadow-color), 0.1), var(--un-shadow-inset) 0 10px 10px -5px rgba(var(--un-shadow-color), 0.04)",
|
|
121
|
+
"2xl": "var(--un-shadow-inset) 0 25px 50px -12px rgba(var(--un-shadow-color), 0.25)",
|
|
122
122
|
"inner": "inset 0 2px 4px 0 rgba(var(--un-shadow-color), 0.06)",
|
|
123
123
|
"none": "none"
|
|
124
124
|
};
|
package/dist/chunks/default2.cjs
CHANGED
|
@@ -68,33 +68,31 @@ const borderColorResolver = (direction) => ([, body], { theme }) => {
|
|
|
68
68
|
const data = utilities.parseColor(body, theme);
|
|
69
69
|
if (!data)
|
|
70
70
|
return;
|
|
71
|
-
const { opacity, color, rgba } = data;
|
|
71
|
+
const { alpha, opacity, color, rgba } = data;
|
|
72
72
|
if (!color)
|
|
73
73
|
return;
|
|
74
|
-
const a = opacity ? opacity[0] === "[" ? utilities.handler.bracket.percent(opacity) : parseFloat(opacity) / 100 : rgba?.[3];
|
|
75
74
|
if (rgba) {
|
|
76
|
-
if (
|
|
77
|
-
rgba[3] = typeof a === "string" && !a.includes("%") ? parseFloat(a) : a;
|
|
75
|
+
if (alpha != null) {
|
|
78
76
|
return {
|
|
79
77
|
[`border${direction}-color`]: `rgba(${rgba.join(",")})`
|
|
80
78
|
};
|
|
81
79
|
} else {
|
|
82
80
|
if (direction === "") {
|
|
83
81
|
return {
|
|
84
|
-
"--un-border-opacity": 1,
|
|
85
|
-
[`border${direction}-color`]: `rgba(${rgba.
|
|
82
|
+
"--un-border-opacity": (opacity && utilities.handler.cssvar(opacity)) ?? 1,
|
|
83
|
+
[`border${direction}-color`]: `rgba(${rgba.join(",")},var(--un-border${direction}-opacity))`
|
|
86
84
|
};
|
|
87
85
|
} else {
|
|
88
86
|
return {
|
|
89
|
-
"--un-border-opacity": 1,
|
|
87
|
+
"--un-border-opacity": (opacity && utilities.handler.cssvar(opacity)) ?? 1,
|
|
90
88
|
[`--un-border${direction}-opacity`]: "var(--un-border-opacity)",
|
|
91
|
-
[`border${direction}-color`]: `rgba(${rgba.
|
|
89
|
+
[`border${direction}-color`]: `rgba(${rgba.join(",")},var(--un-border${direction}-opacity))`
|
|
92
90
|
};
|
|
93
91
|
}
|
|
94
92
|
}
|
|
95
93
|
} else {
|
|
96
94
|
return {
|
|
97
|
-
[`border${direction}-color`]: color.replace("%alpha", `${
|
|
95
|
+
[`border${direction}-color`]: color.replace("%alpha", `${alpha || 1}`)
|
|
98
96
|
};
|
|
99
97
|
}
|
|
100
98
|
};
|
|
@@ -199,14 +197,7 @@ const weightMap = {
|
|
|
199
197
|
black: "900"
|
|
200
198
|
};
|
|
201
199
|
const fonts = [
|
|
202
|
-
[/^font-(\w+)$/, ([, d], { theme }) => {
|
|
203
|
-
const font = theme.fontFamily?.[d];
|
|
204
|
-
if (font) {
|
|
205
|
-
return {
|
|
206
|
-
"font-family": font
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
}],
|
|
200
|
+
[/^font-(\w+)$/, ([, d], { theme }) => ({ "font-family": theme.fontFamily?.[d] })],
|
|
210
201
|
[/^text-(.+)$/, ([, s = "base"], { theme }) => {
|
|
211
202
|
const size = utilities.handler.bracket.auto.rem(s);
|
|
212
203
|
if (size)
|
|
@@ -220,37 +211,16 @@ const fonts = [
|
|
|
220
211
|
};
|
|
221
212
|
}
|
|
222
213
|
}],
|
|
223
|
-
[/^text-size-(.+)$/, ([, s]) => {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}]
|
|
228
|
-
[/^(?:font|fw)-?([^-]+)$/, ([, s]) => {
|
|
229
|
-
const v = weightMap[s] || utilities.handler.number(s);
|
|
230
|
-
if (v)
|
|
231
|
-
return { "font-weight": v };
|
|
232
|
-
}],
|
|
233
|
-
[/^(?:leading|lh)-([^-]+)$/, ([, s], { theme }) => {
|
|
234
|
-
const v = theme.lineHeight?.[s] || utilities.handler.bracket.auto.rem(s);
|
|
235
|
-
if (v !== null)
|
|
236
|
-
return { "line-height": v };
|
|
237
|
-
}],
|
|
238
|
-
[/^tracking-([^-]+)$/, ([, s], { theme }) => {
|
|
239
|
-
const v = theme.letterSpacing?.[s] || utilities.handler.bracket.auto.rem(s);
|
|
240
|
-
if (v !== null)
|
|
241
|
-
return { "letter-spacing": v };
|
|
242
|
-
}],
|
|
243
|
-
[/^word-spacing-([^-]+)$/, ([, s], { theme }) => {
|
|
244
|
-
const v = theme.wordSpacing?.[s] || utilities.handler.bracket.auto.rem(s);
|
|
245
|
-
if (v !== null)
|
|
246
|
-
return { "word-spacing": v };
|
|
247
|
-
}]
|
|
214
|
+
[/^text-size-(.+)$/, ([, s]) => ({ "font-size": utilities.handler.bracket.auto.rem(s) })],
|
|
215
|
+
[/^(?:font|fw)-?([^-]+)$/, ([, s]) => ({ "font-weight": weightMap[s] || utilities.handler.number(s) })],
|
|
216
|
+
[/^(?:leading|lh)-([^-]+)$/, ([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] || utilities.handler.bracket.auto.rem(s) })],
|
|
217
|
+
[/^tracking-([^-]+)$/, ([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || utilities.handler.bracket.auto.rem(s) })],
|
|
218
|
+
[/^word-spacing-([^-]+)$/, ([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] || utilities.handler.bracket.auto.rem(s) })]
|
|
248
219
|
];
|
|
249
220
|
const tabSizes = [
|
|
250
221
|
[/^tab-?([^-]*)$/, ([, s]) => {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
if (v !== null) {
|
|
222
|
+
const v = utilities.handler.bracket.global.number(s || "4");
|
|
223
|
+
if (v != null) {
|
|
254
224
|
return {
|
|
255
225
|
"-moz-tab-size": v,
|
|
256
226
|
"-o-tab-size": v,
|
|
@@ -260,41 +230,29 @@ const tabSizes = [
|
|
|
260
230
|
}]
|
|
261
231
|
];
|
|
262
232
|
const textIndents = [
|
|
263
|
-
[/^indent(?:-(.+))?$/, ([, s], { theme }) => {
|
|
264
|
-
const v = theme.textIndent?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.fraction.auto.rem(s);
|
|
265
|
-
if (v != null)
|
|
266
|
-
return { "text-indent": v };
|
|
267
|
-
}]
|
|
233
|
+
[/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.fraction.auto.rem(s) })]
|
|
268
234
|
];
|
|
269
235
|
const textStrokes = [
|
|
270
|
-
[/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => {
|
|
271
|
-
const v = theme.textStrokeWidth?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.px(s);
|
|
272
|
-
if (v != null)
|
|
273
|
-
return { "-webkit-text-stroke-width": v };
|
|
274
|
-
}],
|
|
236
|
+
[/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => ({ "-webkit-text-stroke-width": theme.textStrokeWidth?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.px(s) })],
|
|
275
237
|
[/^text-stroke-(.+)$/, utilities.colorResolver("-webkit-text-stroke-color", "text-stroke")],
|
|
276
238
|
[/^text-stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-stroke-opacity": utilities.handler.bracket.percent(opacity) })]
|
|
277
239
|
];
|
|
278
240
|
const textShadows = [
|
|
279
|
-
[/^text-shadow(?:-(.+))?$/, ([, s], { theme }) => {
|
|
280
|
-
const v = theme.textShadow?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar(s);
|
|
281
|
-
if (v != null)
|
|
282
|
-
return { "text-shadow": v };
|
|
283
|
-
}]
|
|
241
|
+
[/^text-shadow(?:-(.+))?$/, ([, s], { theme }) => ({ "text-shadow": theme.textShadow?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar(s) })]
|
|
284
242
|
];
|
|
285
243
|
|
|
244
|
+
const directions = {
|
|
245
|
+
"": "",
|
|
246
|
+
"x-": "column-",
|
|
247
|
+
"y-": "row-"
|
|
248
|
+
};
|
|
286
249
|
const gaps = [
|
|
287
250
|
[/^(?:flex-|grid-)?gap-(x-|y-)?([^-]+)$/, ([, d = "", s]) => {
|
|
288
251
|
const v = utilities.handler.bracket.auto.rem(s);
|
|
289
252
|
if (v != null) {
|
|
290
|
-
const direction = {
|
|
291
|
-
"": "",
|
|
292
|
-
"x-": "column-",
|
|
293
|
-
"y-": "row-"
|
|
294
|
-
}[d];
|
|
295
253
|
return {
|
|
296
|
-
[`grid-${
|
|
297
|
-
[`${
|
|
254
|
+
[`grid-${directions[d]}gap`]: v,
|
|
255
|
+
[`${directions[d]}gap`]: v
|
|
298
256
|
};
|
|
299
257
|
}
|
|
300
258
|
}]
|
|
@@ -336,12 +294,12 @@ const grids = [
|
|
|
336
294
|
[/^(?:grid-)?auto-cols-([\w.-]+)$/, ([, v], { theme }) => ({ "grid-auto-columns": autoDirection(v, theme) })],
|
|
337
295
|
[/^(?:grid-)?auto-flow-([\w.-]+)$/, ([, v]) => ({ "grid-auto-flow": v.replace("col", "column").split("-").join(" ") })],
|
|
338
296
|
[/^(?:grid-)?auto-rows-([\w.-]+)$/, ([, v], { theme }) => ({ "grid-auto-rows": autoDirection(v, theme) })],
|
|
297
|
+
[/^grid-cols-(.+)$/, ([, v]) => ({ "grid-template-columns": utilities.handler.bracket(v) })],
|
|
298
|
+
[/^grid-rows-(.+)$/, ([, v]) => ({ "grid-template-rows": utilities.handler.bracket(v) })],
|
|
339
299
|
[/^grid-cols-minmax-([\w.-]+)$/, ([, d]) => ({ "grid-template-columns": `repeat(auto-fill,minmax(${d},1fr))` })],
|
|
340
300
|
[/^grid-rows-minmax-([\w.-]+)$/, ([, d]) => ({ "grid-template-rows": `repeat(auto-fill,minmax(${d},1fr))` })],
|
|
341
301
|
[/^grid-cols-(\d+)$/, ([, d]) => ({ "grid-template-columns": `repeat(${d},minmax(0,1fr))` })],
|
|
342
|
-
[/^grid-rows-(\d+)$/, ([, d]) => ({ "grid-template-rows": `repeat(${d},minmax(0,1fr))` })]
|
|
343
|
-
[/^grid-cols-\[(.+)\]$/, ([, v]) => ({ "grid-template-columns": v.replace(/,/g, " ") })],
|
|
344
|
-
[/^grid-rows-\[(.+)\]$/, ([, v]) => ({ "grid-template-rows": v.replace(/,/g, " ") })]
|
|
302
|
+
[/^grid-rows-(\d+)$/, ([, d]) => ({ "grid-template-rows": `repeat(${d},minmax(0,1fr))` })]
|
|
345
303
|
];
|
|
346
304
|
|
|
347
305
|
const overflowValues = [
|
|
@@ -357,11 +315,8 @@ const overflows = [
|
|
|
357
315
|
|
|
358
316
|
const basicSet = ["auto", "start", "end", "center", "stretch"];
|
|
359
317
|
const positions = [
|
|
360
|
-
[
|
|
361
|
-
[
|
|
362
|
-
["fixed", { position: "fixed" }],
|
|
363
|
-
["sticky", { position: "sticky" }],
|
|
364
|
-
["static", { position: "static" }]
|
|
318
|
+
[/^(?:position-|pos-)?(relative|absolute|fixed|sticky)$/, ([, v]) => ({ position: v })],
|
|
319
|
+
[/^(?:position-|pos-)?(static)$/, ([, v]) => ({ position: v })]
|
|
365
320
|
];
|
|
366
321
|
const justifies = [
|
|
367
322
|
["justify-start", { "justify-content": "flex-start" }],
|
|
@@ -412,8 +367,8 @@ function handleInsetValue(v) {
|
|
|
412
367
|
return { auto: "auto", full: "100%" }[v] ?? utilities.handler.bracket.fraction.cssvar.auto.rem(v);
|
|
413
368
|
}
|
|
414
369
|
const insets = [
|
|
415
|
-
[/^(top|left|right|bottom|inset)-(.+)$/, ([, d, v]) => ({ [d]: handleInsetValue(v) })],
|
|
416
|
-
[/^inset-([xy])-(.+)$/, ([, d, v]) => {
|
|
370
|
+
[/^(?:position-|pos-)?(top|left|right|bottom|inset)-(.+)$/, ([, d, v]) => ({ [d]: handleInsetValue(v) })],
|
|
371
|
+
[/^(?:position-|pos-)?inset-([xy])-(.+)$/, ([, d, v]) => {
|
|
417
372
|
const r = handleInsetValue(v);
|
|
418
373
|
if (r != null && d in utilities.directionMap)
|
|
419
374
|
return utilities.directionMap[d].map((i) => [i.slice(1), r]);
|
|
@@ -522,17 +477,12 @@ const rings = [
|
|
|
522
477
|
"--un-ring-color": "rgba(59, 130, 246, .5)",
|
|
523
478
|
"--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)",
|
|
524
479
|
"--un-ring-shadow": `var(--un-ring-inset) 0 0 0 calc(${value} + var(--un-ring-offset-width)) var(--un-ring-color)`,
|
|
525
|
-
"-webkit-box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow, 0 0 #0000)",
|
|
526
480
|
"box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow, 0 0 #0000)"
|
|
527
481
|
};
|
|
528
482
|
}
|
|
529
483
|
}],
|
|
530
484
|
["ring-offset", { "--un-ring-offset-width": "1px" }],
|
|
531
|
-
[/^ring-offset-(.+)$/, ([, d]) => {
|
|
532
|
-
const value = utilities.handler.px(d || "1");
|
|
533
|
-
if (value)
|
|
534
|
-
return { "--un-ring-offset-width": value };
|
|
535
|
-
}],
|
|
485
|
+
[/^ring-offset-(.+)$/, ([, d]) => ({ "--un-ring-offset-width": utilities.handler.px(d || "1") })],
|
|
536
486
|
[/^ring-(.+)$/, utilities.colorResolver("--un-ring-color", "ring")],
|
|
537
487
|
[/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": utilities.handler.bracket.percent(opacity) })],
|
|
538
488
|
[/^ring-offset-(.+)$/, utilities.colorResolver("--un-ring-offset-color", "ring-offset")],
|
|
@@ -540,7 +490,7 @@ const rings = [
|
|
|
540
490
|
["ring-inset", { "--un-ring-inset": "inset" }]
|
|
541
491
|
];
|
|
542
492
|
|
|
543
|
-
const
|
|
493
|
+
const shadowColorResolver = (body, theme) => {
|
|
544
494
|
const data = utilities.parseColor(body, theme);
|
|
545
495
|
if (!data)
|
|
546
496
|
return;
|
|
@@ -562,13 +512,15 @@ const boxShadows = [
|
|
|
562
512
|
const value = theme.boxShadow?.[d || "DEFAULT"];
|
|
563
513
|
if (value) {
|
|
564
514
|
return {
|
|
515
|
+
"--un-shadow-inset": varEmpty,
|
|
565
516
|
"--un-shadow-color": "0,0,0",
|
|
566
517
|
"--un-shadow": value,
|
|
567
518
|
"box-shadow": "var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow)"
|
|
568
519
|
};
|
|
569
520
|
}
|
|
570
521
|
}],
|
|
571
|
-
[/^shadow-(.+)$/, ([, d], { theme }) =>
|
|
522
|
+
[/^shadow-(.+)$/, ([, d], { theme }) => shadowColorResolver(d, theme)],
|
|
523
|
+
["shadow-inset", { "--un-shadow-inset": "inset" }]
|
|
572
524
|
];
|
|
573
525
|
|
|
574
526
|
function getPropName(minmax, hw) {
|
|
@@ -594,11 +546,7 @@ const sizes = [
|
|
|
594
546
|
];
|
|
595
547
|
const aspectRatio = [
|
|
596
548
|
["aspect-ratio-auto", { "aspect-ratio": "auto" }],
|
|
597
|
-
[/^aspect-ratio-(.+)$/, ([, d]) => {
|
|
598
|
-
const v = (/^\d+\/\d+$/.test(d) ? d : null) || utilities.handler.bracket.cssvar.number(d);
|
|
599
|
-
if (v != null)
|
|
600
|
-
return { "aspect-ratio": v };
|
|
601
|
-
}]
|
|
549
|
+
[/^aspect-ratio-(.+)$/, ([, d]) => ({ "aspect-ratio": (/^\d+\/\d+$/.test(d) ? d : null) || utilities.handler.bracket.cssvar.number(d) })]
|
|
602
550
|
];
|
|
603
551
|
|
|
604
552
|
const paddings = [
|
|
@@ -661,9 +609,7 @@ function handleTranslate([, d, b]) {
|
|
|
661
609
|
if (v != null) {
|
|
662
610
|
return [
|
|
663
611
|
transformBase,
|
|
664
|
-
[
|
|
665
|
-
...utilities.xyzMap[d].map((i) => [`--un-translate${i}`, v])
|
|
666
|
-
]
|
|
612
|
+
utilities.xyzMap[d].map((i) => [`--un-translate${i}`, v])
|
|
667
613
|
];
|
|
668
614
|
}
|
|
669
615
|
}
|
|
@@ -672,9 +618,7 @@ function handleScale([, d, b]) {
|
|
|
672
618
|
if (v != null) {
|
|
673
619
|
return [
|
|
674
620
|
transformBase,
|
|
675
|
-
[
|
|
676
|
-
...utilities.xyzMap[d].map((i) => [`--un-scale${i}`, v])
|
|
677
|
-
]
|
|
621
|
+
utilities.xyzMap[d].map((i) => [`--un-scale${i}`, v])
|
|
678
622
|
];
|
|
679
623
|
}
|
|
680
624
|
}
|
|
@@ -722,17 +666,12 @@ const variablesAbbrMap = {
|
|
|
722
666
|
"backface": "backface-visibility",
|
|
723
667
|
"whitespace": "white-space",
|
|
724
668
|
"break": "word-break",
|
|
725
|
-
"b": "border-color",
|
|
726
|
-
"border": "border-color",
|
|
727
|
-
"color": "color",
|
|
728
669
|
"case": "text-transform",
|
|
729
670
|
"origin": "transform-origin",
|
|
730
|
-
"bg": "background-color",
|
|
731
671
|
"bg-opacity": "background-opacity",
|
|
732
672
|
"tab": "tab-size",
|
|
733
673
|
"underline": "text-decoration-thickness",
|
|
734
674
|
"underline-offset": "text-underline-offset",
|
|
735
|
-
"text": "color",
|
|
736
675
|
"grid-cols": "grid-template-columns",
|
|
737
676
|
"grid-rows": "grid-template-rows",
|
|
738
677
|
"auto-flow": "grid-auto-flow",
|
|
@@ -747,15 +686,8 @@ const variablesAbbrMap = {
|
|
|
747
686
|
const cssVariables = [
|
|
748
687
|
[/^(.+)-\$(.+)$/, ([, name, varname]) => {
|
|
749
688
|
const prop = variablesAbbrMap[name];
|
|
750
|
-
if (prop)
|
|
751
|
-
return {
|
|
752
|
-
[prop]: `var(--${varname})`
|
|
753
|
-
};
|
|
754
|
-
}
|
|
755
|
-
}],
|
|
756
|
-
[/^(?:border|b)-([^-]+)-\$(.+)$/, ([, a, v]) => {
|
|
757
|
-
if (a in utilities.directionMap)
|
|
758
|
-
return utilities.directionMap[a].map((i) => [`border${i}-color`, `var(--${v})`]);
|
|
689
|
+
if (prop)
|
|
690
|
+
return { [prop]: `var(--${varname})` };
|
|
759
691
|
}]
|
|
760
692
|
];
|
|
761
693
|
|
|
@@ -797,11 +729,7 @@ const svgUtilities = [
|
|
|
797
729
|
[/^fill-(.+)$/, utilities.colorResolver("fill", "fill")],
|
|
798
730
|
[/^fill-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-fill-opacity": utilities.handler.bracket.percent(opacity) })],
|
|
799
731
|
["fill-none", { fill: "none" }],
|
|
800
|
-
[/^stroke-(?:size-|width-)?(.+)$/, ([, s]) => {
|
|
801
|
-
const v = utilities.handler.bracket.fraction.px.number(s);
|
|
802
|
-
if (v)
|
|
803
|
-
return { "stroke-width": v };
|
|
804
|
-
}],
|
|
732
|
+
[/^stroke-(?:size-|width-)?(.+)$/, ([, s]) => ({ "stroke-width": utilities.handler.bracket.fraction.px.number(s) })],
|
|
805
733
|
[/^stroke-(.+)$/, utilities.colorResolver("stroke", "stroke")],
|
|
806
734
|
[/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity": utilities.handler.bracket.percent(opacity) })],
|
|
807
735
|
["stroke-none", { stroke: "none" }]
|