@unocss/preset-mini 0.15.4 → 0.16.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/default2.cjs +158 -202
- package/dist/chunks/default2.mjs +156 -180
- package/dist/chunks/index.cjs +7 -39
- package/dist/chunks/index.mjs +6 -30
- package/dist/rules.cjs +3 -23
- package/dist/rules.d.ts +8 -27
- package/dist/rules.mjs +1 -1
- package/dist/utils.cjs +3 -10
- package/dist/utils.d.ts +4 -12
- package/dist/utils.mjs +2 -1
- package/package.json +2 -2
package/dist/chunks/default2.cjs
CHANGED
|
@@ -25,11 +25,13 @@ const parseColorUtil = (body, theme) => {
|
|
|
25
25
|
if (!name)
|
|
26
26
|
return;
|
|
27
27
|
let color;
|
|
28
|
-
const bracket = index.handler.bracket(main)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
const bracket = index.handler.bracket(main);
|
|
29
|
+
const bracketOrMain = bracket || main;
|
|
30
|
+
if (bracketOrMain.startsWith("#"))
|
|
31
|
+
color = bracketOrMain.slice(1);
|
|
32
|
+
if (bracketOrMain.startsWith("hex-"))
|
|
33
|
+
color = bracketOrMain.slice(4);
|
|
34
|
+
color = color || bracket;
|
|
33
35
|
if (!color) {
|
|
34
36
|
const colorData = theme.colors?.[name];
|
|
35
37
|
if (typeof colorData === "string")
|
|
@@ -78,22 +80,6 @@ const textColors = [
|
|
|
78
80
|
[/^(?:text|color|c)-(.+)$/, colorResolver$1("color", "text")],
|
|
79
81
|
[/^(?:text|color|c)-op(?:acity)?-?(.+)$/m, ([, opacity2]) => ({ "--un-text-opacity": index.handler.bracket.percent.cssvar(opacity2) })]
|
|
80
82
|
];
|
|
81
|
-
const textDecorationColors = [
|
|
82
|
-
[/^underline-(.+)$/, (match, ctx) => {
|
|
83
|
-
const result = colorResolver$1("text-decoration-color", "line")(match, ctx);
|
|
84
|
-
if (result) {
|
|
85
|
-
return {
|
|
86
|
-
"-webkit-text-decoration-color": result["text-decoration-color"],
|
|
87
|
-
...result
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
}],
|
|
91
|
-
[/^underline-op(?:acity)?-?(.+)$/m, ([, opacity2]) => ({ "--un-line-opacity": index.handler.bracket.percent(opacity2) })]
|
|
92
|
-
];
|
|
93
|
-
const textStrokeColors = [
|
|
94
|
-
[/^text-stroke-(.+)$/, colorResolver$1("-webkit-text-stroke-color", "text-stroke")],
|
|
95
|
-
[/^text-stroke-op(?:acity)?-?(.+)$/m, ([, opacity2]) => ({ "--un-text-stroke-opacity": index.handler.bracket.percent(opacity2) })]
|
|
96
|
-
];
|
|
97
83
|
const bgColors = [
|
|
98
84
|
[/^bg-(.+)$/, colorResolver$1("background-color", "bg")],
|
|
99
85
|
[/^bg-op(?:acity)?-?(.+)$/m, ([, opacity2]) => ({ "--un-bg-opacity": index.handler.bracket.percent(opacity2) })]
|
|
@@ -178,39 +164,51 @@ const placeholder = [
|
|
|
178
164
|
]
|
|
179
165
|
];
|
|
180
166
|
|
|
181
|
-
const
|
|
167
|
+
const borders = [
|
|
182
168
|
[/^border$/, handlerBorder],
|
|
183
|
-
[/^(?:border|b)(
|
|
184
|
-
[/^(?:border|b)(
|
|
185
|
-
]
|
|
186
|
-
|
|
187
|
-
[/^(?:border
|
|
188
|
-
[/^(?:border
|
|
189
|
-
[/^(?:border-
|
|
190
|
-
];
|
|
191
|
-
const borderStyles = [
|
|
169
|
+
[/^(?:border|b)()-(.+)$/, handlerBorder],
|
|
170
|
+
[/^(?:border|b)-([^-]+)-(.+)$/, handlerBorder],
|
|
171
|
+
[/^(?:border|b)()-size-(.+)$/, handlerBorderSize],
|
|
172
|
+
[/^(?:border|b)-([^-]+)-size-(.+)$/, handlerBorderSize],
|
|
173
|
+
[/^(?:border|b)()-(.+)$/, handlerBorderColor],
|
|
174
|
+
[/^(?:border|b)-([^-]+)-(.+)$/, handlerBorderColor],
|
|
175
|
+
[/^(?:border|b)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-border-opacity": index.handler.bracket.percent(opacity) })],
|
|
192
176
|
["border-solid", { "border-style": "solid" }],
|
|
193
177
|
["border-dashed", { "border-style": "dashed" }],
|
|
194
178
|
["border-dotted", { "border-style": "dotted" }],
|
|
195
179
|
["border-double", { "border-style": "double" }],
|
|
196
|
-
["border-none", { "border-style": "none" }]
|
|
180
|
+
["border-none", { "border-style": "none" }],
|
|
181
|
+
[/^(?:border-)?(?:rounded|rd)$/, handlerRounded],
|
|
182
|
+
[/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?$/, handlerRounded],
|
|
183
|
+
[/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?(?:-([^-]+))?$/, handlerRounded]
|
|
197
184
|
];
|
|
198
|
-
|
|
199
|
-
borderSizes
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
]
|
|
204
|
-
|
|
185
|
+
function handlerBorder(m) {
|
|
186
|
+
const borderSizes = handlerBorderSize(m);
|
|
187
|
+
if (borderSizes) {
|
|
188
|
+
return [
|
|
189
|
+
...borderSizes,
|
|
190
|
+
["border-style", "solid"]
|
|
191
|
+
];
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
function handlerBorderSize([, a, b]) {
|
|
205
195
|
const [d, s = "1"] = index.directionMap[a] ? [a, b] : ["", a];
|
|
206
196
|
const v = index.handler.bracket.px(s);
|
|
207
197
|
if (v != null) {
|
|
208
198
|
return [
|
|
209
|
-
...index.directionMap[d].map((i) => [`border${i}-width`, v])
|
|
210
|
-
["border-style", "solid"]
|
|
199
|
+
...index.directionMap[d].map((i) => [`border${i}-width`, v])
|
|
211
200
|
];
|
|
212
201
|
}
|
|
213
202
|
}
|
|
203
|
+
function handlerBorderColor([, a, c], ctx) {
|
|
204
|
+
const ofColor = colorResolver$1("border-color", "border")(["", c], ctx);
|
|
205
|
+
if (ofColor) {
|
|
206
|
+
const borders2 = index.directionMap[index.directionMap[a] ? a : ""].map((i) => colorResolver$1(`border${i}-color`, "border")(["", c], ctx));
|
|
207
|
+
const borderObject = {};
|
|
208
|
+
Object.assign(borderObject, ...borders2);
|
|
209
|
+
return borderObject;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
214
212
|
function handlerRounded([, a, b], { theme }) {
|
|
215
213
|
const [d, s = "DEFAULT"] = index.cornerMap[a] ? [a, b] : ["", a];
|
|
216
214
|
const v = theme.borderRadius?.[s] || index.handler.bracket.fraction.rem(s);
|
|
@@ -309,37 +307,27 @@ const transitions = [
|
|
|
309
307
|
];
|
|
310
308
|
|
|
311
309
|
const flex = [
|
|
312
|
-
["flex
|
|
313
|
-
["flex
|
|
314
|
-
["flex-
|
|
315
|
-
["flex-row-reverse", { "flex-direction": "row-reverse" }],
|
|
316
|
-
["flex-wrap", { "flex-wrap": "wrap" }],
|
|
317
|
-
["flex-wrap-reverse", { "flex-wrap": "wrap-reverse" }],
|
|
318
|
-
["flex-nowrap", { "flex-wrap": "nowrap" }],
|
|
310
|
+
["flex", { display: "flex" }],
|
|
311
|
+
["inline-flex", { display: "inline-flex" }],
|
|
312
|
+
["flex-inline", { display: "inline-flex" }],
|
|
319
313
|
["flex-1", { flex: "1 1 0%" }],
|
|
320
314
|
["flex-auto", { flex: "1 1 auto" }],
|
|
321
315
|
["flex-initial", { flex: "0 1 auto" }],
|
|
322
316
|
["flex-none", { flex: "none" }],
|
|
323
317
|
[/^flex-\[(.+)\]$/, ([, d]) => ({ flex: d })],
|
|
324
|
-
["flex-grow", { "flex-grow": 1 }],
|
|
325
|
-
["flex-grow-0", { "flex-grow": 0 }],
|
|
326
318
|
["flex-shrink", { "flex-shrink": 1 }],
|
|
327
319
|
["flex-shrink-0", { "flex-shrink": 0 }],
|
|
328
|
-
["flex", {
|
|
329
|
-
["
|
|
330
|
-
["flex-
|
|
320
|
+
["flex-grow", { "flex-grow": 1 }],
|
|
321
|
+
["flex-grow-0", { "flex-grow": 0 }],
|
|
322
|
+
["flex-row", { "flex-direction": "row" }],
|
|
323
|
+
["flex-row-reverse", { "flex-direction": "row-reverse" }],
|
|
324
|
+
["flex-col", { "flex-direction": "column" }],
|
|
325
|
+
["flex-col-reverse", { "flex-direction": "column-reverse" }],
|
|
326
|
+
["flex-wrap", { "flex-wrap": "wrap" }],
|
|
327
|
+
["flex-wrap-reverse", { "flex-wrap": "wrap-reverse" }],
|
|
328
|
+
["flex-nowrap", { "flex-wrap": "nowrap" }]
|
|
331
329
|
];
|
|
332
330
|
|
|
333
|
-
const fontsFamilies = [
|
|
334
|
-
[/^font-(\w+)$/, ([, d], { theme }) => {
|
|
335
|
-
const font = theme.fontFamily?.[d];
|
|
336
|
-
if (font) {
|
|
337
|
-
return {
|
|
338
|
-
"font-family": font
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
|
-
}]
|
|
342
|
-
];
|
|
343
331
|
const weightMap = {
|
|
344
332
|
thin: "100",
|
|
345
333
|
extralight: "200",
|
|
@@ -351,40 +339,48 @@ const weightMap = {
|
|
|
351
339
|
extrabold: "800",
|
|
352
340
|
black: "900"
|
|
353
341
|
};
|
|
354
|
-
const
|
|
355
|
-
[/^
|
|
356
|
-
const
|
|
357
|
-
if (
|
|
358
|
-
|
|
342
|
+
const fonts = [
|
|
343
|
+
[/^font-(\w+)$/, ([, d], { theme }) => {
|
|
344
|
+
const font = theme.fontFamily?.[d];
|
|
345
|
+
if (font) {
|
|
346
|
+
return {
|
|
347
|
+
"font-family": font
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
}],
|
|
351
|
+
[/^text-(.+)$/, ([, s = "base"], { theme }) => {
|
|
352
|
+
const size = index.handler.bracket.rem(s);
|
|
353
|
+
if (size)
|
|
354
|
+
return { "font-size": size };
|
|
355
|
+
const themed = core.toArray(theme.fontSize?.[s]);
|
|
356
|
+
if (themed?.[0]) {
|
|
357
|
+
const [size2, height] = themed;
|
|
359
358
|
return {
|
|
360
|
-
"font-size":
|
|
359
|
+
"font-size": size2,
|
|
361
360
|
"line-height": height
|
|
362
361
|
};
|
|
363
362
|
}
|
|
364
|
-
}]
|
|
365
|
-
]
|
|
366
|
-
const
|
|
363
|
+
}],
|
|
364
|
+
[/^text-size-(.+)$/, ([, s]) => {
|
|
365
|
+
const raw = index.handler.bracket.rem(s);
|
|
366
|
+
if (raw)
|
|
367
|
+
return { "font-size": raw };
|
|
368
|
+
}],
|
|
367
369
|
[/^(?:font|fw)-?([^-]+)$/, ([, s]) => {
|
|
368
370
|
const v = weightMap[s] || index.handler.number(s);
|
|
369
371
|
if (v)
|
|
370
372
|
return { "font-weight": v };
|
|
371
|
-
}]
|
|
372
|
-
];
|
|
373
|
-
const leadings = [
|
|
373
|
+
}],
|
|
374
374
|
[/^(?:leading|lh)-([^-]+)$/, ([, s], { theme }) => {
|
|
375
375
|
const v = theme.lineHeight?.[s] || index.handler.bracket.rem(s);
|
|
376
376
|
if (v !== null)
|
|
377
377
|
return { "line-height": v };
|
|
378
|
-
}]
|
|
379
|
-
];
|
|
380
|
-
const trackings = [
|
|
378
|
+
}],
|
|
381
379
|
[/^tracking-([^-]+)$/, ([, s], { theme }) => {
|
|
382
380
|
const v = theme.letterSpacing?.[s] || index.handler.bracket.rem(s);
|
|
383
381
|
if (v !== null)
|
|
384
382
|
return { "letter-spacing": v };
|
|
385
|
-
}]
|
|
386
|
-
];
|
|
387
|
-
const wordSpacings = [
|
|
383
|
+
}],
|
|
388
384
|
[/^word-spacing-([^-]+)$/, ([, s], { theme }) => {
|
|
389
385
|
const v = theme.wordSpacing?.[s] || index.handler.bracket.rem(s);
|
|
390
386
|
if (v !== null)
|
|
@@ -404,20 +400,6 @@ const tabSizes = [
|
|
|
404
400
|
}
|
|
405
401
|
}]
|
|
406
402
|
];
|
|
407
|
-
const textDecorationLengths = [
|
|
408
|
-
[/^underline-([^-]+)$/, ([, s]) => {
|
|
409
|
-
const v = s === "auto" ? s : index.handler.bracket.px(s);
|
|
410
|
-
if (v != null)
|
|
411
|
-
return { "text-decoration-thickness": v };
|
|
412
|
-
}]
|
|
413
|
-
];
|
|
414
|
-
const textDecorationOffsets = [
|
|
415
|
-
[/^underline-offset-([^-]+)$/, ([, s]) => {
|
|
416
|
-
const v = s === "auto" ? s : index.handler.bracket.px(s);
|
|
417
|
-
if (v != null)
|
|
418
|
-
return { "text-underline-offset": v };
|
|
419
|
-
}]
|
|
420
|
-
];
|
|
421
403
|
const textIndents = [
|
|
422
404
|
[/^indent(?:-(.+))?$/, ([, s], { theme }) => {
|
|
423
405
|
const v = theme.textIndent?.[s || "DEFAULT"] || index.handler.bracket.cssvar.fraction.rem(s);
|
|
@@ -425,12 +407,14 @@ const textIndents = [
|
|
|
425
407
|
return { "text-indent": v };
|
|
426
408
|
}]
|
|
427
409
|
];
|
|
428
|
-
const
|
|
410
|
+
const textStrokes = [
|
|
429
411
|
[/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => {
|
|
430
412
|
const v = theme.textStrokeWidth?.[s || "DEFAULT"] || index.handler.bracket.cssvar.px(s);
|
|
431
413
|
if (v != null)
|
|
432
414
|
return { "-webkit-text-stroke-width": v };
|
|
433
|
-
}]
|
|
415
|
+
}],
|
|
416
|
+
[/^text-stroke-(.+)$/, colorResolver$1("-webkit-text-stroke-color", "text-stroke")],
|
|
417
|
+
[/^text-stroke-op(?:acity)?-?(.+)$/m, ([, opacity]) => ({ "--un-text-stroke-opacity": index.handler.bracket.percent(opacity) })]
|
|
434
418
|
];
|
|
435
419
|
const textShadows = [
|
|
436
420
|
[/^text-shadow(?:-(.+))?$/, ([, s], { theme }) => {
|
|
@@ -439,11 +423,6 @@ const textShadows = [
|
|
|
439
423
|
return { "text-shadow": v };
|
|
440
424
|
}]
|
|
441
425
|
];
|
|
442
|
-
const fonts = [
|
|
443
|
-
fontsFamilies,
|
|
444
|
-
fontSizes,
|
|
445
|
-
fontWeights
|
|
446
|
-
].flat(1);
|
|
447
426
|
|
|
448
427
|
const gaps = [
|
|
449
428
|
[/^(?:flex-|grid-)?gap-([^-]+)$/, ([, s]) => {
|
|
@@ -488,12 +467,10 @@ const autoDirection = (selector, theme) => {
|
|
|
488
467
|
const grids = [
|
|
489
468
|
["grid", { display: "grid" }],
|
|
490
469
|
["inline-grid", { display: "inline-grid" }],
|
|
491
|
-
[/^grid-
|
|
492
|
-
[/^grid-
|
|
493
|
-
[/^grid-
|
|
494
|
-
[/^grid-
|
|
495
|
-
[/^grid-cols-\[(.+)\]$/, ([, v]) => ({ "grid-template-columns": v.replace(/,/g, " ") })],
|
|
496
|
-
[/^grid-rows-\[(.+)\]$/, ([, v]) => ({ "grid-template-rows": v.replace(/,/g, " ") })],
|
|
470
|
+
[/^(?:grid-)?col-start-([\w.-]+)$/, ([, v]) => ({ "grid-column-start": `${v}` })],
|
|
471
|
+
[/^(?:grid-)?col-end-([\w.]+)$/, ([, v]) => ({ "grid-column-end": `${v}` })],
|
|
472
|
+
[/^(?:grid-)?row-start-([\w.-]+)$/, ([, v]) => ({ "grid-row-start": `${v}` })],
|
|
473
|
+
[/^(?:grid-)?row-end-([\w.-]+)$/, ([, v]) => ({ "grid-row-end": `${v}` })],
|
|
497
474
|
[/^(?:grid-)?(row|col)-(.+)$/, ([, d, v]) => {
|
|
498
475
|
const key = d === "row" ? "grid-row" : "grid-column";
|
|
499
476
|
let raw = index.handler.bracket(v);
|
|
@@ -510,13 +487,15 @@ const grids = [
|
|
|
510
487
|
return { [key]: `span ${raw}/span ${raw}` };
|
|
511
488
|
}
|
|
512
489
|
}],
|
|
490
|
+
[/^(?:grid-)?auto-cols-([\w.-]+)$/, ([, v], { theme }) => ({ "grid-auto-columns": `${autoDirection(v, theme)}` })],
|
|
513
491
|
[/^(?:grid-)?auto-flow-([\w.-]+)$/, ([, v]) => ({ "grid-auto-flow": `${v.replace("col", "column").split("-").join(" ")}` })],
|
|
514
|
-
[/^(?:grid-)?row-start-([\w.-]+)$/, ([, v]) => ({ "grid-row-start": `${v}` })],
|
|
515
|
-
[/^(?:grid-)?row-end-([\w.-]+)$/, ([, v]) => ({ "grid-row-end": `${v}` })],
|
|
516
|
-
[/^(?:grid-)?col-start-([\w.-]+)$/, ([, v]) => ({ "grid-column-start": `${v}` })],
|
|
517
|
-
[/^(?:grid-)?col-end-([\w.]+)$/, ([, v]) => ({ "grid-column-end": `${v}` })],
|
|
518
492
|
[/^(?:grid-)?auto-rows-([\w.-]+)$/, ([, v], { theme }) => ({ "grid-auto-rows": `${autoDirection(v, theme)}` })],
|
|
519
|
-
[/^
|
|
493
|
+
[/^grid-cols-minmax-([\w.-]+)$/, ([, d]) => ({ "grid-template-columns": `repeat(auto-fill, minmax(${d}, 1fr))` })],
|
|
494
|
+
[/^grid-rows-minmax-([\w.-]+)$/, ([, d]) => ({ "grid-template-rows": `repeat(auto-fill, minmax(${d}, 1fr))` })],
|
|
495
|
+
[/^grid-cols-(\d+)$/, ([, d]) => ({ "grid-template-columns": `repeat(${d},minmax(0,1fr))` })],
|
|
496
|
+
[/^grid-rows-(\d+)$/, ([, d]) => ({ "grid-template-rows": `repeat(${d},minmax(0,1fr))` })],
|
|
497
|
+
[/^grid-cols-\[(.+)\]$/, ([, v]) => ({ "grid-template-columns": v.replace(/,/g, " ") })],
|
|
498
|
+
[/^grid-rows-\[(.+)\]$/, ([, v]) => ({ "grid-template-rows": v.replace(/,/g, " ") })]
|
|
520
499
|
];
|
|
521
500
|
|
|
522
501
|
const overflowValues = [
|
|
@@ -530,6 +509,7 @@ const overflows = [
|
|
|
530
509
|
[/^(?:overflow|of)-([xy])-(.+)$/, ([, d, v]) => overflowValues.includes(v) ? { [`overflow-${d}`]: v } : void 0]
|
|
531
510
|
];
|
|
532
511
|
|
|
512
|
+
const basicSet = ["auto", "start", "end", "center", "stretch"];
|
|
533
513
|
const positions = [
|
|
534
514
|
["relative", { position: "relative" }],
|
|
535
515
|
["absolute", { position: "absolute" }],
|
|
@@ -543,47 +523,42 @@ const justifies = [
|
|
|
543
523
|
["justify-center", { "justify-content": "center" }],
|
|
544
524
|
["justify-between", { "justify-content": "space-between" }],
|
|
545
525
|
["justify-around", { "justify-content": "space-around" }],
|
|
546
|
-
["justify-evenly", { "justify-content": "space-evenly" }]
|
|
526
|
+
["justify-evenly", { "justify-content": "space-evenly" }],
|
|
527
|
+
...basicSet.map((i) => [`justify-items-${i}`, { "justify-items": i }]),
|
|
528
|
+
...basicSet.map((i) => [`justify-self-${i}`, { "justify-self": i }])
|
|
547
529
|
];
|
|
548
530
|
const orders = [
|
|
549
531
|
[/^order-(.+)$/, ([, v]) => ({ order: { first: "-9999", last: "9999", none: "0" }[v] || index.handler.bracket.number(v) })]
|
|
550
532
|
];
|
|
551
|
-
const
|
|
552
|
-
const justifyItems = basicSet.map((i) => [`justify-items-${i}`, { "justify-items": i }]);
|
|
553
|
-
const justifySelfs = basicSet.map((i) => [`justify-self-${i}`, { "justify-self": i }]);
|
|
554
|
-
const alignContents = [
|
|
533
|
+
const alignments = [
|
|
555
534
|
["content-start", { "align-content": "flex-start" }],
|
|
556
535
|
["content-end", { "align-content": "flex-end" }],
|
|
557
536
|
["content-center", { "align-content": "center" }],
|
|
558
537
|
["content-between", { "align-content": "space-between" }],
|
|
559
538
|
["content-around", { "align-content": "space-around" }],
|
|
560
|
-
["content-evenly", { "align-content": "space-evenly" }]
|
|
561
|
-
];
|
|
562
|
-
const alignItems = [
|
|
539
|
+
["content-evenly", { "align-content": "space-evenly" }],
|
|
563
540
|
["items-start", { "align-items": "flex-start" }],
|
|
564
541
|
["items-end", { "align-items": "flex-end" }],
|
|
565
542
|
["items-center", { "align-items": "center" }],
|
|
566
543
|
["items-baseline", { "align-items": "baseline" }],
|
|
567
|
-
["items-stretch", { "align-items": "stretch" }]
|
|
568
|
-
];
|
|
569
|
-
const alignSelfs = [
|
|
544
|
+
["items-stretch", { "align-items": "stretch" }],
|
|
570
545
|
["self-auto", { "align-self": "auto" }],
|
|
571
546
|
["self-start", { "align-self": "flex-start" }],
|
|
572
547
|
["self-end", { "align-self": "flex-end" }],
|
|
573
548
|
["self-center", { "align-self": "center" }],
|
|
574
549
|
["self-stretch", { "align-items": "stretch" }]
|
|
575
550
|
];
|
|
576
|
-
const
|
|
551
|
+
const placements = [
|
|
577
552
|
["place-content-start", { "place-content": "start" }],
|
|
578
553
|
["place-content-end", { "place-content": "end" }],
|
|
579
554
|
["place-content-center", { "place-content": "center" }],
|
|
580
555
|
["place-content-between", { "place-content": "space-between" }],
|
|
581
556
|
["place-content-around", { "place-content": "space-around" }],
|
|
582
557
|
["place-content-evenly", { "place-content": "space-evenly" }],
|
|
583
|
-
["place-content-stretch", { "place-content": "stretch" }]
|
|
558
|
+
["place-content-stretch", { "place-content": "stretch" }],
|
|
559
|
+
...basicSet.map((i) => [`place-items-${i}`, { "place-items": i }]),
|
|
560
|
+
...basicSet.map((i) => [`place-self-${i}`, { "place-self": i }])
|
|
584
561
|
];
|
|
585
|
-
const placeItems = basicSet.map((i) => [`place-items-${i}`, { "place-items": i }]);
|
|
586
|
-
const placeSelfs = basicSet.map((i) => [`place-self-${i}`, { "place-self": i }]);
|
|
587
562
|
function handleInsetValue(v) {
|
|
588
563
|
return { auto: "auto", full: "100%" }[v] ?? index.handler.bracket.fraction.cssvar.rem(v);
|
|
589
564
|
}
|
|
@@ -774,17 +749,6 @@ const textTransforms = [
|
|
|
774
749
|
["case-capital", { "text-transform": "capitalize" }],
|
|
775
750
|
["case-normal", { "text-transform": "none" }]
|
|
776
751
|
];
|
|
777
|
-
const textDecorations = [
|
|
778
|
-
["underline", { "text-decoration": "underline" }],
|
|
779
|
-
["line-through", { "text-decoration": "line-through" }],
|
|
780
|
-
["no-underline", { "text-decoration": "none" }]
|
|
781
|
-
];
|
|
782
|
-
const textDecorationStyles = [
|
|
783
|
-
["underline-solid", { "text-decoration-style": "solid" }],
|
|
784
|
-
["underline-double", { "text-decoration-style": "double" }],
|
|
785
|
-
["underline-dotted", { "text-decoration-style": "dotted" }],
|
|
786
|
-
["underline-dashed", { "text-decoration-style": "dashed" }]
|
|
787
|
-
];
|
|
788
752
|
const fontStyles = [
|
|
789
753
|
["italic", { "font-style": "italic" }],
|
|
790
754
|
["not-italic", { "font-style": "normal" }]
|
|
@@ -802,6 +766,14 @@ const fontSmoothings = [
|
|
|
802
766
|
}]
|
|
803
767
|
];
|
|
804
768
|
|
|
769
|
+
const transformGpu = {
|
|
770
|
+
transform: "rotate(var(--un-rotate)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) translate3d(var(--un-translate-x), var(--un-translate-y), var(--un-translate-z))",
|
|
771
|
+
[pseudo.CONTROL_BYPASS_PSEUDO]: ""
|
|
772
|
+
};
|
|
773
|
+
const transformCpu = {
|
|
774
|
+
transform: "rotate(var(--un-rotate)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z))",
|
|
775
|
+
[pseudo.CONTROL_BYPASS_PSEUDO]: ""
|
|
776
|
+
};
|
|
805
777
|
const transformBase = {
|
|
806
778
|
"--un-rotate": 0,
|
|
807
779
|
"--un-scale-x": 1,
|
|
@@ -812,12 +784,7 @@ const transformBase = {
|
|
|
812
784
|
"--un-translate-x": 0,
|
|
813
785
|
"--un-translate-y": 0,
|
|
814
786
|
"--un-translate-z": 0,
|
|
815
|
-
|
|
816
|
-
[pseudo.CONTROL_BYPASS_PSEUDO]: ""
|
|
817
|
-
};
|
|
818
|
-
const transformGpu = {
|
|
819
|
-
transform: "rotate(var(--un-rotate)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) translate3d(var(--un-translate-x), var(--un-translate-y), var(--un-translate-z))",
|
|
820
|
-
[pseudo.CONTROL_BYPASS_PSEUDO]: ""
|
|
787
|
+
...transformCpu
|
|
821
788
|
};
|
|
822
789
|
const transforms = [
|
|
823
790
|
["transform", transformBase],
|
|
@@ -828,6 +795,8 @@ const transforms = [
|
|
|
828
795
|
[/^scale-([xyz])-([^-]+)$/, handleScale],
|
|
829
796
|
[/^rotate-([^-]+)(?:deg)?$/, handleRotate],
|
|
830
797
|
["transform-gpu", transformGpu],
|
|
798
|
+
["transform-cpu", transformCpu],
|
|
799
|
+
["transform-none", { transform: "none" }],
|
|
831
800
|
["origin-center", { "transform-origin": "center" }],
|
|
832
801
|
["origin-top", { "transform-origin": "top" }],
|
|
833
802
|
["origin-top-right", { "transform-origin": "top right" }],
|
|
@@ -877,19 +846,12 @@ const variablesAbbrMap = {
|
|
|
877
846
|
"backface": "backface-visibility",
|
|
878
847
|
"whitespace": "white-space",
|
|
879
848
|
"break": "word-break",
|
|
849
|
+
"b": "border-color",
|
|
850
|
+
"border": "border-color",
|
|
880
851
|
"color": "color",
|
|
881
852
|
"case": "text-transform",
|
|
882
|
-
"write": "writing-mode",
|
|
883
|
-
"write-orient": "text-orientation",
|
|
884
853
|
"origin": "transform-origin",
|
|
885
854
|
"bg": "background-color",
|
|
886
|
-
"bg-blend": "background-blend-mode",
|
|
887
|
-
"bg-clip": "-webkit-background-clip",
|
|
888
|
-
"bg-gradient": "linear-gradient",
|
|
889
|
-
"bg-origin-border": "background-origin",
|
|
890
|
-
"bg-position": "background-position",
|
|
891
|
-
"bg-repeat": "background-repeat",
|
|
892
|
-
"bg-size": "background-size",
|
|
893
855
|
"bg-opacity": "background-opacity",
|
|
894
856
|
"tab": "tab-size",
|
|
895
857
|
"underline": "text-decoration-thickness",
|
|
@@ -904,21 +866,22 @@ const variablesAbbrMap = {
|
|
|
904
866
|
"content": "align-content",
|
|
905
867
|
"items": "align-items",
|
|
906
868
|
"self": "align-self",
|
|
907
|
-
"object": "object-fit"
|
|
908
|
-
"mix-blend": "mix-blend-mode",
|
|
909
|
-
"animate-speed": "animation-speed"
|
|
869
|
+
"object": "object-fit"
|
|
910
870
|
};
|
|
911
|
-
const cssVariables = [
|
|
912
|
-
/^(.+)-\$(.+)$/,
|
|
913
|
-
([, name, varname]) => {
|
|
871
|
+
const cssVariables = [
|
|
872
|
+
[/^(.+)-\$(.+)$/, ([, name, varname]) => {
|
|
914
873
|
const prop = variablesAbbrMap[name];
|
|
915
874
|
if (prop) {
|
|
916
875
|
return {
|
|
917
876
|
[prop]: `var(--${varname})`
|
|
918
877
|
};
|
|
919
878
|
}
|
|
920
|
-
}
|
|
921
|
-
]]
|
|
879
|
+
}],
|
|
880
|
+
[/^(?:border|b)-([^-]+)-\$(.+)$/, ([, a, v]) => {
|
|
881
|
+
if (a in index.directionMap)
|
|
882
|
+
return index.directionMap[a].map((i) => [`border${i}-color`, `var(--${v})`]);
|
|
883
|
+
}]
|
|
884
|
+
];
|
|
922
885
|
|
|
923
886
|
const questionMark = [
|
|
924
887
|
[
|
|
@@ -931,6 +894,33 @@ ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
|
|
|
931
894
|
]
|
|
932
895
|
];
|
|
933
896
|
|
|
897
|
+
const textDecorations = [
|
|
898
|
+
["underline", { "text-decoration": "underline" }],
|
|
899
|
+
["line-through", { "text-decoration": "line-through" }],
|
|
900
|
+
["no-underline", { "text-decoration": "none" }],
|
|
901
|
+
["decoration-underline", { "text-decoration": "underline" }],
|
|
902
|
+
["decoration-line-through", { "text-decoration": "line-through" }],
|
|
903
|
+
["decoration-none", { "text-decoration": "none" }],
|
|
904
|
+
[/^(?:underline|decoration)-(solid|double|dotted|dashed|wavy)$/, ([, d]) => ({ "text-decoration-style": d })],
|
|
905
|
+
[/^(?:underline|decoration)-([^-]+)$/, ([, s]) => ({ "text-decoration-thickness": ["auto", "from-font"].includes(s) ? s : index.handler.bracket.px(s) })],
|
|
906
|
+
[/^decoration-(.*)$/, ([, d]) => ({ "text-decoration-thickness": index.handler.bracket.px(d) })],
|
|
907
|
+
[/^underline-offset-([^-]+)$/, ([, s]) => {
|
|
908
|
+
const v = s === "auto" ? s : index.handler.bracket.px(s);
|
|
909
|
+
if (v != null)
|
|
910
|
+
return { "text-underline-offset": v };
|
|
911
|
+
}],
|
|
912
|
+
[/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
|
|
913
|
+
const result = colorResolver$1("text-decoration-color", "line")(match, ctx);
|
|
914
|
+
if (result) {
|
|
915
|
+
return {
|
|
916
|
+
"-webkit-text-decoration-color": result["text-decoration-color"],
|
|
917
|
+
...result
|
|
918
|
+
};
|
|
919
|
+
}
|
|
920
|
+
}],
|
|
921
|
+
[/^(?:underline|decoration)-op(?:acity)?-?(.+)$/m, ([, opacity]) => ({ "--un-line-opacity": index.handler.bracket.percent(opacity) })]
|
|
922
|
+
];
|
|
923
|
+
|
|
934
924
|
const rules = [
|
|
935
925
|
cssVariables,
|
|
936
926
|
paddings,
|
|
@@ -946,12 +936,7 @@ const rules = [
|
|
|
946
936
|
textIndents,
|
|
947
937
|
textOverflows,
|
|
948
938
|
textDecorations,
|
|
949
|
-
|
|
950
|
-
textDecorationColors,
|
|
951
|
-
textDecorationLengths,
|
|
952
|
-
textDecorationOffsets,
|
|
953
|
-
textStrokeWidths,
|
|
954
|
-
textStrokeColors,
|
|
939
|
+
textStrokes,
|
|
955
940
|
textShadows,
|
|
956
941
|
textTransforms,
|
|
957
942
|
textAligns,
|
|
@@ -974,9 +959,6 @@ const rules = [
|
|
|
974
959
|
userSelects,
|
|
975
960
|
whitespaces,
|
|
976
961
|
breaks,
|
|
977
|
-
trackings,
|
|
978
|
-
wordSpacings,
|
|
979
|
-
leadings,
|
|
980
962
|
overflows,
|
|
981
963
|
outline,
|
|
982
964
|
appearance,
|
|
@@ -984,14 +966,8 @@ const rules = [
|
|
|
984
966
|
positions,
|
|
985
967
|
orders,
|
|
986
968
|
justifies,
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
alignContents,
|
|
990
|
-
alignItems,
|
|
991
|
-
alignSelfs,
|
|
992
|
-
placeContents,
|
|
993
|
-
placeItems,
|
|
994
|
-
placeSelfs,
|
|
969
|
+
alignments,
|
|
970
|
+
placements,
|
|
995
971
|
insets,
|
|
996
972
|
floats,
|
|
997
973
|
zIndexes,
|
|
@@ -1001,17 +977,12 @@ const rules = [
|
|
|
1001
977
|
questionMark
|
|
1002
978
|
].flat(1);
|
|
1003
979
|
|
|
1004
|
-
exports.
|
|
1005
|
-
exports.alignItems = alignItems;
|
|
1006
|
-
exports.alignSelfs = alignSelfs;
|
|
980
|
+
exports.alignments = alignments;
|
|
1007
981
|
exports.appearance = appearance;
|
|
1008
982
|
exports.appearances = appearances;
|
|
1009
983
|
exports.aspectRatio = aspectRatio;
|
|
1010
984
|
exports.bgColors = bgColors;
|
|
1011
985
|
exports.borderColors = borderColors;
|
|
1012
|
-
exports.borderRadius = borderRadius;
|
|
1013
|
-
exports.borderSizes = borderSizes;
|
|
1014
|
-
exports.borderStyles = borderStyles;
|
|
1015
986
|
exports.borders = borders;
|
|
1016
987
|
exports.boxShadows = boxShadows;
|
|
1017
988
|
exports.boxSizing = boxSizing;
|
|
@@ -1024,19 +995,13 @@ exports.displays = displays;
|
|
|
1024
995
|
exports.fillColors = fillColors;
|
|
1025
996
|
exports.flex = flex;
|
|
1026
997
|
exports.floats = floats;
|
|
1027
|
-
exports.fontSizes = fontSizes;
|
|
1028
998
|
exports.fontSmoothings = fontSmoothings;
|
|
1029
999
|
exports.fontStyles = fontStyles;
|
|
1030
|
-
exports.fontWeights = fontWeights;
|
|
1031
1000
|
exports.fonts = fonts;
|
|
1032
|
-
exports.fontsFamilies = fontsFamilies;
|
|
1033
1001
|
exports.gaps = gaps;
|
|
1034
1002
|
exports.grids = grids;
|
|
1035
1003
|
exports.insets = insets;
|
|
1036
1004
|
exports.justifies = justifies;
|
|
1037
|
-
exports.justifyItems = justifyItems;
|
|
1038
|
-
exports.justifySelfs = justifySelfs;
|
|
1039
|
-
exports.leadings = leadings;
|
|
1040
1005
|
exports.margins = margins;
|
|
1041
1006
|
exports.opacity = opacity;
|
|
1042
1007
|
exports.orders = orders;
|
|
@@ -1044,10 +1009,8 @@ exports.outline = outline;
|
|
|
1044
1009
|
exports.overflows = overflows;
|
|
1045
1010
|
exports.paddings = paddings;
|
|
1046
1011
|
exports.parseColorUtil = parseColorUtil;
|
|
1047
|
-
exports.placeContents = placeContents;
|
|
1048
|
-
exports.placeItems = placeItems;
|
|
1049
|
-
exports.placeSelfs = placeSelfs;
|
|
1050
1012
|
exports.placeholder = placeholder;
|
|
1013
|
+
exports.placements = placements;
|
|
1051
1014
|
exports.pointerEvents = pointerEvents;
|
|
1052
1015
|
exports.positions = positions;
|
|
1053
1016
|
exports.questionMark = questionMark;
|
|
@@ -1060,23 +1023,16 @@ exports.sizes = sizes;
|
|
|
1060
1023
|
exports.tabSizes = tabSizes;
|
|
1061
1024
|
exports.textAligns = textAligns;
|
|
1062
1025
|
exports.textColors = textColors;
|
|
1063
|
-
exports.textDecorationColors = textDecorationColors;
|
|
1064
|
-
exports.textDecorationLengths = textDecorationLengths;
|
|
1065
|
-
exports.textDecorationOffsets = textDecorationOffsets;
|
|
1066
|
-
exports.textDecorationStyles = textDecorationStyles;
|
|
1067
1026
|
exports.textDecorations = textDecorations;
|
|
1068
1027
|
exports.textIndents = textIndents;
|
|
1069
1028
|
exports.textOverflows = textOverflows;
|
|
1070
1029
|
exports.textShadows = textShadows;
|
|
1071
|
-
exports.
|
|
1072
|
-
exports.textStrokeWidths = textStrokeWidths;
|
|
1030
|
+
exports.textStrokes = textStrokes;
|
|
1073
1031
|
exports.textTransforms = textTransforms;
|
|
1074
|
-
exports.trackings = trackings;
|
|
1075
1032
|
exports.transforms = transforms;
|
|
1076
1033
|
exports.transitions = transitions;
|
|
1077
1034
|
exports.userSelects = userSelects;
|
|
1078
1035
|
exports.varEmpty = varEmpty;
|
|
1079
1036
|
exports.verticalAligns = verticalAligns;
|
|
1080
1037
|
exports.whitespaces = whitespaces;
|
|
1081
|
-
exports.wordSpacings = wordSpacings;
|
|
1082
1038
|
exports.zIndexes = zIndexes;
|