@unocss/preset-mini 0.18.0 → 0.20.1
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 +39 -109
- package/dist/chunks/default2.mjs +49 -119
- package/dist/chunks/default3.cjs +26 -26
- package/dist/chunks/default3.mjs +27 -27
- package/dist/chunks/pseudo.cjs +29 -17
- package/dist/chunks/pseudo.mjs +29 -17
- package/dist/chunks/utilities.cjs +4 -2
- package/dist/chunks/utilities.mjs +4 -2
- package/dist/chunks/variants.cjs +17 -2
- package/dist/chunks/variants.mjs +17 -3
- package/dist/{colors-d6b5a5b4.d.ts → colors-6d634692.d.ts} +1 -1
- package/dist/colors.d.ts +2 -2
- package/dist/{default-c7c67d23.d.ts → default-958434b6.d.ts} +1 -1
- package/dist/index.cjs +21 -7
- package/dist/index.d.ts +10 -6
- package/dist/index.mjs +21 -7
- package/dist/rules.d.ts +1 -1
- package/dist/theme.d.ts +4 -4
- package/dist/{types-7963d0b3.d.ts → types-a2d2b52f.d.ts} +8 -1
- package/dist/utils.cjs +1 -0
- package/dist/utils.d.ts +3 -2
- package/dist/utils.mjs +1 -1
- package/dist/variants.cjs +3 -3
- package/dist/variants.d.ts +9 -10
- package/dist/variants.mjs +2 -2
- 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
|
@@ -81,12 +81,12 @@ const borderColorResolver = (direction) => ([, body], { theme }) => {
|
|
|
81
81
|
} else {
|
|
82
82
|
if (direction === "") {
|
|
83
83
|
return {
|
|
84
|
-
"--un-border-opacity": 1,
|
|
84
|
+
"--un-border-opacity": (opacity && utilities.handler.cssvar(opacity)) ?? 1,
|
|
85
85
|
[`border${direction}-color`]: `rgba(${rgba.slice(0, 3).join(",")},var(--un-border${direction}-opacity))`
|
|
86
86
|
};
|
|
87
87
|
} else {
|
|
88
88
|
return {
|
|
89
|
-
"--un-border-opacity": 1,
|
|
89
|
+
"--un-border-opacity": (opacity && utilities.handler.cssvar(opacity)) ?? 1,
|
|
90
90
|
[`--un-border${direction}-opacity`]: "var(--un-border-opacity)",
|
|
91
91
|
[`border${direction}-color`]: `rgba(${rgba.slice(0, 3).join(",")},var(--un-border${direction}-opacity))`
|
|
92
92
|
};
|
|
@@ -173,7 +173,7 @@ const flex = [
|
|
|
173
173
|
["flex-auto", { flex: "1 1 auto" }],
|
|
174
174
|
["flex-initial", { flex: "0 1 auto" }],
|
|
175
175
|
["flex-none", { flex: "none" }],
|
|
176
|
-
[/^flex
|
|
176
|
+
[/^flex-(\[.+\])$/, ([, d]) => ({ flex: utilities.handler.bracket(d).replace(/\d+\/\d+/, ($1) => utilities.handler.fraction($1)) })],
|
|
177
177
|
["flex-shrink", { "flex-shrink": 1 }],
|
|
178
178
|
["flex-shrink-0", { "flex-shrink": 0 }],
|
|
179
179
|
["flex-grow", { "flex-grow": 1 }],
|
|
@@ -199,14 +199,7 @@ const weightMap = {
|
|
|
199
199
|
black: "900"
|
|
200
200
|
};
|
|
201
201
|
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
|
-
}],
|
|
202
|
+
[/^font-(\w+)$/, ([, d], { theme }) => ({ "font-family": theme.fontFamily?.[d] })],
|
|
210
203
|
[/^text-(.+)$/, ([, s = "base"], { theme }) => {
|
|
211
204
|
const size = utilities.handler.bracket.auto.rem(s);
|
|
212
205
|
if (size)
|
|
@@ -220,37 +213,16 @@ const fonts = [
|
|
|
220
213
|
};
|
|
221
214
|
}
|
|
222
215
|
}],
|
|
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
|
-
}]
|
|
216
|
+
[/^text-size-(.+)$/, ([, s]) => ({ "font-size": utilities.handler.bracket.auto.rem(s) })],
|
|
217
|
+
[/^(?:font|fw)-?([^-]+)$/, ([, s]) => ({ "font-weight": weightMap[s] || utilities.handler.number(s) })],
|
|
218
|
+
[/^(?:leading|lh)-([^-]+)$/, ([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] || utilities.handler.bracket.auto.rem(s) })],
|
|
219
|
+
[/^tracking-([^-]+)$/, ([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || utilities.handler.bracket.auto.rem(s) })],
|
|
220
|
+
[/^word-spacing-([^-]+)$/, ([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] || utilities.handler.bracket.auto.rem(s) })]
|
|
248
221
|
];
|
|
249
222
|
const tabSizes = [
|
|
250
223
|
[/^tab-?([^-]*)$/, ([, s]) => {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
if (v !== null) {
|
|
224
|
+
const v = utilities.handler.bracket.global.number(s || "4");
|
|
225
|
+
if (v != null) {
|
|
254
226
|
return {
|
|
255
227
|
"-moz-tab-size": v,
|
|
256
228
|
"-o-tab-size": v,
|
|
@@ -260,41 +232,29 @@ const tabSizes = [
|
|
|
260
232
|
}]
|
|
261
233
|
];
|
|
262
234
|
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
|
-
}]
|
|
235
|
+
[/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.fraction.auto.rem(s) })]
|
|
268
236
|
];
|
|
269
237
|
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
|
-
}],
|
|
238
|
+
[/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => ({ "-webkit-text-stroke-width": theme.textStrokeWidth?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.px(s) })],
|
|
275
239
|
[/^text-stroke-(.+)$/, utilities.colorResolver("-webkit-text-stroke-color", "text-stroke")],
|
|
276
240
|
[/^text-stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-stroke-opacity": utilities.handler.bracket.percent(opacity) })]
|
|
277
241
|
];
|
|
278
242
|
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
|
-
}]
|
|
243
|
+
[/^text-shadow(?:-(.+))?$/, ([, s], { theme }) => ({ "text-shadow": theme.textShadow?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar(s) })]
|
|
284
244
|
];
|
|
285
245
|
|
|
246
|
+
const directions = {
|
|
247
|
+
"": "",
|
|
248
|
+
"x-": "column-",
|
|
249
|
+
"y-": "row-"
|
|
250
|
+
};
|
|
286
251
|
const gaps = [
|
|
287
252
|
[/^(?:flex-|grid-)?gap-(x-|y-)?([^-]+)$/, ([, d = "", s]) => {
|
|
288
253
|
const v = utilities.handler.bracket.auto.rem(s);
|
|
289
254
|
if (v != null) {
|
|
290
|
-
const direction = {
|
|
291
|
-
"": "",
|
|
292
|
-
"x-": "column-",
|
|
293
|
-
"y-": "row-"
|
|
294
|
-
}[d];
|
|
295
255
|
return {
|
|
296
|
-
[`grid-${
|
|
297
|
-
[`${
|
|
256
|
+
[`grid-${directions[d]}gap`]: v,
|
|
257
|
+
[`${directions[d]}gap`]: v
|
|
298
258
|
};
|
|
299
259
|
}
|
|
300
260
|
}]
|
|
@@ -336,12 +296,12 @@ const grids = [
|
|
|
336
296
|
[/^(?:grid-)?auto-cols-([\w.-]+)$/, ([, v], { theme }) => ({ "grid-auto-columns": autoDirection(v, theme) })],
|
|
337
297
|
[/^(?:grid-)?auto-flow-([\w.-]+)$/, ([, v]) => ({ "grid-auto-flow": v.replace("col", "column").split("-").join(" ") })],
|
|
338
298
|
[/^(?:grid-)?auto-rows-([\w.-]+)$/, ([, v], { theme }) => ({ "grid-auto-rows": autoDirection(v, theme) })],
|
|
299
|
+
[/^grid-cols-(.+)$/, ([, v]) => ({ "grid-template-columns": utilities.handler.bracket(v) })],
|
|
300
|
+
[/^grid-rows-(.+)$/, ([, v]) => ({ "grid-template-rows": utilities.handler.bracket(v) })],
|
|
339
301
|
[/^grid-cols-minmax-([\w.-]+)$/, ([, d]) => ({ "grid-template-columns": `repeat(auto-fill,minmax(${d},1fr))` })],
|
|
340
302
|
[/^grid-rows-minmax-([\w.-]+)$/, ([, d]) => ({ "grid-template-rows": `repeat(auto-fill,minmax(${d},1fr))` })],
|
|
341
303
|
[/^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, " ") })]
|
|
304
|
+
[/^grid-rows-(\d+)$/, ([, d]) => ({ "grid-template-rows": `repeat(${d},minmax(0,1fr))` })]
|
|
345
305
|
];
|
|
346
306
|
|
|
347
307
|
const overflowValues = [
|
|
@@ -357,11 +317,8 @@ const overflows = [
|
|
|
357
317
|
|
|
358
318
|
const basicSet = ["auto", "start", "end", "center", "stretch"];
|
|
359
319
|
const positions = [
|
|
360
|
-
[
|
|
361
|
-
[
|
|
362
|
-
["fixed", { position: "fixed" }],
|
|
363
|
-
["sticky", { position: "sticky" }],
|
|
364
|
-
["static", { position: "static" }]
|
|
320
|
+
[/^(?:position-|pos-)?(relative|absolute|fixed|sticky)$/, ([, v]) => ({ position: v })],
|
|
321
|
+
[/^(?:position-|pos-)?(static)$/, ([, v]) => ({ position: v })]
|
|
365
322
|
];
|
|
366
323
|
const justifies = [
|
|
367
324
|
["justify-start", { "justify-content": "flex-start" }],
|
|
@@ -412,8 +369,8 @@ function handleInsetValue(v) {
|
|
|
412
369
|
return { auto: "auto", full: "100%" }[v] ?? utilities.handler.bracket.fraction.cssvar.auto.rem(v);
|
|
413
370
|
}
|
|
414
371
|
const insets = [
|
|
415
|
-
[/^(top|left|right|bottom|inset)-(.+)$/, ([, d, v]) => ({ [d]: handleInsetValue(v) })],
|
|
416
|
-
[/^inset-([xy])-(.+)$/, ([, d, v]) => {
|
|
372
|
+
[/^(?:position-|pos-)?(top|left|right|bottom|inset)-(.+)$/, ([, d, v]) => ({ [d]: handleInsetValue(v) })],
|
|
373
|
+
[/^(?:position-|pos-)?inset-([xy])-(.+)$/, ([, d, v]) => {
|
|
417
374
|
const r = handleInsetValue(v);
|
|
418
375
|
if (r != null && d in utilities.directionMap)
|
|
419
376
|
return utilities.directionMap[d].map((i) => [i.slice(1), r]);
|
|
@@ -522,17 +479,12 @@ const rings = [
|
|
|
522
479
|
"--un-ring-color": "rgba(59, 130, 246, .5)",
|
|
523
480
|
"--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)",
|
|
524
481
|
"--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
482
|
"box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow, 0 0 #0000)"
|
|
527
483
|
};
|
|
528
484
|
}
|
|
529
485
|
}],
|
|
530
486
|
["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
|
-
}],
|
|
487
|
+
[/^ring-offset-(.+)$/, ([, d]) => ({ "--un-ring-offset-width": utilities.handler.px(d || "1") })],
|
|
536
488
|
[/^ring-(.+)$/, utilities.colorResolver("--un-ring-color", "ring")],
|
|
537
489
|
[/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": utilities.handler.bracket.percent(opacity) })],
|
|
538
490
|
[/^ring-offset-(.+)$/, utilities.colorResolver("--un-ring-offset-color", "ring-offset")],
|
|
@@ -540,7 +492,7 @@ const rings = [
|
|
|
540
492
|
["ring-inset", { "--un-ring-inset": "inset" }]
|
|
541
493
|
];
|
|
542
494
|
|
|
543
|
-
const
|
|
495
|
+
const shadowColorResolver = (body, theme) => {
|
|
544
496
|
const data = utilities.parseColor(body, theme);
|
|
545
497
|
if (!data)
|
|
546
498
|
return;
|
|
@@ -562,13 +514,15 @@ const boxShadows = [
|
|
|
562
514
|
const value = theme.boxShadow?.[d || "DEFAULT"];
|
|
563
515
|
if (value) {
|
|
564
516
|
return {
|
|
517
|
+
"--un-shadow-inset": varEmpty,
|
|
565
518
|
"--un-shadow-color": "0,0,0",
|
|
566
519
|
"--un-shadow": value,
|
|
567
520
|
"box-shadow": "var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow)"
|
|
568
521
|
};
|
|
569
522
|
}
|
|
570
523
|
}],
|
|
571
|
-
[/^shadow-(.+)$/, ([, d], { theme }) =>
|
|
524
|
+
[/^shadow-(.+)$/, ([, d], { theme }) => shadowColorResolver(d, theme)],
|
|
525
|
+
["shadow-inset", { "--un-shadow-inset": "inset" }]
|
|
572
526
|
];
|
|
573
527
|
|
|
574
528
|
function getPropName(minmax, hw) {
|
|
@@ -594,11 +548,7 @@ const sizes = [
|
|
|
594
548
|
];
|
|
595
549
|
const aspectRatio = [
|
|
596
550
|
["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
|
-
}]
|
|
551
|
+
[/^aspect-ratio-(.+)$/, ([, d]) => ({ "aspect-ratio": (/^\d+\/\d+$/.test(d) ? d : null) || utilities.handler.bracket.cssvar.number(d) })]
|
|
602
552
|
];
|
|
603
553
|
|
|
604
554
|
const paddings = [
|
|
@@ -661,9 +611,7 @@ function handleTranslate([, d, b]) {
|
|
|
661
611
|
if (v != null) {
|
|
662
612
|
return [
|
|
663
613
|
transformBase,
|
|
664
|
-
[
|
|
665
|
-
...utilities.xyzMap[d].map((i) => [`--un-translate${i}`, v])
|
|
666
|
-
]
|
|
614
|
+
utilities.xyzMap[d].map((i) => [`--un-translate${i}`, v])
|
|
667
615
|
];
|
|
668
616
|
}
|
|
669
617
|
}
|
|
@@ -672,9 +620,7 @@ function handleScale([, d, b]) {
|
|
|
672
620
|
if (v != null) {
|
|
673
621
|
return [
|
|
674
622
|
transformBase,
|
|
675
|
-
[
|
|
676
|
-
...utilities.xyzMap[d].map((i) => [`--un-scale${i}`, v])
|
|
677
|
-
]
|
|
623
|
+
utilities.xyzMap[d].map((i) => [`--un-scale${i}`, v])
|
|
678
624
|
];
|
|
679
625
|
}
|
|
680
626
|
}
|
|
@@ -722,17 +668,12 @@ const variablesAbbrMap = {
|
|
|
722
668
|
"backface": "backface-visibility",
|
|
723
669
|
"whitespace": "white-space",
|
|
724
670
|
"break": "word-break",
|
|
725
|
-
"b": "border-color",
|
|
726
|
-
"border": "border-color",
|
|
727
|
-
"color": "color",
|
|
728
671
|
"case": "text-transform",
|
|
729
672
|
"origin": "transform-origin",
|
|
730
|
-
"bg": "background-color",
|
|
731
673
|
"bg-opacity": "background-opacity",
|
|
732
674
|
"tab": "tab-size",
|
|
733
675
|
"underline": "text-decoration-thickness",
|
|
734
676
|
"underline-offset": "text-underline-offset",
|
|
735
|
-
"text": "color",
|
|
736
677
|
"grid-cols": "grid-template-columns",
|
|
737
678
|
"grid-rows": "grid-template-rows",
|
|
738
679
|
"auto-flow": "grid-auto-flow",
|
|
@@ -747,15 +688,8 @@ const variablesAbbrMap = {
|
|
|
747
688
|
const cssVariables = [
|
|
748
689
|
[/^(.+)-\$(.+)$/, ([, name, varname]) => {
|
|
749
690
|
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})`]);
|
|
691
|
+
if (prop)
|
|
692
|
+
return { [prop]: `var(--${varname})` };
|
|
759
693
|
}]
|
|
760
694
|
];
|
|
761
695
|
|
|
@@ -797,11 +731,7 @@ const svgUtilities = [
|
|
|
797
731
|
[/^fill-(.+)$/, utilities.colorResolver("fill", "fill")],
|
|
798
732
|
[/^fill-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-fill-opacity": utilities.handler.bracket.percent(opacity) })],
|
|
799
733
|
["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
|
-
}],
|
|
734
|
+
[/^stroke-(?:size-|width-)?(.+)$/, ([, s]) => ({ "stroke-width": utilities.handler.bracket.fraction.px.number(s) })],
|
|
805
735
|
[/^stroke-(.+)$/, utilities.colorResolver("stroke", "stroke")],
|
|
806
736
|
[/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity": utilities.handler.bracket.percent(opacity) })],
|
|
807
737
|
["stroke-none", { stroke: "none" }]
|