@unocss/preset-mini 0.15.3 → 0.16.0
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 +125 -189
- package/dist/chunks/default2.mjs +123 -167
- package/dist/chunks/index.cjs +12 -39
- package/dist/chunks/index.mjs +11 -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,29 +164,21 @@ const placeholder = [
|
|
|
178
164
|
]
|
|
179
165
|
];
|
|
180
166
|
|
|
181
|
-
const
|
|
167
|
+
const borders = [
|
|
182
168
|
[/^border$/, handlerBorder],
|
|
183
169
|
[/^(?:border|b)(?:-([^-]+))?$/, handlerBorder],
|
|
184
|
-
[/^(?:border|b)(?:-([^-]+))?(?:-([^-]+))?$/, handlerBorder]
|
|
185
|
-
];
|
|
186
|
-
const borderRadius = [
|
|
187
|
-
[/^(?:border-)?(?:rounded|rd)$/, handlerRounded],
|
|
188
|
-
[/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?$/, handlerRounded],
|
|
189
|
-
[/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?(?:-([^-]+))?$/, handlerRounded]
|
|
190
|
-
];
|
|
191
|
-
const borderStyles = [
|
|
170
|
+
[/^(?:border|b)(?:-([^-]+))?(?:-([^-]+))?$/, handlerBorder],
|
|
192
171
|
["border-solid", { "border-style": "solid" }],
|
|
193
172
|
["border-dashed", { "border-style": "dashed" }],
|
|
194
173
|
["border-dotted", { "border-style": "dotted" }],
|
|
195
174
|
["border-double", { "border-style": "double" }],
|
|
196
|
-
["border-none", { "border-style": "none" }]
|
|
175
|
+
["border-none", { "border-style": "none" }],
|
|
176
|
+
[/^(?:border-)?(?:rounded|rd)$/, handlerRounded],
|
|
177
|
+
[/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?$/, handlerRounded],
|
|
178
|
+
[/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?(?:-([^-]+))?$/, handlerRounded],
|
|
179
|
+
[/^(?:border|b)-(.+)$/, colorResolver$1("border-color", "border")],
|
|
180
|
+
[/^(?:border|b)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-border-opacity": index.handler.bracket.percent(opacity) })]
|
|
197
181
|
];
|
|
198
|
-
const borders = [
|
|
199
|
-
borderSizes,
|
|
200
|
-
borderColors,
|
|
201
|
-
borderStyles,
|
|
202
|
-
borderRadius
|
|
203
|
-
].flat(1);
|
|
204
182
|
function handlerBorder([, a, b]) {
|
|
205
183
|
const [d, s = "1"] = index.directionMap[a] ? [a, b] : ["", a];
|
|
206
184
|
const v = index.handler.bracket.px(s);
|
|
@@ -309,37 +287,27 @@ const transitions = [
|
|
|
309
287
|
];
|
|
310
288
|
|
|
311
289
|
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" }],
|
|
290
|
+
["flex", { display: "flex" }],
|
|
291
|
+
["inline-flex", { display: "inline-flex" }],
|
|
292
|
+
["flex-inline", { display: "inline-flex" }],
|
|
319
293
|
["flex-1", { flex: "1 1 0%" }],
|
|
320
294
|
["flex-auto", { flex: "1 1 auto" }],
|
|
321
295
|
["flex-initial", { flex: "0 1 auto" }],
|
|
322
296
|
["flex-none", { flex: "none" }],
|
|
323
297
|
[/^flex-\[(.+)\]$/, ([, d]) => ({ flex: d })],
|
|
324
|
-
["flex-grow", { "flex-grow": 1 }],
|
|
325
|
-
["flex-grow-0", { "flex-grow": 0 }],
|
|
326
298
|
["flex-shrink", { "flex-shrink": 1 }],
|
|
327
299
|
["flex-shrink-0", { "flex-shrink": 0 }],
|
|
328
|
-
["flex", {
|
|
329
|
-
["
|
|
330
|
-
["flex-
|
|
300
|
+
["flex-grow", { "flex-grow": 1 }],
|
|
301
|
+
["flex-grow-0", { "flex-grow": 0 }],
|
|
302
|
+
["flex-row", { "flex-direction": "row" }],
|
|
303
|
+
["flex-row-reverse", { "flex-direction": "row-reverse" }],
|
|
304
|
+
["flex-col", { "flex-direction": "column" }],
|
|
305
|
+
["flex-col-reverse", { "flex-direction": "column-reverse" }],
|
|
306
|
+
["flex-wrap", { "flex-wrap": "wrap" }],
|
|
307
|
+
["flex-wrap-reverse", { "flex-wrap": "wrap-reverse" }],
|
|
308
|
+
["flex-nowrap", { "flex-wrap": "nowrap" }]
|
|
331
309
|
];
|
|
332
310
|
|
|
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
311
|
const weightMap = {
|
|
344
312
|
thin: "100",
|
|
345
313
|
extralight: "200",
|
|
@@ -351,40 +319,48 @@ const weightMap = {
|
|
|
351
319
|
extrabold: "800",
|
|
352
320
|
black: "900"
|
|
353
321
|
};
|
|
354
|
-
const
|
|
355
|
-
[/^
|
|
356
|
-
const
|
|
357
|
-
if (
|
|
358
|
-
const [size, height = "1"] = result;
|
|
322
|
+
const fonts = [
|
|
323
|
+
[/^font-(\w+)$/, ([, d], { theme }) => {
|
|
324
|
+
const font = theme.fontFamily?.[d];
|
|
325
|
+
if (font) {
|
|
359
326
|
return {
|
|
360
|
-
"font-
|
|
327
|
+
"font-family": font
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
}],
|
|
331
|
+
[/^text-(.+)$/, ([, s = "base"], { theme }) => {
|
|
332
|
+
const size = index.handler.bracket.rem(s);
|
|
333
|
+
if (size)
|
|
334
|
+
return { "font-size": size };
|
|
335
|
+
const themed = core.toArray(theme.fontSize?.[s]);
|
|
336
|
+
if (themed?.[0]) {
|
|
337
|
+
const [size2, height] = themed;
|
|
338
|
+
return {
|
|
339
|
+
"font-size": size2,
|
|
361
340
|
"line-height": height
|
|
362
341
|
};
|
|
363
342
|
}
|
|
364
|
-
}]
|
|
365
|
-
]
|
|
366
|
-
const
|
|
343
|
+
}],
|
|
344
|
+
[/^text-size-(.+)$/, ([, s]) => {
|
|
345
|
+
const raw = index.handler.bracket.rem(s);
|
|
346
|
+
if (raw)
|
|
347
|
+
return { "font-size": raw };
|
|
348
|
+
}],
|
|
367
349
|
[/^(?:font|fw)-?([^-]+)$/, ([, s]) => {
|
|
368
350
|
const v = weightMap[s] || index.handler.number(s);
|
|
369
351
|
if (v)
|
|
370
352
|
return { "font-weight": v };
|
|
371
|
-
}]
|
|
372
|
-
];
|
|
373
|
-
const leadings = [
|
|
353
|
+
}],
|
|
374
354
|
[/^(?:leading|lh)-([^-]+)$/, ([, s], { theme }) => {
|
|
375
355
|
const v = theme.lineHeight?.[s] || index.handler.bracket.rem(s);
|
|
376
356
|
if (v !== null)
|
|
377
357
|
return { "line-height": v };
|
|
378
|
-
}]
|
|
379
|
-
];
|
|
380
|
-
const trackings = [
|
|
358
|
+
}],
|
|
381
359
|
[/^tracking-([^-]+)$/, ([, s], { theme }) => {
|
|
382
360
|
const v = theme.letterSpacing?.[s] || index.handler.bracket.rem(s);
|
|
383
361
|
if (v !== null)
|
|
384
362
|
return { "letter-spacing": v };
|
|
385
|
-
}]
|
|
386
|
-
];
|
|
387
|
-
const wordSpacings = [
|
|
363
|
+
}],
|
|
388
364
|
[/^word-spacing-([^-]+)$/, ([, s], { theme }) => {
|
|
389
365
|
const v = theme.wordSpacing?.[s] || index.handler.bracket.rem(s);
|
|
390
366
|
if (v !== null)
|
|
@@ -404,20 +380,6 @@ const tabSizes = [
|
|
|
404
380
|
}
|
|
405
381
|
}]
|
|
406
382
|
];
|
|
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
383
|
const textIndents = [
|
|
422
384
|
[/^indent(?:-(.+))?$/, ([, s], { theme }) => {
|
|
423
385
|
const v = theme.textIndent?.[s || "DEFAULT"] || index.handler.bracket.cssvar.fraction.rem(s);
|
|
@@ -425,12 +387,14 @@ const textIndents = [
|
|
|
425
387
|
return { "text-indent": v };
|
|
426
388
|
}]
|
|
427
389
|
];
|
|
428
|
-
const
|
|
390
|
+
const textStrokes = [
|
|
429
391
|
[/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => {
|
|
430
392
|
const v = theme.textStrokeWidth?.[s || "DEFAULT"] || index.handler.bracket.cssvar.px(s);
|
|
431
393
|
if (v != null)
|
|
432
394
|
return { "-webkit-text-stroke-width": v };
|
|
433
|
-
}]
|
|
395
|
+
}],
|
|
396
|
+
[/^text-stroke-(.+)$/, colorResolver$1("-webkit-text-stroke-color", "text-stroke")],
|
|
397
|
+
[/^text-stroke-op(?:acity)?-?(.+)$/m, ([, opacity]) => ({ "--un-text-stroke-opacity": index.handler.bracket.percent(opacity) })]
|
|
434
398
|
];
|
|
435
399
|
const textShadows = [
|
|
436
400
|
[/^text-shadow(?:-(.+))?$/, ([, s], { theme }) => {
|
|
@@ -439,11 +403,6 @@ const textShadows = [
|
|
|
439
403
|
return { "text-shadow": v };
|
|
440
404
|
}]
|
|
441
405
|
];
|
|
442
|
-
const fonts = [
|
|
443
|
-
fontsFamilies,
|
|
444
|
-
fontSizes,
|
|
445
|
-
fontWeights
|
|
446
|
-
].flat(1);
|
|
447
406
|
|
|
448
407
|
const gaps = [
|
|
449
408
|
[/^(?:flex-|grid-)?gap-([^-]+)$/, ([, s]) => {
|
|
@@ -488,12 +447,10 @@ const autoDirection = (selector, theme) => {
|
|
|
488
447
|
const grids = [
|
|
489
448
|
["grid", { display: "grid" }],
|
|
490
449
|
["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, " ") })],
|
|
450
|
+
[/^(?:grid-)?col-start-([\w.-]+)$/, ([, v]) => ({ "grid-column-start": `${v}` })],
|
|
451
|
+
[/^(?:grid-)?col-end-([\w.]+)$/, ([, v]) => ({ "grid-column-end": `${v}` })],
|
|
452
|
+
[/^(?:grid-)?row-start-([\w.-]+)$/, ([, v]) => ({ "grid-row-start": `${v}` })],
|
|
453
|
+
[/^(?:grid-)?row-end-([\w.-]+)$/, ([, v]) => ({ "grid-row-end": `${v}` })],
|
|
497
454
|
[/^(?:grid-)?(row|col)-(.+)$/, ([, d, v]) => {
|
|
498
455
|
const key = d === "row" ? "grid-row" : "grid-column";
|
|
499
456
|
let raw = index.handler.bracket(v);
|
|
@@ -510,13 +467,15 @@ const grids = [
|
|
|
510
467
|
return { [key]: `span ${raw}/span ${raw}` };
|
|
511
468
|
}
|
|
512
469
|
}],
|
|
470
|
+
[/^(?:grid-)?auto-cols-([\w.-]+)$/, ([, v], { theme }) => ({ "grid-auto-columns": `${autoDirection(v, theme)}` })],
|
|
513
471
|
[/^(?: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
472
|
[/^(?:grid-)?auto-rows-([\w.-]+)$/, ([, v], { theme }) => ({ "grid-auto-rows": `${autoDirection(v, theme)}` })],
|
|
519
|
-
[/^
|
|
473
|
+
[/^grid-cols-minmax-([\w.-]+)$/, ([, d]) => ({ "grid-template-columns": `repeat(auto-fill, minmax(${d}, 1fr))` })],
|
|
474
|
+
[/^grid-rows-minmax-([\w.-]+)$/, ([, d]) => ({ "grid-template-rows": `repeat(auto-fill, minmax(${d}, 1fr))` })],
|
|
475
|
+
[/^grid-cols-(\d+)$/, ([, d]) => ({ "grid-template-columns": `repeat(${d},minmax(0,1fr))` })],
|
|
476
|
+
[/^grid-rows-(\d+)$/, ([, d]) => ({ "grid-template-rows": `repeat(${d},minmax(0,1fr))` })],
|
|
477
|
+
[/^grid-cols-\[(.+)\]$/, ([, v]) => ({ "grid-template-columns": v.replace(/,/g, " ") })],
|
|
478
|
+
[/^grid-rows-\[(.+)\]$/, ([, v]) => ({ "grid-template-rows": v.replace(/,/g, " ") })]
|
|
520
479
|
];
|
|
521
480
|
|
|
522
481
|
const overflowValues = [
|
|
@@ -530,6 +489,7 @@ const overflows = [
|
|
|
530
489
|
[/^(?:overflow|of)-([xy])-(.+)$/, ([, d, v]) => overflowValues.includes(v) ? { [`overflow-${d}`]: v } : void 0]
|
|
531
490
|
];
|
|
532
491
|
|
|
492
|
+
const basicSet = ["auto", "start", "end", "center", "stretch"];
|
|
533
493
|
const positions = [
|
|
534
494
|
["relative", { position: "relative" }],
|
|
535
495
|
["absolute", { position: "absolute" }],
|
|
@@ -543,47 +503,42 @@ const justifies = [
|
|
|
543
503
|
["justify-center", { "justify-content": "center" }],
|
|
544
504
|
["justify-between", { "justify-content": "space-between" }],
|
|
545
505
|
["justify-around", { "justify-content": "space-around" }],
|
|
546
|
-
["justify-evenly", { "justify-content": "space-evenly" }]
|
|
506
|
+
["justify-evenly", { "justify-content": "space-evenly" }],
|
|
507
|
+
...basicSet.map((i) => [`justify-items-${i}`, { "justify-items": i }]),
|
|
508
|
+
...basicSet.map((i) => [`justify-self-${i}`, { "justify-self": i }])
|
|
547
509
|
];
|
|
548
510
|
const orders = [
|
|
549
511
|
[/^order-(.+)$/, ([, v]) => ({ order: { first: "-9999", last: "9999", none: "0" }[v] || index.handler.bracket.number(v) })]
|
|
550
512
|
];
|
|
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 = [
|
|
513
|
+
const alignments = [
|
|
555
514
|
["content-start", { "align-content": "flex-start" }],
|
|
556
515
|
["content-end", { "align-content": "flex-end" }],
|
|
557
516
|
["content-center", { "align-content": "center" }],
|
|
558
517
|
["content-between", { "align-content": "space-between" }],
|
|
559
518
|
["content-around", { "align-content": "space-around" }],
|
|
560
|
-
["content-evenly", { "align-content": "space-evenly" }]
|
|
561
|
-
];
|
|
562
|
-
const alignItems = [
|
|
519
|
+
["content-evenly", { "align-content": "space-evenly" }],
|
|
563
520
|
["items-start", { "align-items": "flex-start" }],
|
|
564
521
|
["items-end", { "align-items": "flex-end" }],
|
|
565
522
|
["items-center", { "align-items": "center" }],
|
|
566
523
|
["items-baseline", { "align-items": "baseline" }],
|
|
567
|
-
["items-stretch", { "align-items": "stretch" }]
|
|
568
|
-
];
|
|
569
|
-
const alignSelfs = [
|
|
524
|
+
["items-stretch", { "align-items": "stretch" }],
|
|
570
525
|
["self-auto", { "align-self": "auto" }],
|
|
571
526
|
["self-start", { "align-self": "flex-start" }],
|
|
572
527
|
["self-end", { "align-self": "flex-end" }],
|
|
573
528
|
["self-center", { "align-self": "center" }],
|
|
574
529
|
["self-stretch", { "align-items": "stretch" }]
|
|
575
530
|
];
|
|
576
|
-
const
|
|
531
|
+
const placements = [
|
|
577
532
|
["place-content-start", { "place-content": "start" }],
|
|
578
533
|
["place-content-end", { "place-content": "end" }],
|
|
579
534
|
["place-content-center", { "place-content": "center" }],
|
|
580
535
|
["place-content-between", { "place-content": "space-between" }],
|
|
581
536
|
["place-content-around", { "place-content": "space-around" }],
|
|
582
537
|
["place-content-evenly", { "place-content": "space-evenly" }],
|
|
583
|
-
["place-content-stretch", { "place-content": "stretch" }]
|
|
538
|
+
["place-content-stretch", { "place-content": "stretch" }],
|
|
539
|
+
...basicSet.map((i) => [`place-items-${i}`, { "place-items": i }]),
|
|
540
|
+
...basicSet.map((i) => [`place-self-${i}`, { "place-self": i }])
|
|
584
541
|
];
|
|
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
542
|
function handleInsetValue(v) {
|
|
588
543
|
return { auto: "auto", full: "100%" }[v] ?? index.handler.bracket.fraction.cssvar.rem(v);
|
|
589
544
|
}
|
|
@@ -774,17 +729,6 @@ const textTransforms = [
|
|
|
774
729
|
["case-capital", { "text-transform": "capitalize" }],
|
|
775
730
|
["case-normal", { "text-transform": "none" }]
|
|
776
731
|
];
|
|
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
732
|
const fontStyles = [
|
|
789
733
|
["italic", { "font-style": "italic" }],
|
|
790
734
|
["not-italic", { "font-style": "normal" }]
|
|
@@ -802,6 +746,14 @@ const fontSmoothings = [
|
|
|
802
746
|
}]
|
|
803
747
|
];
|
|
804
748
|
|
|
749
|
+
const transformGpu = {
|
|
750
|
+
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))",
|
|
751
|
+
[pseudo.CONTROL_BYPASS_PSEUDO]: ""
|
|
752
|
+
};
|
|
753
|
+
const transformCpu = {
|
|
754
|
+
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))",
|
|
755
|
+
[pseudo.CONTROL_BYPASS_PSEUDO]: ""
|
|
756
|
+
};
|
|
805
757
|
const transformBase = {
|
|
806
758
|
"--un-rotate": 0,
|
|
807
759
|
"--un-scale-x": 1,
|
|
@@ -812,8 +764,7 @@ const transformBase = {
|
|
|
812
764
|
"--un-translate-x": 0,
|
|
813
765
|
"--un-translate-y": 0,
|
|
814
766
|
"--un-translate-z": 0,
|
|
815
|
-
|
|
816
|
-
[pseudo.CONTROL_BYPASS_PSEUDO]: ""
|
|
767
|
+
...transformCpu
|
|
817
768
|
};
|
|
818
769
|
const transforms = [
|
|
819
770
|
["transform", transformBase],
|
|
@@ -823,6 +774,9 @@ const transforms = [
|
|
|
823
774
|
[/^scale()-([^-]+)$/, handleScale],
|
|
824
775
|
[/^scale-([xyz])-([^-]+)$/, handleScale],
|
|
825
776
|
[/^rotate-([^-]+)(?:deg)?$/, handleRotate],
|
|
777
|
+
["transform-gpu", transformGpu],
|
|
778
|
+
["transform-cpu", transformCpu],
|
|
779
|
+
["transform-none", { transform: "none" }],
|
|
826
780
|
["origin-center", { "transform-origin": "center" }],
|
|
827
781
|
["origin-top", { "transform-origin": "top" }],
|
|
828
782
|
["origin-top-right", { "transform-origin": "top right" }],
|
|
@@ -874,17 +828,8 @@ const variablesAbbrMap = {
|
|
|
874
828
|
"break": "word-break",
|
|
875
829
|
"color": "color",
|
|
876
830
|
"case": "text-transform",
|
|
877
|
-
"write": "writing-mode",
|
|
878
|
-
"write-orient": "text-orientation",
|
|
879
831
|
"origin": "transform-origin",
|
|
880
832
|
"bg": "background-color",
|
|
881
|
-
"bg-blend": "background-blend-mode",
|
|
882
|
-
"bg-clip": "-webkit-background-clip",
|
|
883
|
-
"bg-gradient": "linear-gradient",
|
|
884
|
-
"bg-origin-border": "background-origin",
|
|
885
|
-
"bg-position": "background-position",
|
|
886
|
-
"bg-repeat": "background-repeat",
|
|
887
|
-
"bg-size": "background-size",
|
|
888
833
|
"bg-opacity": "background-opacity",
|
|
889
834
|
"tab": "tab-size",
|
|
890
835
|
"underline": "text-decoration-thickness",
|
|
@@ -899,9 +844,7 @@ const variablesAbbrMap = {
|
|
|
899
844
|
"content": "align-content",
|
|
900
845
|
"items": "align-items",
|
|
901
846
|
"self": "align-self",
|
|
902
|
-
"object": "object-fit"
|
|
903
|
-
"mix-blend": "mix-blend-mode",
|
|
904
|
-
"animate-speed": "animation-speed"
|
|
847
|
+
"object": "object-fit"
|
|
905
848
|
};
|
|
906
849
|
const cssVariables = [[
|
|
907
850
|
/^(.+)-\$(.+)$/,
|
|
@@ -926,6 +869,33 @@ ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
|
|
|
926
869
|
]
|
|
927
870
|
];
|
|
928
871
|
|
|
872
|
+
const textDecorations = [
|
|
873
|
+
["underline", { "text-decoration": "underline" }],
|
|
874
|
+
["line-through", { "text-decoration": "line-through" }],
|
|
875
|
+
["no-underline", { "text-decoration": "none" }],
|
|
876
|
+
["decoration-underline", { "text-decoration": "underline" }],
|
|
877
|
+
["decoration-line-through", { "text-decoration": "line-through" }],
|
|
878
|
+
["decoration-none", { "text-decoration": "none" }],
|
|
879
|
+
[/^(?:underline|decoration)-(solid|double|dotted|dashed|wavy)$/, ([, d]) => ({ "text-decoration-style": d })],
|
|
880
|
+
[/^(?:underline|decoration)-([^-]+)$/, ([, s]) => ({ "text-decoration-thickness": ["auto", "from-font"].includes(s) ? s : index.handler.bracket.px(s) })],
|
|
881
|
+
[/^decoration-(.*)$/, ([, d]) => ({ "text-decoration-thickness": index.handler.bracket.px(d) })],
|
|
882
|
+
[/^underline-offset-([^-]+)$/, ([, s]) => {
|
|
883
|
+
const v = s === "auto" ? s : index.handler.bracket.px(s);
|
|
884
|
+
if (v != null)
|
|
885
|
+
return { "text-underline-offset": v };
|
|
886
|
+
}],
|
|
887
|
+
[/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
|
|
888
|
+
const result = colorResolver$1("text-decoration-color", "line")(match, ctx);
|
|
889
|
+
if (result) {
|
|
890
|
+
return {
|
|
891
|
+
"-webkit-text-decoration-color": result["text-decoration-color"],
|
|
892
|
+
...result
|
|
893
|
+
};
|
|
894
|
+
}
|
|
895
|
+
}],
|
|
896
|
+
[/^(?:underline|decoration)-op(?:acity)?-?(.+)$/m, ([, opacity]) => ({ "--un-line-opacity": index.handler.bracket.percent(opacity) })]
|
|
897
|
+
];
|
|
898
|
+
|
|
929
899
|
const rules = [
|
|
930
900
|
cssVariables,
|
|
931
901
|
paddings,
|
|
@@ -941,12 +911,7 @@ const rules = [
|
|
|
941
911
|
textIndents,
|
|
942
912
|
textOverflows,
|
|
943
913
|
textDecorations,
|
|
944
|
-
|
|
945
|
-
textDecorationColors,
|
|
946
|
-
textDecorationLengths,
|
|
947
|
-
textDecorationOffsets,
|
|
948
|
-
textStrokeWidths,
|
|
949
|
-
textStrokeColors,
|
|
914
|
+
textStrokes,
|
|
950
915
|
textShadows,
|
|
951
916
|
textTransforms,
|
|
952
917
|
textAligns,
|
|
@@ -969,9 +934,6 @@ const rules = [
|
|
|
969
934
|
userSelects,
|
|
970
935
|
whitespaces,
|
|
971
936
|
breaks,
|
|
972
|
-
trackings,
|
|
973
|
-
wordSpacings,
|
|
974
|
-
leadings,
|
|
975
937
|
overflows,
|
|
976
938
|
outline,
|
|
977
939
|
appearance,
|
|
@@ -979,14 +941,8 @@ const rules = [
|
|
|
979
941
|
positions,
|
|
980
942
|
orders,
|
|
981
943
|
justifies,
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
alignContents,
|
|
985
|
-
alignItems,
|
|
986
|
-
alignSelfs,
|
|
987
|
-
placeContents,
|
|
988
|
-
placeItems,
|
|
989
|
-
placeSelfs,
|
|
944
|
+
alignments,
|
|
945
|
+
placements,
|
|
990
946
|
insets,
|
|
991
947
|
floats,
|
|
992
948
|
zIndexes,
|
|
@@ -996,17 +952,12 @@ const rules = [
|
|
|
996
952
|
questionMark
|
|
997
953
|
].flat(1);
|
|
998
954
|
|
|
999
|
-
exports.
|
|
1000
|
-
exports.alignItems = alignItems;
|
|
1001
|
-
exports.alignSelfs = alignSelfs;
|
|
955
|
+
exports.alignments = alignments;
|
|
1002
956
|
exports.appearance = appearance;
|
|
1003
957
|
exports.appearances = appearances;
|
|
1004
958
|
exports.aspectRatio = aspectRatio;
|
|
1005
959
|
exports.bgColors = bgColors;
|
|
1006
960
|
exports.borderColors = borderColors;
|
|
1007
|
-
exports.borderRadius = borderRadius;
|
|
1008
|
-
exports.borderSizes = borderSizes;
|
|
1009
|
-
exports.borderStyles = borderStyles;
|
|
1010
961
|
exports.borders = borders;
|
|
1011
962
|
exports.boxShadows = boxShadows;
|
|
1012
963
|
exports.boxSizing = boxSizing;
|
|
@@ -1019,19 +970,13 @@ exports.displays = displays;
|
|
|
1019
970
|
exports.fillColors = fillColors;
|
|
1020
971
|
exports.flex = flex;
|
|
1021
972
|
exports.floats = floats;
|
|
1022
|
-
exports.fontSizes = fontSizes;
|
|
1023
973
|
exports.fontSmoothings = fontSmoothings;
|
|
1024
974
|
exports.fontStyles = fontStyles;
|
|
1025
|
-
exports.fontWeights = fontWeights;
|
|
1026
975
|
exports.fonts = fonts;
|
|
1027
|
-
exports.fontsFamilies = fontsFamilies;
|
|
1028
976
|
exports.gaps = gaps;
|
|
1029
977
|
exports.grids = grids;
|
|
1030
978
|
exports.insets = insets;
|
|
1031
979
|
exports.justifies = justifies;
|
|
1032
|
-
exports.justifyItems = justifyItems;
|
|
1033
|
-
exports.justifySelfs = justifySelfs;
|
|
1034
|
-
exports.leadings = leadings;
|
|
1035
980
|
exports.margins = margins;
|
|
1036
981
|
exports.opacity = opacity;
|
|
1037
982
|
exports.orders = orders;
|
|
@@ -1039,10 +984,8 @@ exports.outline = outline;
|
|
|
1039
984
|
exports.overflows = overflows;
|
|
1040
985
|
exports.paddings = paddings;
|
|
1041
986
|
exports.parseColorUtil = parseColorUtil;
|
|
1042
|
-
exports.placeContents = placeContents;
|
|
1043
|
-
exports.placeItems = placeItems;
|
|
1044
|
-
exports.placeSelfs = placeSelfs;
|
|
1045
987
|
exports.placeholder = placeholder;
|
|
988
|
+
exports.placements = placements;
|
|
1046
989
|
exports.pointerEvents = pointerEvents;
|
|
1047
990
|
exports.positions = positions;
|
|
1048
991
|
exports.questionMark = questionMark;
|
|
@@ -1055,23 +998,16 @@ exports.sizes = sizes;
|
|
|
1055
998
|
exports.tabSizes = tabSizes;
|
|
1056
999
|
exports.textAligns = textAligns;
|
|
1057
1000
|
exports.textColors = textColors;
|
|
1058
|
-
exports.textDecorationColors = textDecorationColors;
|
|
1059
|
-
exports.textDecorationLengths = textDecorationLengths;
|
|
1060
|
-
exports.textDecorationOffsets = textDecorationOffsets;
|
|
1061
|
-
exports.textDecorationStyles = textDecorationStyles;
|
|
1062
1001
|
exports.textDecorations = textDecorations;
|
|
1063
1002
|
exports.textIndents = textIndents;
|
|
1064
1003
|
exports.textOverflows = textOverflows;
|
|
1065
1004
|
exports.textShadows = textShadows;
|
|
1066
|
-
exports.
|
|
1067
|
-
exports.textStrokeWidths = textStrokeWidths;
|
|
1005
|
+
exports.textStrokes = textStrokes;
|
|
1068
1006
|
exports.textTransforms = textTransforms;
|
|
1069
|
-
exports.trackings = trackings;
|
|
1070
1007
|
exports.transforms = transforms;
|
|
1071
1008
|
exports.transitions = transitions;
|
|
1072
1009
|
exports.userSelects = userSelects;
|
|
1073
1010
|
exports.varEmpty = varEmpty;
|
|
1074
1011
|
exports.verticalAligns = verticalAligns;
|
|
1075
1012
|
exports.whitespaces = whitespaces;
|
|
1076
|
-
exports.wordSpacings = wordSpacings;
|
|
1077
1013
|
exports.zIndexes = zIndexes;
|