@unocss/preset-mini 0.22.2 → 0.22.6
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 +10 -1
- package/dist/chunks/default.mjs +10 -2
- package/dist/chunks/default2.cjs +104 -100
- package/dist/chunks/default2.mjs +104 -100
- package/dist/chunks/default3.cjs +15 -26
- package/dist/chunks/default3.mjs +16 -26
- package/dist/chunks/utilities.cjs +6 -10
- package/dist/chunks/utilities.mjs +8 -11
- package/dist/{colors-338f482c.d.ts → colors-db01a23e.d.ts} +1 -1
- package/dist/colors.d.ts +2 -2
- package/dist/{default-17948303.d.ts → default-c46850c2.d.ts} +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/rules.d.ts +2 -2
- package/dist/theme.cjs +1 -0
- package/dist/theme.d.ts +12 -5
- package/dist/theme.mjs +1 -1
- package/dist/{types-c14b808b.d.ts → types-154878eb.d.ts} +1 -0
- package/dist/{utilities-13c33ba5.d.ts → utilities-8c324eff.d.ts} +2 -3
- package/dist/utils.cjs +0 -1
- package/dist/utils.d.ts +2 -2
- package/dist/utils.mjs +1 -1
- package/dist/variants.cjs +0 -1
- package/dist/variants.d.ts +11 -15
- package/dist/variants.mjs +1 -1
- package/package.json +2 -2
package/dist/chunks/default.cjs
CHANGED
|
@@ -124,6 +124,13 @@ const boxShadow = {
|
|
|
124
124
|
"inner": "inset 0 2px 4px 0 rgba(0,0,0,0.05)",
|
|
125
125
|
"none": "0 0 #0000"
|
|
126
126
|
};
|
|
127
|
+
const easing = {
|
|
128
|
+
"DEFAULT": "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
129
|
+
"linear": "linear",
|
|
130
|
+
"in": "cubic-bezier(0.4, 0, 1, 1)",
|
|
131
|
+
"out": "cubic-bezier(0, 0, 0.2, 1)",
|
|
132
|
+
"in-out": "cubic-bezier(0.4, 0, 0.2, 1)"
|
|
133
|
+
};
|
|
127
134
|
|
|
128
135
|
const blur = {
|
|
129
136
|
"DEFAULT": "8px",
|
|
@@ -206,7 +213,8 @@ const theme = {
|
|
|
206
213
|
textShadow,
|
|
207
214
|
textStrokeWidth,
|
|
208
215
|
blur,
|
|
209
|
-
dropShadow
|
|
216
|
+
dropShadow,
|
|
217
|
+
easing
|
|
210
218
|
};
|
|
211
219
|
|
|
212
220
|
exports.baseSize = baseSize;
|
|
@@ -215,6 +223,7 @@ exports.borderRadius = borderRadius;
|
|
|
215
223
|
exports.boxShadow = boxShadow;
|
|
216
224
|
exports.breakpoints = breakpoints;
|
|
217
225
|
exports.dropShadow = dropShadow;
|
|
226
|
+
exports.easing = easing;
|
|
218
227
|
exports.fontFamily = fontFamily;
|
|
219
228
|
exports.fontSize = fontSize;
|
|
220
229
|
exports.height = height;
|
package/dist/chunks/default.mjs
CHANGED
|
@@ -122,6 +122,13 @@ const boxShadow = {
|
|
|
122
122
|
"inner": "inset 0 2px 4px 0 rgba(0,0,0,0.05)",
|
|
123
123
|
"none": "0 0 #0000"
|
|
124
124
|
};
|
|
125
|
+
const easing = {
|
|
126
|
+
"DEFAULT": "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
127
|
+
"linear": "linear",
|
|
128
|
+
"in": "cubic-bezier(0.4, 0, 1, 1)",
|
|
129
|
+
"out": "cubic-bezier(0, 0, 0.2, 1)",
|
|
130
|
+
"in-out": "cubic-bezier(0.4, 0, 0.2, 1)"
|
|
131
|
+
};
|
|
125
132
|
|
|
126
133
|
const blur = {
|
|
127
134
|
"DEFAULT": "8px",
|
|
@@ -204,7 +211,8 @@ const theme = {
|
|
|
204
211
|
textShadow,
|
|
205
212
|
textStrokeWidth,
|
|
206
213
|
blur,
|
|
207
|
-
dropShadow
|
|
214
|
+
dropShadow,
|
|
215
|
+
easing
|
|
208
216
|
};
|
|
209
217
|
|
|
210
|
-
export { fontSize as a, blur as b, textIndent as c, dropShadow as d, textStrokeWidth as e, fontFamily as f, textShadow as g, letterSpacing as h, breakpoints as i, borderRadius as j, boxShadow as k, lineHeight as l,
|
|
218
|
+
export { fontSize as a, blur as b, textIndent as c, dropShadow as d, textStrokeWidth as e, fontFamily as f, textShadow as g, letterSpacing as h, breakpoints as i, borderRadius as j, boxShadow as k, lineHeight as l, easing as m, baseSize as n, width as o, maxWidth as p, height as q, maxHeight as r, theme as t, wordSpacing as w };
|
package/dist/chunks/default2.cjs
CHANGED
|
@@ -19,9 +19,9 @@ const textAligns = [
|
|
|
19
19
|
];
|
|
20
20
|
|
|
21
21
|
const outline = [
|
|
22
|
-
[/^outline-(?:width-|size-)?(.+)$/, ([, d]) => ({ "outline-width": utilities.handler.bracket.
|
|
22
|
+
[/^outline-(?:width-|size-)?(.+)$/, ([, d]) => ({ "outline-width": 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.
|
|
24
|
+
[/^outline-offset-(.+)$/, ([, d]) => ({ "outline-offset": 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" }]
|
|
@@ -120,7 +120,7 @@ function handlerBorder(m) {
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
function handlerBorderSize([, a = "", b = "1"]) {
|
|
123
|
-
const v = utilities.handler.bracket.px(b);
|
|
123
|
+
const v = utilities.handler.bracket.cssvar.px(b);
|
|
124
124
|
if (a in utilities.directionMap && v != null)
|
|
125
125
|
return utilities.directionMap[a].map((i) => [`border${i}-width`, v]);
|
|
126
126
|
}
|
|
@@ -135,7 +135,7 @@ function handlerBorderOpacity([, a = "", opacity]) {
|
|
|
135
135
|
return utilities.directionMap[a].map((i) => [`--un-border${i}-opacity`, v]);
|
|
136
136
|
}
|
|
137
137
|
function handlerRounded([, a = "", s = "DEFAULT"], { theme }) {
|
|
138
|
-
const v = theme.borderRadius?.[s] || utilities.handler.
|
|
138
|
+
const v = theme.borderRadius?.[s] || utilities.handler.bracket.cssvar.fraction.rem(s);
|
|
139
139
|
if (a in utilities.cornerMap && v != null)
|
|
140
140
|
return utilities.cornerMap[a].map((i) => [`border${i}-radius`, v]);
|
|
141
141
|
}
|
|
@@ -145,7 +145,7 @@ const opacity = [
|
|
|
145
145
|
];
|
|
146
146
|
const textColors = [
|
|
147
147
|
[/^(?:text|color|c)-(.+)$/, utilities.colorResolver("color", "text")],
|
|
148
|
-
[/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-text-opacity": utilities.handler.bracket.percent
|
|
148
|
+
[/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-text-opacity": utilities.handler.bracket.percent(opacity2) })]
|
|
149
149
|
];
|
|
150
150
|
const bgColors = [
|
|
151
151
|
[/^bg-(.+)$/, utilities.colorResolver("background-color", "bg")],
|
|
@@ -168,19 +168,14 @@ const transitions = [
|
|
|
168
168
|
if (p) {
|
|
169
169
|
return {
|
|
170
170
|
"transition-property": p,
|
|
171
|
-
"transition-timing-function": "cubic-bezier(0.4,0,0.2,1)",
|
|
171
|
+
"transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
172
172
|
"transition-duration": `${duration}ms`
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
175
|
}],
|
|
176
|
-
[/^(?:transition-)?
|
|
177
|
-
[/^(?:transition-)?
|
|
178
|
-
[/^ease
|
|
179
|
-
["ease", { "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)" }],
|
|
180
|
-
["ease-linear", { "transition-timing-function": "linear" }],
|
|
181
|
-
["ease-in", { "transition-timing-function": "cubic-bezier(0.4, 0, 1, 1)" }],
|
|
182
|
-
["ease-out", { "transition-timing-function": "cubic-bezier(0, 0, 0.2, 1)" }],
|
|
183
|
-
["ease-in-out", { "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)" }],
|
|
176
|
+
[/^(?:transition-)?duration-(.+)$/, ([, d]) => ({ "transition-duration": utilities.handler.bracket.cssvar.time(d) })],
|
|
177
|
+
[/^(?:transition-)?delay-(.+)$/, ([, d]) => ({ "transition-delay": utilities.handler.bracket.cssvar.time(d) })],
|
|
178
|
+
[/^(?:transition-)?ease(?:-(.+))?$/, ([, d], { theme }) => ({ "transition-timing-function": theme.easing?.[d || "DEFAULT"] ?? utilities.handler.bracket.cssvar(d) })],
|
|
184
179
|
[/^(?:transition-)?property-(.+)$/, ([, v]) => ({ "transition-property": utilities.handler.global(v) || transitionProperty(v) })],
|
|
185
180
|
["transition-property-none", { "transition-property": "none" }],
|
|
186
181
|
["property-none", { "transition-property": "none" }],
|
|
@@ -200,7 +195,7 @@ const flex = [
|
|
|
200
195
|
[/^(?:flex-)?shrink-0$/, () => ({ "flex-shrink": 0 })],
|
|
201
196
|
[/^(?:flex-)?grow$/, () => ({ "flex-grow": 1 })],
|
|
202
197
|
[/^(?:flex-)?grow-0$/, () => ({ "flex-grow": 0 })],
|
|
203
|
-
[/^(?:flex-)?basis-(.+)$/, ([, d]) => ({ "flex-basis": utilities.handler.bracket.
|
|
198
|
+
[/^(?:flex-)?basis-(.+)$/, ([, d]) => ({ "flex-basis": utilities.handler.bracket.cssvar.auto.fraction.rem(d) })],
|
|
204
199
|
["flex-row", { "flex-direction": "row" }],
|
|
205
200
|
["flex-row-reverse", { "flex-direction": "row-reverse" }],
|
|
206
201
|
["flex-col", { "flex-direction": "column" }],
|
|
@@ -227,7 +222,7 @@ const appearances = [
|
|
|
227
222
|
["backface-hidden", { "backface-visibility": "hidden" }]
|
|
228
223
|
];
|
|
229
224
|
const cursors = [
|
|
230
|
-
[/^cursor-(.+)$/, ([, c]) => ({ cursor: c })]
|
|
225
|
+
[/^cursor-(.+)$/, ([, c]) => ({ cursor: utilities.handler.bracket.cssvar(c) || c })]
|
|
231
226
|
];
|
|
232
227
|
const pointerEvents = [
|
|
233
228
|
["pointer-events-auto", { "pointer-events": "auto" }],
|
|
@@ -317,7 +312,7 @@ const boxShadows = [
|
|
|
317
312
|
}
|
|
318
313
|
}],
|
|
319
314
|
[/^shadow-(.+)$/, utilities.colorResolver("--un-shadow-color", "shadow")],
|
|
320
|
-
[/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": utilities.handler.bracket.percent
|
|
315
|
+
[/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": utilities.handler.bracket.percent(opacity) })],
|
|
321
316
|
["shadow-inset", { "--un-shadow-inset": "inset" }]
|
|
322
317
|
];
|
|
323
318
|
|
|
@@ -343,17 +338,17 @@ const fonts = [
|
|
|
343
338
|
"line-height": height
|
|
344
339
|
};
|
|
345
340
|
}
|
|
346
|
-
return { "font-size": utilities.handler.bracket.
|
|
341
|
+
return { "font-size": utilities.handler.bracket.rem(s) };
|
|
347
342
|
}],
|
|
348
|
-
[/^text-size-(.+)$/, ([, s]) => ({ "font-size": utilities.handler.bracket.
|
|
343
|
+
[/^text-size-(.+)$/, ([, s]) => ({ "font-size": utilities.handler.bracket.cssvar.rem(s) })],
|
|
349
344
|
[/^(?:font|fw)-?([^-]+)$/, ([, s]) => ({ "font-weight": weightMap[s] || utilities.handler.number(s) })],
|
|
350
|
-
[/^(?:leading|lh)-(
|
|
351
|
-
[/^tracking-(
|
|
352
|
-
[/^word-spacing-(
|
|
345
|
+
[/^(?:leading|lh)-(.+)$/, ([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] || utilities.handler.bracket.cssvar.rem(s) })],
|
|
346
|
+
[/^tracking-(.+)$/, ([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || utilities.handler.bracket.cssvar.rem(s) })],
|
|
347
|
+
[/^word-spacing-(.+)$/, ([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] || utilities.handler.bracket.cssvar.rem(s) })]
|
|
353
348
|
];
|
|
354
349
|
const tabSizes = [
|
|
355
|
-
[/^tab(?:-(
|
|
356
|
-
const v = utilities.handler.bracket.global.number(s || "4");
|
|
350
|
+
[/^tab(?:-(.+))?$/, ([, s]) => {
|
|
351
|
+
const v = utilities.handler.bracket.cssvar.global.number(s || "4");
|
|
357
352
|
if (v != null) {
|
|
358
353
|
return {
|
|
359
354
|
"-moz-tab-size": v,
|
|
@@ -364,7 +359,7 @@ const tabSizes = [
|
|
|
364
359
|
}]
|
|
365
360
|
];
|
|
366
361
|
const textIndents = [
|
|
367
|
-
[/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.fraction.
|
|
362
|
+
[/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.fraction.rem(s) })]
|
|
368
363
|
];
|
|
369
364
|
const textStrokes = [
|
|
370
365
|
[/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => ({ "-webkit-text-stroke-width": theme.textStrokeWidth?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.px(s) })],
|
|
@@ -392,7 +387,7 @@ const directions = {
|
|
|
392
387
|
"y": "row-"
|
|
393
388
|
};
|
|
394
389
|
const handleGap = ([, d = "", s]) => {
|
|
395
|
-
const v = utilities.handler.bracket.
|
|
390
|
+
const v = utilities.handler.bracket.cssvar.rem(s);
|
|
396
391
|
if (v != null) {
|
|
397
392
|
return {
|
|
398
393
|
[`grid-${directions[d]}gap`]: v,
|
|
@@ -418,12 +413,12 @@ const autoDirection = (selector, theme) => {
|
|
|
418
413
|
case "fr":
|
|
419
414
|
return "minmax(0,1fr)";
|
|
420
415
|
}
|
|
421
|
-
return utilities.handler.bracket.auto.rem(selector);
|
|
416
|
+
return utilities.handler.bracket.cssvar.auto.rem(selector);
|
|
422
417
|
};
|
|
423
418
|
const grids = [
|
|
424
419
|
["grid", { display: "grid" }],
|
|
425
420
|
["inline-grid", { display: "inline-grid" }],
|
|
426
|
-
[/^(?:grid-)?(row|col)-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}`]: utilities.handler.bracket.auto(v) })],
|
|
421
|
+
[/^(?:grid-)?(row|col)-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}`]: utilities.handler.bracket.cssvar.auto(v) })],
|
|
427
422
|
[/^(?:grid-)?(row|col)-span-(.+)$/, ([, c, s]) => {
|
|
428
423
|
if (s === "full")
|
|
429
424
|
return { [`grid-${rowCol(c)}`]: "1/-1" };
|
|
@@ -431,11 +426,12 @@ const grids = [
|
|
|
431
426
|
if (v != null)
|
|
432
427
|
return { [`grid-${rowCol(c)}`]: `span ${v}/span ${v}` };
|
|
433
428
|
}],
|
|
434
|
-
[/^(?:grid-)?(row|col)-start-(
|
|
435
|
-
[/^(?:grid-)?(row|col)-end-(
|
|
436
|
-
[/^(?:grid-)?auto-(rows|cols)-(
|
|
429
|
+
[/^(?:grid-)?(row|col)-start-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-start`]: utilities.handler.bracket.cssvar(v) ?? v })],
|
|
430
|
+
[/^(?:grid-)?(row|col)-end-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]: utilities.handler.bracket.cssvar(v) ?? v })],
|
|
431
|
+
[/^(?:grid-)?auto-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({ [`grid-auto-${rowCol(c)}`]: autoDirection(v, theme) })],
|
|
432
|
+
[/^(?:grid-auto-flow|auto-flow|grid-flow)-(.+)$/, ([, v]) => ({ "grid-auto-flow": utilities.handler.bracket.cssvar(v) })],
|
|
437
433
|
[/^(?:grid-auto-flow|auto-flow|grid-flow)-((?:row|col)(?:-dense)?)$/, ([, v]) => ({ "grid-auto-flow": rowCol(v).replace("-", " ") })],
|
|
438
|
-
[/^grid-(rows|cols)-(
|
|
434
|
+
[/^grid-(rows|cols)-(.+)$/, ([, c, v]) => ({ [`grid-template-${rowCol(c)}`]: utilities.handler.bracket.cssvar(v) })],
|
|
439
435
|
[/^grid-(rows|cols)-minmax-([\w.-]+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(auto-fill,minmax(${d},1fr))` })],
|
|
440
436
|
[/^grid-(rows|cols)-(\d+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(${d},minmax(0,1fr))` })],
|
|
441
437
|
["grid-rows-none", { "grid-template-rows": "none" }],
|
|
@@ -476,7 +472,7 @@ const justifies = [
|
|
|
476
472
|
["justify-self-stretch", { "justify-self": "stretch" }]
|
|
477
473
|
];
|
|
478
474
|
const orders = [
|
|
479
|
-
[/^order-(.+)$/, ([, v]) => ({ order: utilities.handler.bracket.number(v) })],
|
|
475
|
+
[/^order-(.+)$/, ([, v]) => ({ order: utilities.handler.bracket.cssvar.number(v) })],
|
|
480
476
|
["order-first", { order: "-9999" }],
|
|
481
477
|
["order-last", { order: "9999" }],
|
|
482
478
|
["order-none", { order: "0" }]
|
|
@@ -519,7 +515,7 @@ const placements = [
|
|
|
519
515
|
["place-self-stretch", { "place-self": "stretch" }]
|
|
520
516
|
];
|
|
521
517
|
function handleInsetValue(v) {
|
|
522
|
-
return utilities.handler.bracket.
|
|
518
|
+
return utilities.handler.bracket.cssvar.auto.fraction.rem(v);
|
|
523
519
|
}
|
|
524
520
|
function handleInsetValues([, d, v]) {
|
|
525
521
|
const r = handleInsetValue(v);
|
|
@@ -544,8 +540,8 @@ const floats = [
|
|
|
544
540
|
["clear-none", { clear: "none" }]
|
|
545
541
|
];
|
|
546
542
|
const zIndexes = [
|
|
547
|
-
[
|
|
548
|
-
[
|
|
543
|
+
[/^z-(.+)$/, ([, v]) => ({ "z-index": utilities.handler.bracket.cssvar.number(v) })],
|
|
544
|
+
["z-auto", { "z-index": "auto" }]
|
|
549
545
|
];
|
|
550
546
|
const boxSizing = [
|
|
551
547
|
["box-border", { "box-sizing": "border-box" }],
|
|
@@ -553,11 +549,12 @@ const boxSizing = [
|
|
|
553
549
|
];
|
|
554
550
|
|
|
555
551
|
const ringBase = {
|
|
552
|
+
...shadowBase,
|
|
556
553
|
"--un-ring-inset": varEmpty,
|
|
557
554
|
"--un-ring-offset-width": "0px",
|
|
558
555
|
"--un-ring-offset-color": "#fff",
|
|
559
|
-
"--un-ring-
|
|
560
|
-
|
|
556
|
+
"--un-ring-width": "0px",
|
|
557
|
+
"--un-ring-color": "rgba(147,197,253,0.5)"
|
|
561
558
|
};
|
|
562
559
|
const rings = [
|
|
563
560
|
[/^ring(?:-(.+))?$/, ([, d]) => {
|
|
@@ -566,15 +563,17 @@ const rings = [
|
|
|
566
563
|
return [
|
|
567
564
|
ringBase,
|
|
568
565
|
{
|
|
566
|
+
"--un-ring-width": value,
|
|
569
567
|
"--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)",
|
|
570
|
-
"--un-ring-shadow":
|
|
568
|
+
"--un-ring-shadow": "var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color)",
|
|
571
569
|
"box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow, 0 0 #0000)"
|
|
572
570
|
}
|
|
573
571
|
];
|
|
574
572
|
}
|
|
575
573
|
}],
|
|
574
|
+
[/^ring-(?:width-|size-)(.+)$/, ([, d]) => ({ "--un-ring-width": utilities.handler.bracket.cssvar.px(d) })],
|
|
576
575
|
["ring-offset", { "--un-ring-offset-width": "1px" }],
|
|
577
|
-
[/^ring-offset-(.+)$/, ([, d]) => ({ "--un-ring-offset-width": utilities.handler.px(d
|
|
576
|
+
[/^ring-offset-(?:width-|size-)?(.+)$/, ([, d]) => ({ "--un-ring-offset-width": utilities.handler.bracket.cssvar.px(d) })],
|
|
578
577
|
[/^ring-(.+)$/, utilities.colorResolver("--un-ring-color", "ring")],
|
|
579
578
|
[/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": utilities.handler.bracket.percent(opacity) })],
|
|
580
579
|
[/^ring-offset-(.+)$/, utilities.colorResolver("--un-ring-offset-color", "ring-offset")],
|
|
@@ -602,7 +601,7 @@ function getSizeValue(minmax, hw, theme, prop) {
|
|
|
602
601
|
case "min":
|
|
603
602
|
return `${prop}-content`;
|
|
604
603
|
}
|
|
605
|
-
return utilities.handler.bracket.cssvar.fraction.
|
|
604
|
+
return utilities.handler.bracket.cssvar.auto.fraction.rem(prop);
|
|
606
605
|
}
|
|
607
606
|
const sizes = [
|
|
608
607
|
[/^(min-|max-)?([wh])-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
|
|
@@ -628,14 +627,14 @@ const paddings = [
|
|
|
628
627
|
[/^pa?()-?(-?.+)$/, utilities.directionSize("padding")],
|
|
629
628
|
[/^p-?([xy])-?(-?.+)$/, utilities.directionSize("padding")],
|
|
630
629
|
[/^p-?([rltbse])-?(-?.+)$/, utilities.directionSize("padding")],
|
|
631
|
-
[/^p-(inline
|
|
630
|
+
[/^p-(block|inline)-(-?.+)$/, utilities.directionSize("padding")],
|
|
632
631
|
[/^p-?([bi][se])-?(-?.+)$/, utilities.directionSize("padding")]
|
|
633
632
|
];
|
|
634
633
|
const margins = [
|
|
635
634
|
[/^ma?()-?(-?.+)$/, utilities.directionSize("margin")],
|
|
636
635
|
[/^m-?([xy])-?(-?.+)$/, utilities.directionSize("margin")],
|
|
637
636
|
[/^m-?([rltbse])-?(-?.+)$/, utilities.directionSize("margin")],
|
|
638
|
-
[/^m-(inline
|
|
637
|
+
[/^m-(block|inline)-(-?.+)$/, utilities.directionSize("margin")],
|
|
639
638
|
[/^m-?([bi][se])-?(-?.+)$/, utilities.directionSize("margin")]
|
|
640
639
|
];
|
|
641
640
|
|
|
@@ -686,9 +685,9 @@ const transformBase = {
|
|
|
686
685
|
[core.CONTROL_SHORTCUT_NO_MERGE]: ""
|
|
687
686
|
};
|
|
688
687
|
const transforms = [
|
|
689
|
-
[/^origin-(
|
|
690
|
-
[/^perspect
|
|
691
|
-
const v = utilities.handler.px.numberWithUnit(s);
|
|
688
|
+
[/^(?:transform-)?origin-(.+)$/, ([, s]) => ({ "transform-origin": utilities.positionMap[s] ?? utilities.handler.bracket.cssvar(s) })],
|
|
689
|
+
[/^(?:transform-)?perspect(?:ive)?-(.+)$/, ([, s]) => {
|
|
690
|
+
const v = utilities.handler.bracket.cssvar.px.numberWithUnit(s);
|
|
692
691
|
if (v != null) {
|
|
693
692
|
return {
|
|
694
693
|
"-webkit-perspective": v,
|
|
@@ -696,8 +695,8 @@ const transforms = [
|
|
|
696
695
|
};
|
|
697
696
|
}
|
|
698
697
|
}],
|
|
699
|
-
[/^perspect
|
|
700
|
-
const v = utilities.handler.bracket(s) ?? (s.length >= 3 ? utilities.positionMap[s] : void 0);
|
|
698
|
+
[/^(?:transform-)?perspect(?:ive)?-origin-(.+)$/, ([, s]) => {
|
|
699
|
+
const v = utilities.handler.bracket.cssvar(s) ?? (s.length >= 3 ? utilities.positionMap[s] : void 0);
|
|
701
700
|
if (v != null) {
|
|
702
701
|
return {
|
|
703
702
|
"-webkit-perspective-origin": v,
|
|
@@ -705,16 +704,15 @@ const transforms = [
|
|
|
705
704
|
};
|
|
706
705
|
}
|
|
707
706
|
}],
|
|
708
|
-
[/^translate-()(.+)$/, handleTranslate],
|
|
709
|
-
[/^translate-([xyz])-(.+)$/, handleTranslate],
|
|
710
|
-
[/^rotate-()(.+)$/, handleRotate],
|
|
711
|
-
[/^rotate(
|
|
712
|
-
[/^skew-()(.+)$/, handleSkew],
|
|
713
|
-
[/^
|
|
714
|
-
[/^scale-()(.+)$/, handleScale],
|
|
715
|
-
[/^
|
|
716
|
-
[
|
|
717
|
-
["preserve-flat", { "transform-style": "flat" }],
|
|
707
|
+
[/^(?:transform-)?translate-()(.+)$/, handleTranslate],
|
|
708
|
+
[/^(?:transform-)?translate-([xyz])-(.+)$/, handleTranslate],
|
|
709
|
+
[/^(?:transform-)?rotate-()(.+)$/, handleRotate],
|
|
710
|
+
[/^(?:transform-)?rotate-([xyz])-(.+)$/, handleRotate],
|
|
711
|
+
[/^(?:transform-)?skew-([xy])-(.+)$/, handleSkew],
|
|
712
|
+
[/^(?:transform-)?scale-()(.+)$/, handleScale],
|
|
713
|
+
[/^(?:transform-)?scale-([xyz])-(.+)$/, handleScale],
|
|
714
|
+
[/^(?:transform-)?preserve-3d$/, () => ({ "transform-style": "preserve-3d" })],
|
|
715
|
+
[/^(?:transform-)?preserve-flat$/, () => ({ "transform-style": "flat" })],
|
|
718
716
|
[/^transform$/, () => [
|
|
719
717
|
transformBase,
|
|
720
718
|
{ transform: "var(--un-transform)" }
|
|
@@ -724,7 +722,7 @@ const transforms = [
|
|
|
724
722
|
["transform-none", { transform: "none" }]
|
|
725
723
|
];
|
|
726
724
|
function handleTranslate([, d, b]) {
|
|
727
|
-
const v = utilities.handler.bracket.fraction.
|
|
725
|
+
const v = utilities.handler.bracket.cssvar.fraction.rem(b);
|
|
728
726
|
if (v != null) {
|
|
729
727
|
return [
|
|
730
728
|
transformBase,
|
|
@@ -736,7 +734,7 @@ function handleTranslate([, d, b]) {
|
|
|
736
734
|
}
|
|
737
735
|
}
|
|
738
736
|
function handleScale([, d, b]) {
|
|
739
|
-
const v = utilities.handler.bracket.fraction.percent(b);
|
|
737
|
+
const v = utilities.handler.bracket.cssvar.fraction.percent(b);
|
|
740
738
|
if (v != null) {
|
|
741
739
|
return [
|
|
742
740
|
transformBase,
|
|
@@ -747,20 +745,34 @@ function handleScale([, d, b]) {
|
|
|
747
745
|
];
|
|
748
746
|
}
|
|
749
747
|
}
|
|
750
|
-
function handleRotate([, d, b]) {
|
|
751
|
-
const v = utilities.handler.bracket.degree(b);
|
|
748
|
+
function handleRotate([, d = "", b]) {
|
|
749
|
+
const v = utilities.handler.bracket.cssvar.degree(b);
|
|
752
750
|
if (v != null) {
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
751
|
+
if (d) {
|
|
752
|
+
return [
|
|
753
|
+
transformBase,
|
|
754
|
+
{
|
|
755
|
+
"--un-rotate": 0,
|
|
756
|
+
[`--un-rotate-${d}`]: v,
|
|
757
|
+
"transform": "var(--un-transform)"
|
|
758
|
+
}
|
|
759
|
+
];
|
|
760
|
+
} else {
|
|
761
|
+
return [
|
|
762
|
+
transformBase,
|
|
763
|
+
{
|
|
764
|
+
"--un-rotate-x": 0,
|
|
765
|
+
"--un-rotate-y": 0,
|
|
766
|
+
"--un-rotate-z": 0,
|
|
767
|
+
"--un-rotate": v,
|
|
768
|
+
"transform": "var(--un-transform)"
|
|
769
|
+
}
|
|
770
|
+
];
|
|
771
|
+
}
|
|
760
772
|
}
|
|
761
773
|
}
|
|
762
774
|
function handleSkew([, d, b]) {
|
|
763
|
-
const v = utilities.handler.bracket.degree(b);
|
|
775
|
+
const v = utilities.handler.bracket.cssvar.degree(b);
|
|
764
776
|
if (v != null) {
|
|
765
777
|
return [
|
|
766
778
|
transformBase,
|
|
@@ -773,38 +785,30 @@ function handleSkew([, d, b]) {
|
|
|
773
785
|
}
|
|
774
786
|
|
|
775
787
|
const variablesAbbrMap = {
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
"auto-flow": "grid-auto-flow",
|
|
791
|
-
"row-start": "grid-row-start",
|
|
792
|
-
"row-end": "grid-row-end",
|
|
793
|
-
"justify": "justify-content",
|
|
794
|
-
"content": "align-content",
|
|
795
|
-
"items": "align-items",
|
|
796
|
-
"self": "align-self",
|
|
797
|
-
"object": "object-fit"
|
|
788
|
+
backface: "backface-visibility",
|
|
789
|
+
break: "word-break",
|
|
790
|
+
case: "text-transform",
|
|
791
|
+
content: "align-content",
|
|
792
|
+
flex: "flex",
|
|
793
|
+
fw: "font-weight",
|
|
794
|
+
items: "align-items",
|
|
795
|
+
justify: "justify-content",
|
|
796
|
+
select: "user-select",
|
|
797
|
+
self: "align-self",
|
|
798
|
+
vertical: "vertical-align",
|
|
799
|
+
visible: "visibility",
|
|
800
|
+
whitespace: "white-space",
|
|
801
|
+
ws: "white-space"
|
|
798
802
|
};
|
|
799
803
|
const cssVariables = [
|
|
800
|
-
[/^(
|
|
804
|
+
[/^(.+?)-(\$.+)$/, ([, name, varname]) => {
|
|
801
805
|
const prop = variablesAbbrMap[name];
|
|
802
806
|
if (prop)
|
|
803
|
-
return { [prop]:
|
|
807
|
+
return { [prop]: utilities.handler.cssvar(varname) };
|
|
804
808
|
}]
|
|
805
809
|
];
|
|
806
810
|
const cssProperty = [
|
|
807
|
-
[/^\[(
|
|
811
|
+
[/^\[([^:]+):(.+)\]$/, ([, prop, value]) => ({ [prop]: utilities.handler.bracket(`[${value}]`) })]
|
|
808
812
|
];
|
|
809
813
|
|
|
810
814
|
const questionMark = [
|
|
@@ -824,7 +828,7 @@ const textDecorations = [
|
|
|
824
828
|
["line-through", { "text-decoration-line": "line-through" }],
|
|
825
829
|
["decoration-underline", { "text-decoration-line": "underline" }],
|
|
826
830
|
["decoration-line-through", { "text-decoration-line": "line-through" }],
|
|
827
|
-
[/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s]) => ({ "text-decoration-thickness": utilities.handler.bracket.px(s) })],
|
|
831
|
+
[/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s]) => ({ "text-decoration-thickness": utilities.handler.bracket.cssvar.px(s) })],
|
|
828
832
|
[/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s })],
|
|
829
833
|
[/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
|
|
830
834
|
const result = utilities.colorResolver("text-decoration-color", "line")(match, ctx);
|
|
@@ -836,7 +840,7 @@ const textDecorations = [
|
|
|
836
840
|
}
|
|
837
841
|
}],
|
|
838
842
|
[/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": utilities.handler.bracket.percent(opacity) })],
|
|
839
|
-
[/^underline-offset-(.+)$/, ([, s]) => ({ "text-underline-offset": utilities.handler.auto.bracket.px(s) })],
|
|
843
|
+
[/^(?:underline|decoration)-offset-(.+)$/, ([, s]) => ({ "text-underline-offset": utilities.handler.auto.bracket.cssvar.px(s) })],
|
|
840
844
|
[/^(?:underline|decoration)-(solid|double|dotted|dashed|wavy|inherit|initial|revert|unset)$/, ([, d]) => ({ "text-decoration-style": d })],
|
|
841
845
|
["no-underline", { "text-decoration": "none" }],
|
|
842
846
|
["decoration-none", { "text-decoration": "none" }]
|
|
@@ -846,9 +850,9 @@ const svgUtilities = [
|
|
|
846
850
|
[/^fill-(.+)$/, utilities.colorResolver("fill", "fill")],
|
|
847
851
|
[/^fill-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-fill-opacity": utilities.handler.bracket.percent(opacity) })],
|
|
848
852
|
["fill-none", { fill: "none" }],
|
|
849
|
-
[/^stroke-(?:width-|size-)?(.+)$/, ([, s]) => ({ "stroke-width": utilities.handler.bracket.fraction.px.number(s) })],
|
|
850
|
-
[/^stroke-dash-(.+)$/, ([, s]) => ({ "stroke-dasharray": utilities.handler.bracket.number(s) })],
|
|
851
|
-
[/^stroke-offset-(.+)$/, ([, s]) => ({ "stroke-dashoffset": utilities.handler.bracket.px.numberWithUnit(s) })],
|
|
853
|
+
[/^stroke-(?:width-|size-)?(.+)$/, ([, s]) => ({ "stroke-width": utilities.handler.bracket.cssvar.fraction.px.number(s) })],
|
|
854
|
+
[/^stroke-dash-(.+)$/, ([, s]) => ({ "stroke-dasharray": utilities.handler.bracket.cssvar.number(s) })],
|
|
855
|
+
[/^stroke-offset-(.+)$/, ([, s]) => ({ "stroke-dashoffset": utilities.handler.bracket.cssvar.px.numberWithUnit(s) })],
|
|
852
856
|
[/^stroke-(.+)$/, utilities.colorResolver("stroke", "stroke")],
|
|
853
857
|
[/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity": utilities.handler.bracket.percent(opacity) })],
|
|
854
858
|
["stroke-cap-square", { "stroke-linecap": "square" }],
|