@unocss/preset-mini 0.22.0 → 0.22.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.
- package/dist/chunks/default.cjs +25 -19
- package/dist/chunks/default.mjs +25 -19
- package/dist/chunks/default2.cjs +289 -203
- package/dist/chunks/default2.mjs +289 -206
- package/dist/chunks/default3.cjs +15 -26
- package/dist/chunks/default3.mjs +16 -26
- package/dist/chunks/utilities.cjs +36 -11
- package/dist/chunks/utilities.mjs +36 -11
- package/dist/{colors-6d634692.d.ts → colors-338f482c.d.ts} +1 -1
- package/dist/colors.d.ts +2 -2
- package/dist/{default-958434b6.d.ts → default-17948303.d.ts} +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/rules.cjs +3 -0
- package/dist/rules.d.ts +11 -2
- package/dist/rules.mjs +1 -1
- package/dist/theme.d.ts +8 -8
- package/dist/{types-a2d2b52f.d.ts → types-c14b808b.d.ts} +8 -2
- package/dist/{utilities-22a522e2.d.ts → utilities-29b01158.d.ts} +2 -3
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.ts +4 -3
- 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/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.fraction.
|
|
22
|
+
[/^outline-(?:width-|size-)?(.+)$/, ([, d]) => ({ "outline-width": utilities.handler.bracket.cssvar.fraction.rem(d) })],
|
|
23
23
|
[/^outline-(?:color-)?(.+)$/, utilities.colorResolver("outline-color", "outline-color")],
|
|
24
|
-
[/^outline-offset-(.+)$/, ([, d]) => ({ "outline-offset": utilities.handler.bracket.fraction.
|
|
24
|
+
[/^outline-offset-(.+)$/, ([, d]) => ({ "outline-offset": utilities.handler.bracket.cssvar.fraction.rem(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" }]
|
|
@@ -46,19 +46,28 @@ const borders = [
|
|
|
46
46
|
[/^(?:border|b)()(?:-(.+))?$/, handlerBorder],
|
|
47
47
|
[/^(?:border|b)-([xy])(?:-(.+))?$/, handlerBorder],
|
|
48
48
|
[/^(?:border|b)-([rltbse])(?:-(.+))?$/, handlerBorder],
|
|
49
|
-
[/^(?:border|b)-()
|
|
50
|
-
[/^(?:border|b)-([
|
|
51
|
-
[/^(?:border|b)-(
|
|
49
|
+
[/^(?:border|b)-(block|inline)(?:-(.+))?$/, handlerBorder],
|
|
50
|
+
[/^(?:border|b)-([bi][se])(?:-(.+))?$/, handlerBorder],
|
|
51
|
+
[/^(?:border|b)-()(?:width|size)-(.+)$/, handlerBorderSize],
|
|
52
|
+
[/^(?:border|b)-([xy])-(?:width|size)-(.+)$/, handlerBorderSize],
|
|
53
|
+
[/^(?:border|b)-([rltbse])-(?:width|size)-(.+)$/, handlerBorderSize],
|
|
54
|
+
[/^(?:border|b)-(block|inline)-(?:width|size)-(.+)$/, handlerBorderSize],
|
|
55
|
+
[/^(?:border|b)-([bi][se])-(?:width|size)-(.+)$/, handlerBorderSize],
|
|
52
56
|
[/^(?:border|b)-()(?:color-)?(.+)$/, handlerBorderColor],
|
|
53
57
|
[/^(?:border|b)-([xy])-(?:color-)?(.+)$/, handlerBorderColor],
|
|
54
58
|
[/^(?:border|b)-([rltbse])-(?:color-)?(.+)$/, handlerBorderColor],
|
|
59
|
+
[/^(?:border|b)-(block|inline)-(?:color-)?(.+)$/, handlerBorderColor],
|
|
60
|
+
[/^(?:border|b)-([bi][se])-(?:color-)?(.+)$/, handlerBorderColor],
|
|
55
61
|
[/^(?:border|b)-()op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
56
62
|
[/^(?:border|b)-([xy])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
57
63
|
[/^(?:border|b)-([rltbse])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
64
|
+
[/^(?:border|b)-(block|inline)-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
65
|
+
[/^(?:border|b)-([bi][se])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
58
66
|
[/^(?:border-)?(?:rounded|rd)()(?:-(.+))?$/, handlerRounded],
|
|
59
|
-
[/^(?:border-)?(?:rounded|rd)-([xy])(?:-(.+))?$/, handlerRounded],
|
|
60
67
|
[/^(?:border-)?(?:rounded|rd)-([rltb])(?:-(.+))?$/, handlerRounded],
|
|
61
68
|
[/^(?:border-)?(?:rounded|rd)-([rltb]{2})(?:-(.+))?$/, handlerRounded],
|
|
69
|
+
[/^(?:border-)?(?:rounded|rd)-([bi][se])(?:-(.+))?$/, handlerRounded],
|
|
70
|
+
[/^(?:border-)?(?:rounded|rd)-([bi][se]-[bi][se])(?:-(.+))?$/, handlerRounded],
|
|
62
71
|
["border-solid", { "border-style": "solid" }],
|
|
63
72
|
["border-dashed", { "border-style": "dashed" }],
|
|
64
73
|
["border-dotted", { "border-style": "dotted" }],
|
|
@@ -111,7 +120,7 @@ function handlerBorder(m) {
|
|
|
111
120
|
}
|
|
112
121
|
}
|
|
113
122
|
function handlerBorderSize([, a = "", b = "1"]) {
|
|
114
|
-
const v = utilities.handler.bracket.px(b);
|
|
123
|
+
const v = utilities.handler.bracket.cssvar.px(b);
|
|
115
124
|
if (a in utilities.directionMap && v != null)
|
|
116
125
|
return utilities.directionMap[a].map((i) => [`border${i}-width`, v]);
|
|
117
126
|
}
|
|
@@ -126,7 +135,7 @@ function handlerBorderOpacity([, a = "", opacity]) {
|
|
|
126
135
|
return utilities.directionMap[a].map((i) => [`--un-border${i}-opacity`, v]);
|
|
127
136
|
}
|
|
128
137
|
function handlerRounded([, a = "", s = "DEFAULT"], { theme }) {
|
|
129
|
-
const v = theme.borderRadius?.[s] || utilities.handler.
|
|
138
|
+
const v = theme.borderRadius?.[s] || utilities.handler.bracket.cssvar.fraction.rem(s);
|
|
130
139
|
if (a in utilities.cornerMap && v != null)
|
|
131
140
|
return utilities.cornerMap[a].map((i) => [`border${i}-radius`, v]);
|
|
132
141
|
}
|
|
@@ -136,7 +145,7 @@ const opacity = [
|
|
|
136
145
|
];
|
|
137
146
|
const textColors = [
|
|
138
147
|
[/^(?:text|color|c)-(.+)$/, utilities.colorResolver("color", "text")],
|
|
139
|
-
[/^(?: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) })]
|
|
140
149
|
];
|
|
141
150
|
const bgColors = [
|
|
142
151
|
[/^bg-(.+)$/, utilities.colorResolver("background-color", "bg")],
|
|
@@ -164,9 +173,9 @@ const transitions = [
|
|
|
164
173
|
};
|
|
165
174
|
}
|
|
166
175
|
}],
|
|
167
|
-
[/^(?:transition-)?
|
|
168
|
-
[/^(?:transition-)?
|
|
169
|
-
[/^ease-(.+)$/, ([, d]) => ({ "transition-timing-function": utilities.handler.bracket(d) })],
|
|
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
|
+
[/^ease-(.+)$/, ([, d]) => ({ "transition-timing-function": utilities.handler.bracket.cssvar(d) })],
|
|
170
179
|
["ease", { "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)" }],
|
|
171
180
|
["ease-linear", { "transition-timing-function": "linear" }],
|
|
172
181
|
["ease-in", { "transition-timing-function": "cubic-bezier(0.4, 0, 1, 1)" }],
|
|
@@ -191,7 +200,7 @@ const flex = [
|
|
|
191
200
|
[/^(?:flex-)?shrink-0$/, () => ({ "flex-shrink": 0 })],
|
|
192
201
|
[/^(?:flex-)?grow$/, () => ({ "flex-grow": 1 })],
|
|
193
202
|
[/^(?:flex-)?grow-0$/, () => ({ "flex-grow": 0 })],
|
|
194
|
-
[/^(?:flex-)?basis-(.+)$/, ([, d]) => ({ "flex-basis": utilities.handler.bracket.
|
|
203
|
+
[/^(?:flex-)?basis-(.+)$/, ([, d]) => ({ "flex-basis": utilities.handler.bracket.cssvar.auto.fraction.rem(d) })],
|
|
195
204
|
["flex-row", { "flex-direction": "row" }],
|
|
196
205
|
["flex-row-reverse", { "flex-direction": "row-reverse" }],
|
|
197
206
|
["flex-col", { "flex-direction": "column" }],
|
|
@@ -201,6 +210,117 @@ const flex = [
|
|
|
201
210
|
["flex-nowrap", { "flex-wrap": "nowrap" }]
|
|
202
211
|
];
|
|
203
212
|
|
|
213
|
+
const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
|
|
214
|
+
const displays = [
|
|
215
|
+
["inline", { display: "inline" }],
|
|
216
|
+
["block", { display: "block" }],
|
|
217
|
+
["inline-block", { display: "inline-block" }],
|
|
218
|
+
["contents", { display: "contents" }],
|
|
219
|
+
["flow-root", { display: "flow-root" }],
|
|
220
|
+
["list-item", { display: "list-item" }],
|
|
221
|
+
["hidden", { display: "none" }]
|
|
222
|
+
];
|
|
223
|
+
const appearances = [
|
|
224
|
+
["visible", { visibility: "visible" }],
|
|
225
|
+
["invisible", { visibility: "hidden" }],
|
|
226
|
+
["backface-visible", { "backface-visibility": "visible" }],
|
|
227
|
+
["backface-hidden", { "backface-visibility": "hidden" }]
|
|
228
|
+
];
|
|
229
|
+
const cursors = [
|
|
230
|
+
[/^cursor-(.+)$/, ([, c]) => ({ cursor: utilities.handler.bracket.cssvar(c) || c })]
|
|
231
|
+
];
|
|
232
|
+
const pointerEvents = [
|
|
233
|
+
["pointer-events-auto", { "pointer-events": "auto" }],
|
|
234
|
+
["pointer-events-none", { "pointer-events": "none" }]
|
|
235
|
+
];
|
|
236
|
+
const resizes = [
|
|
237
|
+
["resize-x", { resize: "horizontal" }],
|
|
238
|
+
["resize-y", { resize: "vertical" }],
|
|
239
|
+
["resize", { resize: "both" }],
|
|
240
|
+
["resize-none", { resize: "none" }]
|
|
241
|
+
];
|
|
242
|
+
const userSelects = [
|
|
243
|
+
["select-auto", { "user-select": "auto" }],
|
|
244
|
+
["select-all", { "user-select": "all" }],
|
|
245
|
+
["select-text", { "user-select": "text" }],
|
|
246
|
+
["select-none", { "user-select": "none" }]
|
|
247
|
+
];
|
|
248
|
+
const whitespaces = [
|
|
249
|
+
[/^(?:whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap)$/, ([, v]) => ({ "white-space": v })]
|
|
250
|
+
];
|
|
251
|
+
const contents = [
|
|
252
|
+
["content-empty", { content: '""' }],
|
|
253
|
+
["content-none", { content: '""' }]
|
|
254
|
+
];
|
|
255
|
+
const breaks = [
|
|
256
|
+
["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }],
|
|
257
|
+
["break-words", { "overflow-wrap": "break-word" }],
|
|
258
|
+
["break-all", { "word-break": "break-all" }]
|
|
259
|
+
];
|
|
260
|
+
const textOverflows = [
|
|
261
|
+
["truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
|
|
262
|
+
["text-ellipsis", { "text-overflow": "ellipsis" }],
|
|
263
|
+
["text-clip", { "text-overflow": "clip" }]
|
|
264
|
+
];
|
|
265
|
+
const textTransforms = [
|
|
266
|
+
["case-upper", { "text-transform": "uppercase" }],
|
|
267
|
+
["case-lower", { "text-transform": "lowercase" }],
|
|
268
|
+
["case-capital", { "text-transform": "capitalize" }],
|
|
269
|
+
["case-normal", { "text-transform": "none" }]
|
|
270
|
+
];
|
|
271
|
+
const fontStyles = [
|
|
272
|
+
["italic", { "font-style": "italic" }],
|
|
273
|
+
["not-italic", { "font-style": "normal" }]
|
|
274
|
+
];
|
|
275
|
+
const fontSmoothings = [
|
|
276
|
+
["antialiased", {
|
|
277
|
+
"-webkit-font-smoothing": "antialiased",
|
|
278
|
+
"-moz-osx-font-smoothing": "grayscale",
|
|
279
|
+
"font-smoothing": "grayscale"
|
|
280
|
+
}],
|
|
281
|
+
["subpixel-antialiased", {
|
|
282
|
+
"-webkit-font-smoothing": "auto",
|
|
283
|
+
"-moz-osx-font-smoothing": "auto",
|
|
284
|
+
"font-smoothing": "auto"
|
|
285
|
+
}]
|
|
286
|
+
];
|
|
287
|
+
|
|
288
|
+
const shadowBase = {
|
|
289
|
+
[core.CONTROL_SHORTCUT_NO_MERGE]: "",
|
|
290
|
+
"--un-ring-offset-shadow": "0 0 #0000",
|
|
291
|
+
"--un-ring-shadow": "0 0 #0000",
|
|
292
|
+
"--un-shadow-inset": varEmpty,
|
|
293
|
+
"--un-shadow": "0 0 #0000"
|
|
294
|
+
};
|
|
295
|
+
const colorableShadows = (shadows, colorVar) => {
|
|
296
|
+
const colored = [];
|
|
297
|
+
shadows = core.toArray(shadows);
|
|
298
|
+
for (let i = 0; i < shadows.length; i++) {
|
|
299
|
+
const [size, color] = shadows[i].split(/\s(\S+)$/);
|
|
300
|
+
if (color.split("(").length !== color.split(")").length)
|
|
301
|
+
return shadows;
|
|
302
|
+
colored.push(`${size} var(${colorVar}, ${color})`);
|
|
303
|
+
}
|
|
304
|
+
return colored;
|
|
305
|
+
};
|
|
306
|
+
const boxShadows = [
|
|
307
|
+
[/^shadow(?:-(.+))?$/, ([, d], { theme }) => {
|
|
308
|
+
const v = theme.boxShadow?.[d || "DEFAULT"];
|
|
309
|
+
if (v) {
|
|
310
|
+
return [
|
|
311
|
+
shadowBase,
|
|
312
|
+
{
|
|
313
|
+
"--un-shadow": colorableShadows(v, "--un-shadow-color").join(","),
|
|
314
|
+
"box-shadow": "var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow)"
|
|
315
|
+
}
|
|
316
|
+
];
|
|
317
|
+
}
|
|
318
|
+
}],
|
|
319
|
+
[/^shadow-(.+)$/, utilities.colorResolver("--un-shadow-color", "shadow")],
|
|
320
|
+
[/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": utilities.handler.bracket.percent(opacity) })],
|
|
321
|
+
["shadow-inset", { "--un-shadow-inset": "inset" }]
|
|
322
|
+
];
|
|
323
|
+
|
|
204
324
|
const weightMap = {
|
|
205
325
|
thin: "100",
|
|
206
326
|
extralight: "200",
|
|
@@ -223,17 +343,17 @@ const fonts = [
|
|
|
223
343
|
"line-height": height
|
|
224
344
|
};
|
|
225
345
|
}
|
|
226
|
-
return { "font-size": utilities.handler.bracket.
|
|
346
|
+
return { "font-size": utilities.handler.bracket.rem(s) };
|
|
227
347
|
}],
|
|
228
|
-
[/^text-size-(.+)$/, ([, s]) => ({ "font-size": utilities.handler.bracket.
|
|
348
|
+
[/^text-size-(.+)$/, ([, s]) => ({ "font-size": utilities.handler.bracket.cssvar.rem(s) })],
|
|
229
349
|
[/^(?:font|fw)-?([^-]+)$/, ([, s]) => ({ "font-weight": weightMap[s] || utilities.handler.number(s) })],
|
|
230
|
-
[/^(?:leading|lh)-([^-]+)$/, ([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] || utilities.handler.bracket.
|
|
231
|
-
[/^tracking-([^-]+)$/, ([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || utilities.handler.bracket.
|
|
232
|
-
[/^word-spacing-([^-]+)$/, ([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] || utilities.handler.bracket.
|
|
350
|
+
[/^(?:leading|lh)-([^-]+)$/, ([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] || utilities.handler.bracket.rem(s) })],
|
|
351
|
+
[/^tracking-([^-]+)$/, ([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || utilities.handler.bracket.rem(s) })],
|
|
352
|
+
[/^word-spacing-([^-]+)$/, ([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] || utilities.handler.bracket.rem(s) })]
|
|
233
353
|
];
|
|
234
354
|
const tabSizes = [
|
|
235
|
-
[/^tab(?:-(
|
|
236
|
-
const v = utilities.handler.bracket.global.number(s || "4");
|
|
355
|
+
[/^tab(?:-(.+))?$/, ([, s]) => {
|
|
356
|
+
const v = utilities.handler.bracket.cssvar.global.number(s || "4");
|
|
237
357
|
if (v != null) {
|
|
238
358
|
return {
|
|
239
359
|
"-moz-tab-size": v,
|
|
@@ -244,7 +364,7 @@ const tabSizes = [
|
|
|
244
364
|
}]
|
|
245
365
|
];
|
|
246
366
|
const textIndents = [
|
|
247
|
-
[/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.fraction.
|
|
367
|
+
[/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.fraction.rem(s) })]
|
|
248
368
|
];
|
|
249
369
|
const textStrokes = [
|
|
250
370
|
[/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => ({ "-webkit-text-stroke-width": theme.textStrokeWidth?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.px(s) })],
|
|
@@ -252,7 +372,18 @@ const textStrokes = [
|
|
|
252
372
|
[/^text-stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-stroke-opacity": utilities.handler.bracket.percent(opacity) })]
|
|
253
373
|
];
|
|
254
374
|
const textShadows = [
|
|
255
|
-
[/^text-shadow(?:-(.+))?$/, ([, s], { theme }) =>
|
|
375
|
+
[/^text-shadow(?:-(.+))?$/, ([, s], { theme }) => {
|
|
376
|
+
const v = theme.textShadow?.[s || "DEFAULT"];
|
|
377
|
+
if (v != null) {
|
|
378
|
+
return {
|
|
379
|
+
"--un-text-shadow": colorableShadows(v, "--un-text-shadow-color").join(","),
|
|
380
|
+
"text-shadow": "var(--un-text-shadow)"
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
return { "text-shadow": utilities.handler.bracket.cssvar(s) };
|
|
384
|
+
}],
|
|
385
|
+
[/^text-shadow-color-(.+)$/, utilities.colorResolver("--un-text-shadow-color", "text-shadow")],
|
|
386
|
+
[/^text-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-shadow-opacity": utilities.handler.bracket.percent(opacity) })]
|
|
256
387
|
];
|
|
257
388
|
|
|
258
389
|
const directions = {
|
|
@@ -261,7 +392,7 @@ const directions = {
|
|
|
261
392
|
"y": "row-"
|
|
262
393
|
};
|
|
263
394
|
const handleGap = ([, d = "", s]) => {
|
|
264
|
-
const v = utilities.handler.bracket.
|
|
395
|
+
const v = utilities.handler.bracket.cssvar.rem(s);
|
|
265
396
|
if (v != null) {
|
|
266
397
|
return {
|
|
267
398
|
[`grid-${directions[d]}gap`]: v,
|
|
@@ -287,12 +418,12 @@ const autoDirection = (selector, theme) => {
|
|
|
287
418
|
case "fr":
|
|
288
419
|
return "minmax(0,1fr)";
|
|
289
420
|
}
|
|
290
|
-
return utilities.handler.bracket.auto.rem(selector);
|
|
421
|
+
return utilities.handler.bracket.cssvar.auto.rem(selector);
|
|
291
422
|
};
|
|
292
423
|
const grids = [
|
|
293
424
|
["grid", { display: "grid" }],
|
|
294
425
|
["inline-grid", { display: "inline-grid" }],
|
|
295
|
-
[/^(?:grid-)?(row|col)-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}`]: utilities.handler.bracket.auto(v) })],
|
|
426
|
+
[/^(?:grid-)?(row|col)-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}`]: utilities.handler.bracket.cssvar.auto(v) })],
|
|
296
427
|
[/^(?:grid-)?(row|col)-span-(.+)$/, ([, c, s]) => {
|
|
297
428
|
if (s === "full")
|
|
298
429
|
return { [`grid-${rowCol(c)}`]: "1/-1" };
|
|
@@ -300,11 +431,12 @@ const grids = [
|
|
|
300
431
|
if (v != null)
|
|
301
432
|
return { [`grid-${rowCol(c)}`]: `span ${v}/span ${v}` };
|
|
302
433
|
}],
|
|
303
|
-
[/^(?:grid-)?(row|col)-start-(
|
|
304
|
-
[/^(?:grid-)?(row|col)-end-(
|
|
305
|
-
[/^(?:grid-)?auto-(rows|cols)-(
|
|
434
|
+
[/^(?:grid-)?(row|col)-start-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-start`]: utilities.handler.bracket.cssvar(v) ?? v })],
|
|
435
|
+
[/^(?:grid-)?(row|col)-end-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]: utilities.handler.bracket.cssvar(v) ?? v })],
|
|
436
|
+
[/^(?:grid-)?auto-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({ [`grid-auto-${rowCol(c)}`]: autoDirection(v, theme) })],
|
|
437
|
+
[/^(?:grid-auto-flow|auto-flow|grid-flow)-(.+)$/, ([, v]) => ({ "grid-auto-flow": utilities.handler.bracket.cssvar(v) })],
|
|
306
438
|
[/^(?:grid-auto-flow|auto-flow|grid-flow)-((?:row|col)(?:-dense)?)$/, ([, v]) => ({ "grid-auto-flow": rowCol(v).replace("-", " ") })],
|
|
307
|
-
[/^grid-(rows|cols)-(
|
|
439
|
+
[/^grid-(rows|cols)-(.+)$/, ([, c, v]) => ({ [`grid-template-${rowCol(c)}`]: utilities.handler.bracket.cssvar(v) })],
|
|
308
440
|
[/^grid-(rows|cols)-minmax-([\w.-]+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(auto-fill,minmax(${d},1fr))` })],
|
|
309
441
|
[/^grid-(rows|cols)-(\d+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(${d},minmax(0,1fr))` })],
|
|
310
442
|
["grid-rows-none", { "grid-template-rows": "none" }],
|
|
@@ -345,7 +477,7 @@ const justifies = [
|
|
|
345
477
|
["justify-self-stretch", { "justify-self": "stretch" }]
|
|
346
478
|
];
|
|
347
479
|
const orders = [
|
|
348
|
-
[/^order-(.+)$/, ([, v]) => ({ order: utilities.handler.bracket.number(v) })],
|
|
480
|
+
[/^order-(.+)$/, ([, v]) => ({ order: utilities.handler.bracket.cssvar.number(v) })],
|
|
349
481
|
["order-first", { order: "-9999" }],
|
|
350
482
|
["order-last", { order: "9999" }],
|
|
351
483
|
["order-none", { order: "0" }]
|
|
@@ -388,16 +520,19 @@ const placements = [
|
|
|
388
520
|
["place-self-stretch", { "place-self": "stretch" }]
|
|
389
521
|
];
|
|
390
522
|
function handleInsetValue(v) {
|
|
391
|
-
return
|
|
523
|
+
return utilities.handler.bracket.cssvar.auto.fraction.rem(v);
|
|
392
524
|
}
|
|
393
525
|
function handleInsetValues([, d, v]) {
|
|
394
526
|
const r = handleInsetValue(v);
|
|
395
|
-
if (r != null && d in utilities.
|
|
396
|
-
return utilities.
|
|
527
|
+
if (r != null && d in utilities.insetMap)
|
|
528
|
+
return utilities.insetMap[d].map((i) => [i.slice(1), r]);
|
|
397
529
|
}
|
|
398
530
|
const insets = [
|
|
399
531
|
[/^(?:position-|pos-)?inset-(.+)$/, ([, v]) => ({ inset: handleInsetValue(v) })],
|
|
400
532
|
[/^(?:position-|pos-)?inset-([xy])-(.+)$/, handleInsetValues],
|
|
533
|
+
[/^(?:position-|pos-)?inset-([rltbse])-(.+)$/, handleInsetValues],
|
|
534
|
+
[/^(?:position-|pos-)?inset-(block|inline)-(.+)$/, handleInsetValues],
|
|
535
|
+
[/^(?:position-|pos-)?inset-([bi][se])-(.+)$/, handleInsetValues],
|
|
401
536
|
[/^(?:position-|pos-)?(top|left|right|bottom)-(.+)$/, ([, d, v]) => ({ [d]: handleInsetValue(v) })]
|
|
402
537
|
];
|
|
403
538
|
const floats = [
|
|
@@ -410,106 +545,37 @@ const floats = [
|
|
|
410
545
|
["clear-none", { clear: "none" }]
|
|
411
546
|
];
|
|
412
547
|
const zIndexes = [
|
|
413
|
-
[
|
|
414
|
-
[
|
|
548
|
+
[/^z-(.+)$/, ([, v]) => ({ "z-index": utilities.handler.bracket.cssvar.number(v) })],
|
|
549
|
+
["z-auto", { "z-index": "auto" }]
|
|
415
550
|
];
|
|
416
551
|
const boxSizing = [
|
|
417
552
|
["box-border", { "box-sizing": "border-box" }],
|
|
418
553
|
["box-content", { "box-sizing": "content-box" }]
|
|
419
554
|
];
|
|
420
555
|
|
|
421
|
-
const
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
["list-item", { display: "list-item" }],
|
|
429
|
-
["hidden", { display: "none" }]
|
|
430
|
-
];
|
|
431
|
-
const appearances = [
|
|
432
|
-
["visible", { visibility: "visible" }],
|
|
433
|
-
["invisible", { visibility: "hidden" }],
|
|
434
|
-
["backface-visible", { "backface-visibility": "visible" }],
|
|
435
|
-
["backface-hidden", { "backface-visibility": "hidden" }]
|
|
436
|
-
];
|
|
437
|
-
const cursors = [
|
|
438
|
-
[/^cursor-(.+)$/, ([, c]) => ({ cursor: c })]
|
|
439
|
-
];
|
|
440
|
-
const pointerEvents = [
|
|
441
|
-
["pointer-events-auto", { "pointer-events": "auto" }],
|
|
442
|
-
["pointer-events-none", { "pointer-events": "none" }]
|
|
443
|
-
];
|
|
444
|
-
const resizes = [
|
|
445
|
-
["resize-x", { resize: "horizontal" }],
|
|
446
|
-
["resize-y", { resize: "vertical" }],
|
|
447
|
-
["resize", { resize: "both" }],
|
|
448
|
-
["resize-none", { resize: "none" }]
|
|
449
|
-
];
|
|
450
|
-
const userSelects = [
|
|
451
|
-
["select-auto", { "user-select": "auto" }],
|
|
452
|
-
["select-all", { "user-select": "all" }],
|
|
453
|
-
["select-text", { "user-select": "text" }],
|
|
454
|
-
["select-none", { "user-select": "none" }]
|
|
455
|
-
];
|
|
456
|
-
const whitespaces = [
|
|
457
|
-
[/^(?:whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap)$/, ([, v]) => ({ "white-space": v })]
|
|
458
|
-
];
|
|
459
|
-
const contents = [
|
|
460
|
-
["content-empty", { content: '""' }],
|
|
461
|
-
["content-none", { content: '""' }]
|
|
462
|
-
];
|
|
463
|
-
const breaks = [
|
|
464
|
-
["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }],
|
|
465
|
-
["break-words", { "overflow-wrap": "break-word" }],
|
|
466
|
-
["break-all", { "word-break": "break-all" }]
|
|
467
|
-
];
|
|
468
|
-
const textOverflows = [
|
|
469
|
-
["truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
|
|
470
|
-
["text-ellipsis", { "text-overflow": "ellipsis" }],
|
|
471
|
-
["text-clip", { "text-overflow": "clip" }]
|
|
472
|
-
];
|
|
473
|
-
const textTransforms = [
|
|
474
|
-
["case-upper", { "text-transform": "uppercase" }],
|
|
475
|
-
["case-lower", { "text-transform": "lowercase" }],
|
|
476
|
-
["case-capital", { "text-transform": "capitalize" }],
|
|
477
|
-
["case-normal", { "text-transform": "none" }]
|
|
478
|
-
];
|
|
479
|
-
const fontStyles = [
|
|
480
|
-
["italic", { "font-style": "italic" }],
|
|
481
|
-
["not-italic", { "font-style": "normal" }]
|
|
482
|
-
];
|
|
483
|
-
const fontSmoothings = [
|
|
484
|
-
["antialiased", {
|
|
485
|
-
"-webkit-font-smoothing": "antialiased",
|
|
486
|
-
"-moz-osx-font-smoothing": "grayscale",
|
|
487
|
-
"font-smoothing": "grayscale"
|
|
488
|
-
}],
|
|
489
|
-
["subpixel-antialiased", {
|
|
490
|
-
"-webkit-font-smoothing": "auto",
|
|
491
|
-
"-moz-osx-font-smoothing": "auto",
|
|
492
|
-
"font-smoothing": "auto"
|
|
493
|
-
}]
|
|
494
|
-
];
|
|
495
|
-
|
|
556
|
+
const ringBase = {
|
|
557
|
+
"--un-ring-inset": varEmpty,
|
|
558
|
+
"--un-ring-offset-width": "0px",
|
|
559
|
+
"--un-ring-offset-color": "#fff",
|
|
560
|
+
"--un-ring-color": "rgba(147,197,253,0.5)",
|
|
561
|
+
...shadowBase
|
|
562
|
+
};
|
|
496
563
|
const rings = [
|
|
497
564
|
[/^ring(?:-(.+))?$/, ([, d]) => {
|
|
498
565
|
const value = utilities.handler.px(d || "1");
|
|
499
566
|
if (value) {
|
|
500
|
-
return
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
};
|
|
567
|
+
return [
|
|
568
|
+
ringBase,
|
|
569
|
+
{
|
|
570
|
+
"--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)",
|
|
571
|
+
"--un-ring-shadow": `var(--un-ring-inset) 0 0 0 calc(${value} + var(--un-ring-offset-width)) var(--un-ring-color)`,
|
|
572
|
+
"box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow, 0 0 #0000)"
|
|
573
|
+
}
|
|
574
|
+
];
|
|
509
575
|
}
|
|
510
576
|
}],
|
|
511
577
|
["ring-offset", { "--un-ring-offset-width": "1px" }],
|
|
512
|
-
[/^ring-offset-(.+)$/, ([, d]) => ({ "--un-ring-offset-width": utilities.handler.px(d
|
|
578
|
+
[/^ring-offset-(?:width-|size-)?(.+)$/, ([, d]) => ({ "--un-ring-offset-width": utilities.handler.bracket.cssvar.px(d) })],
|
|
513
579
|
[/^ring-(.+)$/, utilities.colorResolver("--un-ring-color", "ring")],
|
|
514
580
|
[/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": utilities.handler.bracket.percent(opacity) })],
|
|
515
581
|
[/^ring-offset-(.+)$/, utilities.colorResolver("--un-ring-offset-color", "ring-offset")],
|
|
@@ -517,46 +583,17 @@ const rings = [
|
|
|
517
583
|
["ring-inset", { "--un-ring-inset": "inset" }]
|
|
518
584
|
];
|
|
519
585
|
|
|
520
|
-
const
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
if (!color)
|
|
526
|
-
return;
|
|
527
|
-
if (rgba) {
|
|
528
|
-
return {
|
|
529
|
-
"--un-shadow-color": `${rgba.slice(0, 3).join(",")}`
|
|
530
|
-
};
|
|
531
|
-
} else {
|
|
532
|
-
return {
|
|
533
|
-
"--un-shadow-color": color
|
|
534
|
-
};
|
|
535
|
-
}
|
|
586
|
+
const sizeMapping = {
|
|
587
|
+
h: "height",
|
|
588
|
+
w: "width",
|
|
589
|
+
inline: "inline-size",
|
|
590
|
+
block: "block-size"
|
|
536
591
|
};
|
|
537
|
-
const boxShadows = [
|
|
538
|
-
[/^shadow(?:-(.+))?$/, ([, d], { theme }) => {
|
|
539
|
-
const value = theme.boxShadow?.[d || "DEFAULT"];
|
|
540
|
-
if (value) {
|
|
541
|
-
return {
|
|
542
|
-
"--un-shadow-inset": varEmpty,
|
|
543
|
-
"--un-shadow-color": "0,0,0",
|
|
544
|
-
"--un-shadow": value,
|
|
545
|
-
"box-shadow": "var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow)"
|
|
546
|
-
};
|
|
547
|
-
}
|
|
548
|
-
}],
|
|
549
|
-
[/^shadow-(.+)$/, ([, d], { theme }) => shadowColorResolver(d, theme)],
|
|
550
|
-
["shadow-inset", { "--un-shadow-inset": "inset" }]
|
|
551
|
-
];
|
|
552
|
-
|
|
553
592
|
function getPropName(minmax, hw) {
|
|
554
|
-
return `${minmax
|
|
593
|
+
return `${minmax || ""}${sizeMapping[hw]}`;
|
|
555
594
|
}
|
|
556
595
|
function getSizeValue(minmax, hw, theme, prop) {
|
|
557
|
-
|
|
558
|
-
if (minmax)
|
|
559
|
-
str = `${minmax}${utilities.capitalize(str)}`;
|
|
596
|
+
const str = getPropName(minmax, hw).replace(/-(\w)/g, (_, p) => p.toUpperCase());
|
|
560
597
|
const v = theme[str]?.[prop];
|
|
561
598
|
if (v != null)
|
|
562
599
|
return v;
|
|
@@ -566,11 +603,12 @@ function getSizeValue(minmax, hw, theme, prop) {
|
|
|
566
603
|
case "min":
|
|
567
604
|
return `${prop}-content`;
|
|
568
605
|
}
|
|
569
|
-
return utilities.handler.bracket.cssvar.fraction.
|
|
606
|
+
return utilities.handler.bracket.cssvar.auto.fraction.rem(prop);
|
|
570
607
|
}
|
|
571
608
|
const sizes = [
|
|
572
|
-
[/^(
|
|
573
|
-
[/^(
|
|
609
|
+
[/^(min-|max-)?([wh])-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
|
|
610
|
+
[/^(min-|max-)?(block|inline)-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
|
|
611
|
+
[/^(min-|max-)?(w)-screen-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: theme.breakpoints?.[s] })]
|
|
574
612
|
];
|
|
575
613
|
function getAspectRatio(prop) {
|
|
576
614
|
if (/^\d+\/\d+$/.test(prop))
|
|
@@ -590,22 +628,53 @@ const aspectRatio = [
|
|
|
590
628
|
const paddings = [
|
|
591
629
|
[/^pa?()-?(-?.+)$/, utilities.directionSize("padding")],
|
|
592
630
|
[/^p-?([xy])-?(-?.+)$/, utilities.directionSize("padding")],
|
|
593
|
-
[/^p-?([rltbse])-?(-?.+)$/, utilities.directionSize("padding")]
|
|
631
|
+
[/^p-?([rltbse])-?(-?.+)$/, utilities.directionSize("padding")],
|
|
632
|
+
[/^p-(block|inline)-(-?.+)$/, utilities.directionSize("padding")],
|
|
633
|
+
[/^p-?([bi][se])-?(-?.+)$/, utilities.directionSize("padding")]
|
|
594
634
|
];
|
|
595
635
|
const margins = [
|
|
596
636
|
[/^ma?()-?(-?.+)$/, utilities.directionSize("margin")],
|
|
597
637
|
[/^m-?([xy])-?(-?.+)$/, utilities.directionSize("margin")],
|
|
598
|
-
[/^m-?([rltbse])-?(-?.+)$/, utilities.directionSize("margin")]
|
|
638
|
+
[/^m-?([rltbse])-?(-?.+)$/, utilities.directionSize("margin")],
|
|
639
|
+
[/^m-(block|inline)-(-?.+)$/, utilities.directionSize("margin")],
|
|
640
|
+
[/^m-?([bi][se])-?(-?.+)$/, utilities.directionSize("margin")]
|
|
599
641
|
];
|
|
600
642
|
|
|
601
643
|
const transformGpu = {
|
|
602
|
-
"--un-transform":
|
|
644
|
+
"--un-transform": [
|
|
645
|
+
"translate3d(var(--un-translate-x), var(--un-translate-y), var(--un-translate-z))",
|
|
646
|
+
"rotate(var(--un-rotate))",
|
|
647
|
+
"rotateX(var(--un-rotate-x))",
|
|
648
|
+
"rotateY(var(--un-rotate-y))",
|
|
649
|
+
"rotateZ(var(--un-rotate-z))",
|
|
650
|
+
"skewX(var(--un-skew-x))",
|
|
651
|
+
"skewY(var(--un-skew-y))",
|
|
652
|
+
"scaleX(var(--un-scale-x))",
|
|
653
|
+
"scaleY(var(--un-scale-y))",
|
|
654
|
+
"scaleZ(var(--un-scale-z))"
|
|
655
|
+
].join(" ")
|
|
603
656
|
};
|
|
604
657
|
const transformCpu = {
|
|
605
|
-
"--un-transform":
|
|
658
|
+
"--un-transform": [
|
|
659
|
+
"translateX(var(--un-translate-x))",
|
|
660
|
+
"translateY(var(--un-translate-y))",
|
|
661
|
+
"translateZ(var(--un-translate-z))",
|
|
662
|
+
"rotate(var(--un-rotate))",
|
|
663
|
+
"rotateX(var(--un-rotate-x))",
|
|
664
|
+
"rotateY(var(--un-rotate-y))",
|
|
665
|
+
"rotateZ(var(--un-rotate-z))",
|
|
666
|
+
"skewX(var(--un-skew-x))",
|
|
667
|
+
"skewY(var(--un-skew-y))",
|
|
668
|
+
"scaleX(var(--un-scale-x))",
|
|
669
|
+
"scaleY(var(--un-scale-y))",
|
|
670
|
+
"scaleZ(var(--un-scale-z))"
|
|
671
|
+
].join(" ")
|
|
606
672
|
};
|
|
607
673
|
const transformBase = {
|
|
608
674
|
"--un-rotate": 0,
|
|
675
|
+
"--un-rotate-x": 0,
|
|
676
|
+
"--un-rotate-y": 0,
|
|
677
|
+
"--un-rotate-z": 0,
|
|
609
678
|
"--un-scale-x": 1,
|
|
610
679
|
"--un-scale-y": 1,
|
|
611
680
|
"--un-scale-z": 1,
|
|
@@ -618,9 +687,9 @@ const transformBase = {
|
|
|
618
687
|
[core.CONTROL_SHORTCUT_NO_MERGE]: ""
|
|
619
688
|
};
|
|
620
689
|
const transforms = [
|
|
621
|
-
[/^origin-(
|
|
690
|
+
[/^origin-(.+)$/, ([, s]) => ({ "transform-origin": utilities.positionMap[s] ?? utilities.handler.bracket.cssvar(s) })],
|
|
622
691
|
[/^perspect-(.+)$/, ([, s]) => {
|
|
623
|
-
const v = utilities.handler.px.numberWithUnit(s);
|
|
692
|
+
const v = utilities.handler.bracket.cssvar.px.numberWithUnit(s);
|
|
624
693
|
if (v != null) {
|
|
625
694
|
return {
|
|
626
695
|
"-webkit-perspective": v,
|
|
@@ -629,7 +698,7 @@ const transforms = [
|
|
|
629
698
|
}
|
|
630
699
|
}],
|
|
631
700
|
[/^perspect-origin-(.+)$/, ([, s]) => {
|
|
632
|
-
const v = utilities.handler.bracket(s) ?? (s.length >= 3 ? utilities.positionMap[s] : void 0);
|
|
701
|
+
const v = utilities.handler.bracket.cssvar(s) ?? (s.length >= 3 ? utilities.positionMap[s] : void 0);
|
|
633
702
|
if (v != null) {
|
|
634
703
|
return {
|
|
635
704
|
"-webkit-perspective-origin": v,
|
|
@@ -639,8 +708,8 @@ const transforms = [
|
|
|
639
708
|
}],
|
|
640
709
|
[/^translate-()(.+)$/, handleTranslate],
|
|
641
710
|
[/^translate-([xyz])-(.+)$/, handleTranslate],
|
|
642
|
-
[/^rotate-(.+)$/, handleRotate],
|
|
643
|
-
[/^
|
|
711
|
+
[/^rotate-()(.+)$/, handleRotate],
|
|
712
|
+
[/^rotate-([xyz])-(.+)$/, handleRotate],
|
|
644
713
|
[/^skew-([xy])-(.+)$/, handleSkew],
|
|
645
714
|
[/^scale-()(.+)$/, handleScale],
|
|
646
715
|
[/^scale-([xyz])-(.+)$/, handleScale],
|
|
@@ -655,7 +724,7 @@ const transforms = [
|
|
|
655
724
|
["transform-none", { transform: "none" }]
|
|
656
725
|
];
|
|
657
726
|
function handleTranslate([, d, b]) {
|
|
658
|
-
const v = utilities.handler.bracket.fraction.
|
|
727
|
+
const v = utilities.handler.bracket.cssvar.fraction.rem(b);
|
|
659
728
|
if (v != null) {
|
|
660
729
|
return [
|
|
661
730
|
transformBase,
|
|
@@ -667,7 +736,7 @@ function handleTranslate([, d, b]) {
|
|
|
667
736
|
}
|
|
668
737
|
}
|
|
669
738
|
function handleScale([, d, b]) {
|
|
670
|
-
const v = utilities.handler.bracket.fraction.percent(b);
|
|
739
|
+
const v = utilities.handler.bracket.cssvar.fraction.percent(b);
|
|
671
740
|
if (v != null) {
|
|
672
741
|
return [
|
|
673
742
|
transformBase,
|
|
@@ -678,20 +747,34 @@ function handleScale([, d, b]) {
|
|
|
678
747
|
];
|
|
679
748
|
}
|
|
680
749
|
}
|
|
681
|
-
function handleRotate([, b]) {
|
|
682
|
-
const v = utilities.handler.bracket.degree(b);
|
|
750
|
+
function handleRotate([, d = "", b]) {
|
|
751
|
+
const v = utilities.handler.bracket.cssvar.degree(b);
|
|
683
752
|
if (v != null) {
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
753
|
+
if (d) {
|
|
754
|
+
return [
|
|
755
|
+
transformBase,
|
|
756
|
+
{
|
|
757
|
+
"--un-rotate": 0,
|
|
758
|
+
[`--un-rotate-${d}`]: v,
|
|
759
|
+
"transform": "var(--un-transform)"
|
|
760
|
+
}
|
|
761
|
+
];
|
|
762
|
+
} else {
|
|
763
|
+
return [
|
|
764
|
+
transformBase,
|
|
765
|
+
{
|
|
766
|
+
"--un-rotate-x": 0,
|
|
767
|
+
"--un-rotate-y": 0,
|
|
768
|
+
"--un-rotate-z": 0,
|
|
769
|
+
"--un-rotate": v,
|
|
770
|
+
"transform": "var(--un-transform)"
|
|
771
|
+
}
|
|
772
|
+
];
|
|
773
|
+
}
|
|
691
774
|
}
|
|
692
775
|
}
|
|
693
776
|
function handleSkew([, d, b]) {
|
|
694
|
-
const v = utilities.handler.bracket.degree(b);
|
|
777
|
+
const v = utilities.handler.bracket.cssvar.degree(b);
|
|
695
778
|
if (v != null) {
|
|
696
779
|
return [
|
|
697
780
|
transformBase,
|
|
@@ -704,36 +787,35 @@ function handleSkew([, d, b]) {
|
|
|
704
787
|
}
|
|
705
788
|
|
|
706
789
|
const variablesAbbrMap = {
|
|
707
|
-
"visible": "visibility",
|
|
708
|
-
"select": "user-select",
|
|
709
|
-
"vertical": "vertical-align",
|
|
710
790
|
"backface": "backface-visibility",
|
|
711
|
-
"whitespace": "white-space",
|
|
712
791
|
"break": "word-break",
|
|
713
792
|
"case": "text-transform",
|
|
714
|
-
"origin": "transform-origin",
|
|
715
|
-
"bg-opacity": "background-opacity",
|
|
716
|
-
"tab": "tab-size",
|
|
717
|
-
"underline": "text-decoration-thickness",
|
|
718
|
-
"underline-offset": "text-underline-offset",
|
|
719
|
-
"grid-cols": "grid-template-columns",
|
|
720
|
-
"grid-rows": "grid-template-rows",
|
|
721
|
-
"auto-flow": "grid-auto-flow",
|
|
722
|
-
"row-start": "grid-row-start",
|
|
723
|
-
"row-end": "grid-row-end",
|
|
724
|
-
"justify": "justify-content",
|
|
725
793
|
"content": "align-content",
|
|
794
|
+
"flex": "flex",
|
|
795
|
+
"fw": "font-weight",
|
|
726
796
|
"items": "align-items",
|
|
797
|
+
"justify": "justify-content",
|
|
798
|
+
"leading": "line-height",
|
|
799
|
+
"lh": "line-height",
|
|
800
|
+
"select": "user-select",
|
|
727
801
|
"self": "align-self",
|
|
728
|
-
"
|
|
802
|
+
"tracking": "letter-spacing",
|
|
803
|
+
"vertical": "vertical-align",
|
|
804
|
+
"visible": "visibility",
|
|
805
|
+
"whitespace": "white-space",
|
|
806
|
+
"word-spacing": "word-spacing",
|
|
807
|
+
"ws": "white-space"
|
|
729
808
|
};
|
|
730
809
|
const cssVariables = [
|
|
731
|
-
[/^(
|
|
732
|
-
const prop = variablesAbbrMap[name];
|
|
810
|
+
[/^([^$]+)(?<=-)\$(.+)$/, ([, name, varname]) => {
|
|
811
|
+
const prop = variablesAbbrMap[name.slice(0, -1)];
|
|
733
812
|
if (prop)
|
|
734
813
|
return { [prop]: `var(--${varname})` };
|
|
735
814
|
}]
|
|
736
815
|
];
|
|
816
|
+
const cssProperty = [
|
|
817
|
+
[/^\[([^:]+):(.+)\]$/, ([, prop, value]) => ({ [prop]: utilities.handler.bracket(`[${value}]`) })]
|
|
818
|
+
];
|
|
737
819
|
|
|
738
820
|
const questionMark = [
|
|
739
821
|
[
|
|
@@ -752,7 +834,7 @@ const textDecorations = [
|
|
|
752
834
|
["line-through", { "text-decoration-line": "line-through" }],
|
|
753
835
|
["decoration-underline", { "text-decoration-line": "underline" }],
|
|
754
836
|
["decoration-line-through", { "text-decoration-line": "line-through" }],
|
|
755
|
-
[/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s]) => ({ "text-decoration-thickness": utilities.handler.bracket.px(s) })],
|
|
837
|
+
[/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s]) => ({ "text-decoration-thickness": utilities.handler.bracket.cssvar.px(s) })],
|
|
756
838
|
[/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s })],
|
|
757
839
|
[/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
|
|
758
840
|
const result = utilities.colorResolver("text-decoration-color", "line")(match, ctx);
|
|
@@ -764,7 +846,7 @@ const textDecorations = [
|
|
|
764
846
|
}
|
|
765
847
|
}],
|
|
766
848
|
[/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": utilities.handler.bracket.percent(opacity) })],
|
|
767
|
-
[/^underline-offset-(.+)$/, ([, s]) => ({ "text-underline-offset": utilities.handler.auto.bracket.px(s) })],
|
|
849
|
+
[/^(?:underline|decoration)-offset-(.+)$/, ([, s]) => ({ "text-underline-offset": utilities.handler.auto.bracket.cssvar.px(s) })],
|
|
768
850
|
[/^(?:underline|decoration)-(solid|double|dotted|dashed|wavy|inherit|initial|revert|unset)$/, ([, d]) => ({ "text-decoration-style": d })],
|
|
769
851
|
["no-underline", { "text-decoration": "none" }],
|
|
770
852
|
["decoration-none", { "text-decoration": "none" }]
|
|
@@ -774,9 +856,9 @@ const svgUtilities = [
|
|
|
774
856
|
[/^fill-(.+)$/, utilities.colorResolver("fill", "fill")],
|
|
775
857
|
[/^fill-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-fill-opacity": utilities.handler.bracket.percent(opacity) })],
|
|
776
858
|
["fill-none", { fill: "none" }],
|
|
777
|
-
[/^stroke-(?:size
|
|
778
|
-
[/^stroke-dash-(.+)$/, ([, s]) => ({ "stroke-dasharray": utilities.handler.bracket.number(s) })],
|
|
779
|
-
[/^stroke-offset-(.+)$/, ([, s]) => ({ "stroke-dashoffset": utilities.handler.bracket.px.numberWithUnit(s) })],
|
|
859
|
+
[/^stroke-(?:width-|size-)?(.+)$/, ([, s]) => ({ "stroke-width": utilities.handler.bracket.fraction.px.number(s) })],
|
|
860
|
+
[/^stroke-dash-(.+)$/, ([, s]) => ({ "stroke-dasharray": utilities.handler.bracket.cssvar.number(s) })],
|
|
861
|
+
[/^stroke-offset-(.+)$/, ([, s]) => ({ "stroke-dashoffset": utilities.handler.bracket.cssvar.px.numberWithUnit(s) })],
|
|
780
862
|
[/^stroke-(.+)$/, utilities.colorResolver("stroke", "stroke")],
|
|
781
863
|
[/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity": utilities.handler.bracket.percent(opacity) })],
|
|
782
864
|
["stroke-cap-square", { "stroke-linecap": "square" }],
|
|
@@ -792,6 +874,7 @@ const svgUtilities = [
|
|
|
792
874
|
|
|
793
875
|
const rules = [
|
|
794
876
|
cssVariables,
|
|
877
|
+
cssProperty,
|
|
795
878
|
paddings,
|
|
796
879
|
margins,
|
|
797
880
|
displays,
|
|
@@ -855,7 +938,9 @@ exports.borders = borders;
|
|
|
855
938
|
exports.boxShadows = boxShadows;
|
|
856
939
|
exports.boxSizing = boxSizing;
|
|
857
940
|
exports.breaks = breaks;
|
|
941
|
+
exports.colorableShadows = colorableShadows;
|
|
858
942
|
exports.contents = contents;
|
|
943
|
+
exports.cssProperty = cssProperty;
|
|
859
944
|
exports.cssVariables = cssVariables;
|
|
860
945
|
exports.cursors = cursors;
|
|
861
946
|
exports.displays = displays;
|
|
@@ -881,6 +966,7 @@ exports.questionMark = questionMark;
|
|
|
881
966
|
exports.resizes = resizes;
|
|
882
967
|
exports.rings = rings;
|
|
883
968
|
exports.rules = rules;
|
|
969
|
+
exports.shadowBase = shadowBase;
|
|
884
970
|
exports.sizes = sizes;
|
|
885
971
|
exports.svgUtilities = svgUtilities;
|
|
886
972
|
exports.tabSizes = tabSizes;
|