@unocss/preset-mini 0.39.3 → 0.41.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 +38 -22
- package/dist/chunks/default2.mjs +39 -23
- package/dist/chunks/default3.cjs +76 -16
- package/dist/chunks/default3.mjs +77 -18
- package/dist/chunks/transform.cjs +19 -9
- package/dist/chunks/transform.mjs +20 -10
- package/dist/chunks/utilities.cjs +6 -2
- package/dist/chunks/utilities.mjs +6 -3
- package/dist/chunks/variants.cjs +9 -3
- package/dist/chunks/variants.mjs +9 -3
- package/dist/index.cjs +4 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +4 -2
- package/dist/{utilities-c3da10e0.d.ts → utilities-02300cd4.d.ts} +3 -2
- package/dist/utils.cjs +1 -0
- package/dist/utils.d.ts +3 -3
- package/dist/utils.mjs +1 -1
- package/dist/variants.cjs +1 -0
- package/dist/variants.d.ts +3 -2
- package/dist/variants.mjs +1 -1
- package/package.json +2 -2
package/dist/chunks/default2.cjs
CHANGED
|
@@ -15,17 +15,18 @@ const verticalAlignAlias = {
|
|
|
15
15
|
"text-top": "text-top",
|
|
16
16
|
"text-bottom": "text-bottom",
|
|
17
17
|
"sub": "sub",
|
|
18
|
-
"super": "super"
|
|
18
|
+
"super": "super",
|
|
19
|
+
...Object.fromEntries(utilities.globalKeywords.map((x) => [x, x]))
|
|
19
20
|
};
|
|
20
21
|
const verticalAligns = [
|
|
21
|
-
[/^(?:vertical|align|v)-(
|
|
22
|
+
[/^(?:vertical|align|v)-([-\w]+)$/, ([, v]) => ({ "vertical-align": verticalAlignAlias[v] }), { autocomplete: `(vertical|align|v)-(${Object.keys(verticalAlignAlias).join("|")})` }]
|
|
22
23
|
];
|
|
23
24
|
const textAligns = ["center", "left", "right", "justify", "start", "end", ...utilities.globalKeywords].map((v) => [`text-${v}`, { "text-align": v }]);
|
|
24
25
|
|
|
25
26
|
const outline = [
|
|
26
|
-
[/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) }), { autocomplete: "outline-(width|size)-<num>" }],
|
|
27
|
+
[/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.global.px(d) }), { autocomplete: "outline-(width|size)-<num>" }],
|
|
27
28
|
[/^outline-(?:color-)?(.+)$/, utilities.colorResolver("outline-color", "outline-color"), { autocomplete: "outline-$colors" }],
|
|
28
|
-
[/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) }), { autocomplete: "outline-(offset)-<num>" }],
|
|
29
|
+
[/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.global.px(d) }), { autocomplete: "outline-(offset)-<num>" }],
|
|
29
30
|
["outline", { "outline-style": "solid" }],
|
|
30
31
|
...["auto", "dashed", "dotted", "double", "hidden", "solid", "groove", "ridge", "inset", "outset", ...utilities.globalKeywords].map((v) => [`outline-${v}`, { "outline-style": v }]),
|
|
31
32
|
["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }]
|
|
@@ -119,7 +120,7 @@ function handlerBorder(m, ctx) {
|
|
|
119
120
|
}
|
|
120
121
|
}
|
|
121
122
|
function handlerBorderSize([, a = "", b], { theme }) {
|
|
122
|
-
const v = theme.lineWidth?.[b || "DEFAULT"] ?? utilities.handler.bracket.cssvar.px(b || "1");
|
|
123
|
+
const v = theme.lineWidth?.[b || "DEFAULT"] ?? utilities.handler.bracket.cssvar.global.px(b || "1");
|
|
123
124
|
if (a in utilities.directionMap && v != null)
|
|
124
125
|
return utilities.directionMap[a].map((i) => [`border${i}-width`, v]);
|
|
125
126
|
}
|
|
@@ -134,7 +135,7 @@ function handlerBorderOpacity([, a = "", opacity]) {
|
|
|
134
135
|
return utilities.directionMap[a].map((i) => [`--un-border${i}-opacity`, v]);
|
|
135
136
|
}
|
|
136
137
|
function handlerRounded([, a = "", s], { theme }) {
|
|
137
|
-
const v = theme.borderRadius?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.fraction.rem(s || "1");
|
|
138
|
+
const v = theme.borderRadius?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.global.fraction.rem(s || "1");
|
|
138
139
|
if (a in utilities.cornerMap && v != null)
|
|
139
140
|
return utilities.cornerMap[a].map((i) => [`border${i}-radius`, v]);
|
|
140
141
|
}
|
|
@@ -198,7 +199,8 @@ const transitions = [
|
|
|
198
199
|
([, v]) => ({ "transition-property": utilities.handler.global(v) || transitionProperty(v) }),
|
|
199
200
|
{ autocomplete: [`transition-property-(${[...utilities.globalKeywords, ...Object.keys(transitionPropertyGroup)].join("|")})`] }
|
|
200
201
|
],
|
|
201
|
-
["transition-none", { transition: "none" }]
|
|
202
|
+
["transition-none", { transition: "none" }],
|
|
203
|
+
...utilities.makeGlobalStaticRules("transition")
|
|
202
204
|
];
|
|
203
205
|
|
|
204
206
|
const flex = [
|
|
@@ -258,7 +260,7 @@ const fonts = [
|
|
|
258
260
|
],
|
|
259
261
|
[/^text-size-(.+)$/, ([, s], { theme }) => {
|
|
260
262
|
const themed = core.toArray(theme.fontSize?.[s]);
|
|
261
|
-
const size = themed?.[0] ?? utilities.handler.bracket.cssvar.rem(s);
|
|
263
|
+
const size = themed?.[0] ?? utilities.handler.bracket.cssvar.global.rem(s);
|
|
262
264
|
if (size != null)
|
|
263
265
|
return { "font-size": size };
|
|
264
266
|
}, { autocomplete: "text-size-$fontSize" }],
|
|
@@ -317,7 +319,7 @@ const textShadows = [
|
|
|
317
319
|
"text-shadow": "var(--un-text-shadow)"
|
|
318
320
|
};
|
|
319
321
|
}
|
|
320
|
-
return { "text-shadow": utilities.handler.bracket.cssvar(s) };
|
|
322
|
+
return { "text-shadow": utilities.handler.bracket.cssvar.global(s) };
|
|
321
323
|
}, { autocomplete: "text-shadow-$textShadow" }],
|
|
322
324
|
[/^text-shadow-color-(.+)$/, utilities.colorResolver("--un-text-shadow-color", "text-shadow"), { autocomplete: "text-shadow-color-$colors" }],
|
|
323
325
|
[/^text-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-shadow-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "text-shadow-color-(op|opacity)-<percent>" }]
|
|
@@ -329,7 +331,7 @@ const directions = {
|
|
|
329
331
|
"y": "row-"
|
|
330
332
|
};
|
|
331
333
|
const handleGap = ([, d = "", s], { theme }) => {
|
|
332
|
-
const v = theme.spacing?.[s] ?? utilities.handler.bracket.cssvar.rem(s);
|
|
334
|
+
const v = theme.spacing?.[s] ?? utilities.handler.bracket.cssvar.global.rem(s);
|
|
333
335
|
if (v != null) {
|
|
334
336
|
return {
|
|
335
337
|
[`grid-${directions[d]}gap`]: v,
|
|
@@ -390,7 +392,8 @@ const overflowValues = [
|
|
|
390
392
|
"hidden",
|
|
391
393
|
"clip",
|
|
392
394
|
"visible",
|
|
393
|
-
"scroll"
|
|
395
|
+
"scroll",
|
|
396
|
+
...utilities.globalKeywords
|
|
394
397
|
];
|
|
395
398
|
const overflows = [
|
|
396
399
|
[/^(?:overflow|of)-(.+)$/, ([, v]) => overflowValues.includes(v) ? { overflow: v } : void 0, { autocomplete: [`(overflow|of)-(${overflowValues.join("|")})`, `(overflow|of)-(x|y)-(${overflowValues.join("|")})`] }],
|
|
@@ -399,6 +402,7 @@ const overflows = [
|
|
|
399
402
|
|
|
400
403
|
const positions = [
|
|
401
404
|
[/^(?:position-|pos-)?(relative|absolute|fixed|sticky)$/, ([, v]) => ({ position: v })],
|
|
405
|
+
[/^(?:position-|pos-)([-\w]+)$/, ([, v]) => utilities.globalKeywords.includes(v) ? { position: v } : void 0],
|
|
402
406
|
[/^(?:position-|pos-)?(static)$/, ([, v]) => ({ position: v })]
|
|
403
407
|
];
|
|
404
408
|
const justifies = [
|
|
@@ -408,15 +412,18 @@ const justifies = [
|
|
|
408
412
|
["justify-between", { "justify-content": "space-between" }],
|
|
409
413
|
["justify-around", { "justify-content": "space-around" }],
|
|
410
414
|
["justify-evenly", { "justify-content": "space-evenly" }],
|
|
415
|
+
...utilities.makeGlobalStaticRules("justify", "justify-content"),
|
|
411
416
|
["justify-items-start", { "justify-items": "start" }],
|
|
412
417
|
["justify-items-end", { "justify-items": "end" }],
|
|
413
418
|
["justify-items-center", { "justify-items": "center" }],
|
|
414
419
|
["justify-items-stretch", { "justify-items": "stretch" }],
|
|
420
|
+
...utilities.makeGlobalStaticRules("justify-items"),
|
|
415
421
|
["justify-self-auto", { "justify-self": "auto" }],
|
|
416
422
|
["justify-self-start", { "justify-self": "start" }],
|
|
417
423
|
["justify-self-end", { "justify-self": "end" }],
|
|
418
424
|
["justify-self-center", { "justify-self": "center" }],
|
|
419
|
-
["justify-self-stretch", { "justify-self": "stretch" }]
|
|
425
|
+
["justify-self-stretch", { "justify-self": "stretch" }],
|
|
426
|
+
...utilities.makeGlobalStaticRules("justify-self")
|
|
420
427
|
];
|
|
421
428
|
const orders = [
|
|
422
429
|
[/^order-(.+)$/, ([, v]) => ({ order: utilities.handler.bracket.cssvar.number(v) })],
|
|
@@ -431,17 +438,20 @@ const alignments = [
|
|
|
431
438
|
["content-between", { "align-content": "space-between" }],
|
|
432
439
|
["content-around", { "align-content": "space-around" }],
|
|
433
440
|
["content-evenly", { "align-content": "space-evenly" }],
|
|
441
|
+
...utilities.makeGlobalStaticRules("content", "align-content"),
|
|
434
442
|
["items-start", { "align-items": "flex-start" }],
|
|
435
443
|
["items-end", { "align-items": "flex-end" }],
|
|
436
444
|
["items-center", { "align-items": "center" }],
|
|
437
445
|
["items-baseline", { "align-items": "baseline" }],
|
|
438
446
|
["items-stretch", { "align-items": "stretch" }],
|
|
447
|
+
...utilities.makeGlobalStaticRules("items", "align-items"),
|
|
439
448
|
["self-auto", { "align-self": "auto" }],
|
|
440
449
|
["self-start", { "align-self": "flex-start" }],
|
|
441
450
|
["self-end", { "align-self": "flex-end" }],
|
|
442
451
|
["self-center", { "align-self": "center" }],
|
|
443
452
|
["self-stretch", { "align-self": "stretch" }],
|
|
444
|
-
["self-baseline", { "align-self": "baseline" }]
|
|
453
|
+
["self-baseline", { "align-self": "baseline" }],
|
|
454
|
+
...utilities.makeGlobalStaticRules("self", "align-self")
|
|
445
455
|
];
|
|
446
456
|
const placements = [
|
|
447
457
|
["place-content-center", { "place-content": "center" }],
|
|
@@ -451,18 +461,21 @@ const placements = [
|
|
|
451
461
|
["place-content-around", { "place-content": "space-around" }],
|
|
452
462
|
["place-content-evenly", { "place-content": "space-evenly" }],
|
|
453
463
|
["place-content-stretch", { "place-content": "stretch" }],
|
|
464
|
+
...utilities.makeGlobalStaticRules("place-content"),
|
|
454
465
|
["place-items-start", { "place-items": "start" }],
|
|
455
466
|
["place-items-end", { "place-items": "end" }],
|
|
456
467
|
["place-items-center", { "place-items": "center" }],
|
|
457
468
|
["place-items-stretch", { "place-items": "stretch" }],
|
|
469
|
+
...utilities.makeGlobalStaticRules("place-items"),
|
|
458
470
|
["place-self-auto", { "place-self": "auto" }],
|
|
459
471
|
["place-self-start", { "place-self": "start" }],
|
|
460
472
|
["place-self-end", { "place-self": "end" }],
|
|
461
473
|
["place-self-center", { "place-self": "center" }],
|
|
462
|
-
["place-self-stretch", { "place-self": "stretch" }]
|
|
474
|
+
["place-self-stretch", { "place-self": "stretch" }],
|
|
475
|
+
...utilities.makeGlobalStaticRules("place-self")
|
|
463
476
|
];
|
|
464
477
|
function handleInsetValue(v, { theme }) {
|
|
465
|
-
return theme.spacing?.[v] ?? utilities.handler.bracket.cssvar.auto.fraction.rem(v);
|
|
478
|
+
return theme.spacing?.[v] ?? utilities.handler.bracket.cssvar.global.auto.fraction.rem(v);
|
|
466
479
|
}
|
|
467
480
|
function handleInsetValues([, d, v], ctx) {
|
|
468
481
|
const r = handleInsetValue(v, ctx);
|
|
@@ -492,18 +505,21 @@ const floats = [
|
|
|
492
505
|
["float-left", { float: "left" }],
|
|
493
506
|
["float-right", { float: "right" }],
|
|
494
507
|
["float-none", { float: "none" }],
|
|
508
|
+
...utilities.makeGlobalStaticRules("float"),
|
|
495
509
|
["clear-left", { clear: "left" }],
|
|
496
510
|
["clear-right", { clear: "right" }],
|
|
497
511
|
["clear-both", { clear: "both" }],
|
|
498
|
-
["clear-none", { clear: "none" }]
|
|
512
|
+
["clear-none", { clear: "none" }],
|
|
513
|
+
...utilities.makeGlobalStaticRules("clear")
|
|
499
514
|
];
|
|
500
515
|
const zIndexes = [
|
|
501
516
|
[/^z([\d.]+)$/, ([, v]) => ({ "z-index": utilities.handler.number(v) })],
|
|
502
|
-
[/^z-(.+)$/, ([, v]) => ({ "z-index": utilities.handler.bracket.cssvar.auto.number(v) }), { autocomplete: "z-<num>" }]
|
|
517
|
+
[/^z-(.+)$/, ([, v]) => ({ "z-index": utilities.handler.bracket.cssvar.global.auto.number(v) }), { autocomplete: "z-<num>" }]
|
|
503
518
|
];
|
|
504
519
|
const boxSizing = [
|
|
505
520
|
["box-border", { "box-sizing": "border-box" }],
|
|
506
|
-
["box-content", { "box-sizing": "content-box" }]
|
|
521
|
+
["box-content", { "box-sizing": "content-box" }],
|
|
522
|
+
...utilities.makeGlobalStaticRules("box", "box-sizing")
|
|
507
523
|
];
|
|
508
524
|
|
|
509
525
|
const sizeMapping = {
|
|
@@ -526,7 +542,7 @@ function getSizeValue(minmax, hw, theme, prop) {
|
|
|
526
542
|
case "min":
|
|
527
543
|
return `${prop}-content`;
|
|
528
544
|
}
|
|
529
|
-
return utilities.handler.bracket.cssvar.auto.fraction.rem(prop);
|
|
545
|
+
return utilities.handler.bracket.cssvar.global.auto.fraction.rem(prop);
|
|
530
546
|
}
|
|
531
547
|
const sizes = [
|
|
532
548
|
[
|
|
@@ -561,7 +577,7 @@ function getAspectRatio(prop) {
|
|
|
561
577
|
case "video":
|
|
562
578
|
return "16/9";
|
|
563
579
|
}
|
|
564
|
-
return utilities.handler.bracket.cssvar.auto.number(prop);
|
|
580
|
+
return utilities.handler.bracket.cssvar.global.auto.number(prop);
|
|
565
581
|
}
|
|
566
582
|
const aspectRatio = [
|
|
567
583
|
[/^aspect-(?:ratio-)?(.+)$/, ([, d]) => ({ "aspect-ratio": getAspectRatio(d) }), { autocomplete: ["aspect-(square|video)", "aspect-ratio-(square|video)"] }]
|
|
@@ -624,7 +640,7 @@ ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
|
|
|
624
640
|
const decorationStyles = ["solid", "double", "dotted", "dashed", "wavy", ...utilities.globalKeywords];
|
|
625
641
|
const textDecorations = [
|
|
626
642
|
[/^(?:decoration-)?(underline|overline|line-through)$/, ([, s]) => ({ "text-decoration-line": s }), { autocomplete: "decoration-(underline|overline|line-through)" }],
|
|
627
|
-
[/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? utilities.handler.bracket.cssvar.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
|
|
643
|
+
[/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? utilities.handler.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
|
|
628
644
|
[/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s }), { autocomplete: "(underline|decoration)-(auto|from-font)" }],
|
|
629
645
|
[/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
|
|
630
646
|
const result = utilities.colorResolver("text-decoration-color", "line")(match, ctx);
|
|
@@ -636,7 +652,7 @@ const textDecorations = [
|
|
|
636
652
|
}
|
|
637
653
|
}, { autocomplete: "(underline|decoration)-$colors" }],
|
|
638
654
|
[/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "(underline|decoration)-(op|opacity)-<percent>" }],
|
|
639
|
-
[/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? utilities.handler.auto.bracket.cssvar.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
|
|
655
|
+
[/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? utilities.handler.auto.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
|
|
640
656
|
...decorationStyles.map((v) => [`underline-${v}`, { "text-decoration-style": v }]),
|
|
641
657
|
...decorationStyles.map((v) => [`decoration-${v}`, { "text-decoration-style": v }]),
|
|
642
658
|
["no-underline", { "text-decoration": "none" }],
|
package/dist/chunks/default2.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as globalKeywords, h as handler, c as colorResolver, d as directionMap, a as hasParseableColor, p as parseColor, b as colorToString, e as colorOpacityToString, f as cornerMap, i as colorableShadows, j as insetMap, r as resolveVerticalBreakpoints, k as resolveBreakpoints, l as directionSize } from './utilities.mjs';
|
|
1
|
+
import { g as globalKeywords, h as handler, c as colorResolver, d as directionMap, a as hasParseableColor, p as parseColor, b as colorToString, e as colorOpacityToString, f as cornerMap, m as makeGlobalStaticRules, i as colorableShadows, j as insetMap, r as resolveVerticalBreakpoints, k as resolveBreakpoints, l as directionSize } from './utilities.mjs';
|
|
2
2
|
import { toArray } from '@unocss/core';
|
|
3
3
|
import { d as displays, c as contents, a as textOverflows, e as textTransforms, f as fontStyles, g as fontSmoothings, h as boxShadows, i as rings, j as cursors, k as appearances, p as pointerEvents, l as resizes, u as userSelects, w as whitespaces, m as breaks, n as transforms } from './transform.mjs';
|
|
4
4
|
|
|
@@ -13,17 +13,18 @@ const verticalAlignAlias = {
|
|
|
13
13
|
"text-top": "text-top",
|
|
14
14
|
"text-bottom": "text-bottom",
|
|
15
15
|
"sub": "sub",
|
|
16
|
-
"super": "super"
|
|
16
|
+
"super": "super",
|
|
17
|
+
...Object.fromEntries(globalKeywords.map((x) => [x, x]))
|
|
17
18
|
};
|
|
18
19
|
const verticalAligns = [
|
|
19
|
-
[/^(?:vertical|align|v)-(
|
|
20
|
+
[/^(?:vertical|align|v)-([-\w]+)$/, ([, v]) => ({ "vertical-align": verticalAlignAlias[v] }), { autocomplete: `(vertical|align|v)-(${Object.keys(verticalAlignAlias).join("|")})` }]
|
|
20
21
|
];
|
|
21
22
|
const textAligns = ["center", "left", "right", "justify", "start", "end", ...globalKeywords].map((v) => [`text-${v}`, { "text-align": v }]);
|
|
22
23
|
|
|
23
24
|
const outline = [
|
|
24
|
-
[/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ?? handler.bracket.cssvar.px(d) }), { autocomplete: "outline-(width|size)-<num>" }],
|
|
25
|
+
[/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ?? handler.bracket.cssvar.global.px(d) }), { autocomplete: "outline-(width|size)-<num>" }],
|
|
25
26
|
[/^outline-(?:color-)?(.+)$/, colorResolver("outline-color", "outline-color"), { autocomplete: "outline-$colors" }],
|
|
26
|
-
[/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ?? handler.bracket.cssvar.px(d) }), { autocomplete: "outline-(offset)-<num>" }],
|
|
27
|
+
[/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ?? handler.bracket.cssvar.global.px(d) }), { autocomplete: "outline-(offset)-<num>" }],
|
|
27
28
|
["outline", { "outline-style": "solid" }],
|
|
28
29
|
...["auto", "dashed", "dotted", "double", "hidden", "solid", "groove", "ridge", "inset", "outset", ...globalKeywords].map((v) => [`outline-${v}`, { "outline-style": v }]),
|
|
29
30
|
["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }]
|
|
@@ -117,7 +118,7 @@ function handlerBorder(m, ctx) {
|
|
|
117
118
|
}
|
|
118
119
|
}
|
|
119
120
|
function handlerBorderSize([, a = "", b], { theme }) {
|
|
120
|
-
const v = theme.lineWidth?.[b || "DEFAULT"] ?? handler.bracket.cssvar.px(b || "1");
|
|
121
|
+
const v = theme.lineWidth?.[b || "DEFAULT"] ?? handler.bracket.cssvar.global.px(b || "1");
|
|
121
122
|
if (a in directionMap && v != null)
|
|
122
123
|
return directionMap[a].map((i) => [`border${i}-width`, v]);
|
|
123
124
|
}
|
|
@@ -132,7 +133,7 @@ function handlerBorderOpacity([, a = "", opacity]) {
|
|
|
132
133
|
return directionMap[a].map((i) => [`--un-border${i}-opacity`, v]);
|
|
133
134
|
}
|
|
134
135
|
function handlerRounded([, a = "", s], { theme }) {
|
|
135
|
-
const v = theme.borderRadius?.[s || "DEFAULT"] || handler.bracket.cssvar.fraction.rem(s || "1");
|
|
136
|
+
const v = theme.borderRadius?.[s || "DEFAULT"] || handler.bracket.cssvar.global.fraction.rem(s || "1");
|
|
136
137
|
if (a in cornerMap && v != null)
|
|
137
138
|
return cornerMap[a].map((i) => [`border${i}-radius`, v]);
|
|
138
139
|
}
|
|
@@ -196,7 +197,8 @@ const transitions = [
|
|
|
196
197
|
([, v]) => ({ "transition-property": handler.global(v) || transitionProperty(v) }),
|
|
197
198
|
{ autocomplete: [`transition-property-(${[...globalKeywords, ...Object.keys(transitionPropertyGroup)].join("|")})`] }
|
|
198
199
|
],
|
|
199
|
-
["transition-none", { transition: "none" }]
|
|
200
|
+
["transition-none", { transition: "none" }],
|
|
201
|
+
...makeGlobalStaticRules("transition")
|
|
200
202
|
];
|
|
201
203
|
|
|
202
204
|
const flex = [
|
|
@@ -256,7 +258,7 @@ const fonts = [
|
|
|
256
258
|
],
|
|
257
259
|
[/^text-size-(.+)$/, ([, s], { theme }) => {
|
|
258
260
|
const themed = toArray(theme.fontSize?.[s]);
|
|
259
|
-
const size = themed?.[0] ?? handler.bracket.cssvar.rem(s);
|
|
261
|
+
const size = themed?.[0] ?? handler.bracket.cssvar.global.rem(s);
|
|
260
262
|
if (size != null)
|
|
261
263
|
return { "font-size": size };
|
|
262
264
|
}, { autocomplete: "text-size-$fontSize" }],
|
|
@@ -315,7 +317,7 @@ const textShadows = [
|
|
|
315
317
|
"text-shadow": "var(--un-text-shadow)"
|
|
316
318
|
};
|
|
317
319
|
}
|
|
318
|
-
return { "text-shadow": handler.bracket.cssvar(s) };
|
|
320
|
+
return { "text-shadow": handler.bracket.cssvar.global(s) };
|
|
319
321
|
}, { autocomplete: "text-shadow-$textShadow" }],
|
|
320
322
|
[/^text-shadow-color-(.+)$/, colorResolver("--un-text-shadow-color", "text-shadow"), { autocomplete: "text-shadow-color-$colors" }],
|
|
321
323
|
[/^text-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-shadow-opacity": handler.bracket.percent(opacity) }), { autocomplete: "text-shadow-color-(op|opacity)-<percent>" }]
|
|
@@ -327,7 +329,7 @@ const directions = {
|
|
|
327
329
|
"y": "row-"
|
|
328
330
|
};
|
|
329
331
|
const handleGap = ([, d = "", s], { theme }) => {
|
|
330
|
-
const v = theme.spacing?.[s] ?? handler.bracket.cssvar.rem(s);
|
|
332
|
+
const v = theme.spacing?.[s] ?? handler.bracket.cssvar.global.rem(s);
|
|
331
333
|
if (v != null) {
|
|
332
334
|
return {
|
|
333
335
|
[`grid-${directions[d]}gap`]: v,
|
|
@@ -388,7 +390,8 @@ const overflowValues = [
|
|
|
388
390
|
"hidden",
|
|
389
391
|
"clip",
|
|
390
392
|
"visible",
|
|
391
|
-
"scroll"
|
|
393
|
+
"scroll",
|
|
394
|
+
...globalKeywords
|
|
392
395
|
];
|
|
393
396
|
const overflows = [
|
|
394
397
|
[/^(?:overflow|of)-(.+)$/, ([, v]) => overflowValues.includes(v) ? { overflow: v } : void 0, { autocomplete: [`(overflow|of)-(${overflowValues.join("|")})`, `(overflow|of)-(x|y)-(${overflowValues.join("|")})`] }],
|
|
@@ -397,6 +400,7 @@ const overflows = [
|
|
|
397
400
|
|
|
398
401
|
const positions = [
|
|
399
402
|
[/^(?:position-|pos-)?(relative|absolute|fixed|sticky)$/, ([, v]) => ({ position: v })],
|
|
403
|
+
[/^(?:position-|pos-)([-\w]+)$/, ([, v]) => globalKeywords.includes(v) ? { position: v } : void 0],
|
|
400
404
|
[/^(?:position-|pos-)?(static)$/, ([, v]) => ({ position: v })]
|
|
401
405
|
];
|
|
402
406
|
const justifies = [
|
|
@@ -406,15 +410,18 @@ const justifies = [
|
|
|
406
410
|
["justify-between", { "justify-content": "space-between" }],
|
|
407
411
|
["justify-around", { "justify-content": "space-around" }],
|
|
408
412
|
["justify-evenly", { "justify-content": "space-evenly" }],
|
|
413
|
+
...makeGlobalStaticRules("justify", "justify-content"),
|
|
409
414
|
["justify-items-start", { "justify-items": "start" }],
|
|
410
415
|
["justify-items-end", { "justify-items": "end" }],
|
|
411
416
|
["justify-items-center", { "justify-items": "center" }],
|
|
412
417
|
["justify-items-stretch", { "justify-items": "stretch" }],
|
|
418
|
+
...makeGlobalStaticRules("justify-items"),
|
|
413
419
|
["justify-self-auto", { "justify-self": "auto" }],
|
|
414
420
|
["justify-self-start", { "justify-self": "start" }],
|
|
415
421
|
["justify-self-end", { "justify-self": "end" }],
|
|
416
422
|
["justify-self-center", { "justify-self": "center" }],
|
|
417
|
-
["justify-self-stretch", { "justify-self": "stretch" }]
|
|
423
|
+
["justify-self-stretch", { "justify-self": "stretch" }],
|
|
424
|
+
...makeGlobalStaticRules("justify-self")
|
|
418
425
|
];
|
|
419
426
|
const orders = [
|
|
420
427
|
[/^order-(.+)$/, ([, v]) => ({ order: handler.bracket.cssvar.number(v) })],
|
|
@@ -429,17 +436,20 @@ const alignments = [
|
|
|
429
436
|
["content-between", { "align-content": "space-between" }],
|
|
430
437
|
["content-around", { "align-content": "space-around" }],
|
|
431
438
|
["content-evenly", { "align-content": "space-evenly" }],
|
|
439
|
+
...makeGlobalStaticRules("content", "align-content"),
|
|
432
440
|
["items-start", { "align-items": "flex-start" }],
|
|
433
441
|
["items-end", { "align-items": "flex-end" }],
|
|
434
442
|
["items-center", { "align-items": "center" }],
|
|
435
443
|
["items-baseline", { "align-items": "baseline" }],
|
|
436
444
|
["items-stretch", { "align-items": "stretch" }],
|
|
445
|
+
...makeGlobalStaticRules("items", "align-items"),
|
|
437
446
|
["self-auto", { "align-self": "auto" }],
|
|
438
447
|
["self-start", { "align-self": "flex-start" }],
|
|
439
448
|
["self-end", { "align-self": "flex-end" }],
|
|
440
449
|
["self-center", { "align-self": "center" }],
|
|
441
450
|
["self-stretch", { "align-self": "stretch" }],
|
|
442
|
-
["self-baseline", { "align-self": "baseline" }]
|
|
451
|
+
["self-baseline", { "align-self": "baseline" }],
|
|
452
|
+
...makeGlobalStaticRules("self", "align-self")
|
|
443
453
|
];
|
|
444
454
|
const placements = [
|
|
445
455
|
["place-content-center", { "place-content": "center" }],
|
|
@@ -449,18 +459,21 @@ const placements = [
|
|
|
449
459
|
["place-content-around", { "place-content": "space-around" }],
|
|
450
460
|
["place-content-evenly", { "place-content": "space-evenly" }],
|
|
451
461
|
["place-content-stretch", { "place-content": "stretch" }],
|
|
462
|
+
...makeGlobalStaticRules("place-content"),
|
|
452
463
|
["place-items-start", { "place-items": "start" }],
|
|
453
464
|
["place-items-end", { "place-items": "end" }],
|
|
454
465
|
["place-items-center", { "place-items": "center" }],
|
|
455
466
|
["place-items-stretch", { "place-items": "stretch" }],
|
|
467
|
+
...makeGlobalStaticRules("place-items"),
|
|
456
468
|
["place-self-auto", { "place-self": "auto" }],
|
|
457
469
|
["place-self-start", { "place-self": "start" }],
|
|
458
470
|
["place-self-end", { "place-self": "end" }],
|
|
459
471
|
["place-self-center", { "place-self": "center" }],
|
|
460
|
-
["place-self-stretch", { "place-self": "stretch" }]
|
|
472
|
+
["place-self-stretch", { "place-self": "stretch" }],
|
|
473
|
+
...makeGlobalStaticRules("place-self")
|
|
461
474
|
];
|
|
462
475
|
function handleInsetValue(v, { theme }) {
|
|
463
|
-
return theme.spacing?.[v] ?? handler.bracket.cssvar.auto.fraction.rem(v);
|
|
476
|
+
return theme.spacing?.[v] ?? handler.bracket.cssvar.global.auto.fraction.rem(v);
|
|
464
477
|
}
|
|
465
478
|
function handleInsetValues([, d, v], ctx) {
|
|
466
479
|
const r = handleInsetValue(v, ctx);
|
|
@@ -490,18 +503,21 @@ const floats = [
|
|
|
490
503
|
["float-left", { float: "left" }],
|
|
491
504
|
["float-right", { float: "right" }],
|
|
492
505
|
["float-none", { float: "none" }],
|
|
506
|
+
...makeGlobalStaticRules("float"),
|
|
493
507
|
["clear-left", { clear: "left" }],
|
|
494
508
|
["clear-right", { clear: "right" }],
|
|
495
509
|
["clear-both", { clear: "both" }],
|
|
496
|
-
["clear-none", { clear: "none" }]
|
|
510
|
+
["clear-none", { clear: "none" }],
|
|
511
|
+
...makeGlobalStaticRules("clear")
|
|
497
512
|
];
|
|
498
513
|
const zIndexes = [
|
|
499
514
|
[/^z([\d.]+)$/, ([, v]) => ({ "z-index": handler.number(v) })],
|
|
500
|
-
[/^z-(.+)$/, ([, v]) => ({ "z-index": handler.bracket.cssvar.auto.number(v) }), { autocomplete: "z-<num>" }]
|
|
515
|
+
[/^z-(.+)$/, ([, v]) => ({ "z-index": handler.bracket.cssvar.global.auto.number(v) }), { autocomplete: "z-<num>" }]
|
|
501
516
|
];
|
|
502
517
|
const boxSizing = [
|
|
503
518
|
["box-border", { "box-sizing": "border-box" }],
|
|
504
|
-
["box-content", { "box-sizing": "content-box" }]
|
|
519
|
+
["box-content", { "box-sizing": "content-box" }],
|
|
520
|
+
...makeGlobalStaticRules("box", "box-sizing")
|
|
505
521
|
];
|
|
506
522
|
|
|
507
523
|
const sizeMapping = {
|
|
@@ -524,7 +540,7 @@ function getSizeValue(minmax, hw, theme, prop) {
|
|
|
524
540
|
case "min":
|
|
525
541
|
return `${prop}-content`;
|
|
526
542
|
}
|
|
527
|
-
return handler.bracket.cssvar.auto.fraction.rem(prop);
|
|
543
|
+
return handler.bracket.cssvar.global.auto.fraction.rem(prop);
|
|
528
544
|
}
|
|
529
545
|
const sizes = [
|
|
530
546
|
[
|
|
@@ -559,7 +575,7 @@ function getAspectRatio(prop) {
|
|
|
559
575
|
case "video":
|
|
560
576
|
return "16/9";
|
|
561
577
|
}
|
|
562
|
-
return handler.bracket.cssvar.auto.number(prop);
|
|
578
|
+
return handler.bracket.cssvar.global.auto.number(prop);
|
|
563
579
|
}
|
|
564
580
|
const aspectRatio = [
|
|
565
581
|
[/^aspect-(?:ratio-)?(.+)$/, ([, d]) => ({ "aspect-ratio": getAspectRatio(d) }), { autocomplete: ["aspect-(square|video)", "aspect-ratio-(square|video)"] }]
|
|
@@ -622,7 +638,7 @@ ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
|
|
|
622
638
|
const decorationStyles = ["solid", "double", "dotted", "dashed", "wavy", ...globalKeywords];
|
|
623
639
|
const textDecorations = [
|
|
624
640
|
[/^(?:decoration-)?(underline|overline|line-through)$/, ([, s]) => ({ "text-decoration-line": s }), { autocomplete: "decoration-(underline|overline|line-through)" }],
|
|
625
|
-
[/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? handler.bracket.cssvar.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
|
|
641
|
+
[/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? handler.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
|
|
626
642
|
[/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s }), { autocomplete: "(underline|decoration)-(auto|from-font)" }],
|
|
627
643
|
[/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
|
|
628
644
|
const result = colorResolver("text-decoration-color", "line")(match, ctx);
|
|
@@ -634,7 +650,7 @@ const textDecorations = [
|
|
|
634
650
|
}
|
|
635
651
|
}, { autocomplete: "(underline|decoration)-$colors" }],
|
|
636
652
|
[/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": handler.bracket.percent(opacity) }), { autocomplete: "(underline|decoration)-(op|opacity)-<percent>" }],
|
|
637
|
-
[/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? handler.auto.bracket.cssvar.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
|
|
653
|
+
[/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? handler.auto.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
|
|
638
654
|
...decorationStyles.map((v) => [`underline-${v}`, { "text-decoration-style": v }]),
|
|
639
655
|
...decorationStyles.map((v) => [`decoration-${v}`, { "text-decoration-style": v }]),
|
|
640
656
|
["no-underline", { "text-decoration": "none" }],
|
package/dist/chunks/default3.cjs
CHANGED
|
@@ -32,22 +32,35 @@ const variantBreakpoints = {
|
|
|
32
32
|
order -= idx + 1;
|
|
33
33
|
return {
|
|
34
34
|
matcher: m,
|
|
35
|
-
|
|
35
|
+
handle: (input, next) => next({
|
|
36
|
+
...input,
|
|
37
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (max-width: ${calcMaxWidthBySize(size)})`,
|
|
38
|
+
parentOrder: order
|
|
39
|
+
})
|
|
36
40
|
};
|
|
37
41
|
}
|
|
38
42
|
order += idx + 1;
|
|
39
43
|
if (isAtPrefix && idx < variantEntries.length - 1) {
|
|
40
44
|
return {
|
|
41
45
|
matcher: m,
|
|
42
|
-
|
|
46
|
+
handle: (input, next) => next({
|
|
47
|
+
...input,
|
|
48
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (min-width: ${size}) and (max-width: ${calcMaxWidthBySize(variantEntries[idx + 1][1])})`,
|
|
49
|
+
parentOrder: order
|
|
50
|
+
})
|
|
43
51
|
};
|
|
44
52
|
}
|
|
45
53
|
return {
|
|
46
54
|
matcher: m,
|
|
47
|
-
|
|
55
|
+
handle: (input, next) => next({
|
|
56
|
+
...input,
|
|
57
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (min-width: ${size})`,
|
|
58
|
+
parentOrder: order
|
|
59
|
+
})
|
|
48
60
|
};
|
|
49
61
|
}
|
|
50
62
|
},
|
|
63
|
+
multiPass: true,
|
|
51
64
|
autocomplete: "(at-|lt-|)$breakpoints:"
|
|
52
65
|
};
|
|
53
66
|
|
|
@@ -63,7 +76,8 @@ const scopeMatcher = (strict, name, template) => {
|
|
|
63
76
|
selector: (s) => template.replace("&&-s", s).replace("&&-c", match[1] ?? "*")
|
|
64
77
|
};
|
|
65
78
|
}
|
|
66
|
-
}
|
|
79
|
+
},
|
|
80
|
+
multiPass: true
|
|
67
81
|
};
|
|
68
82
|
};
|
|
69
83
|
const variantCombinators = [
|
|
@@ -87,17 +101,21 @@ const variantCustomMedia = {
|
|
|
87
101
|
const media = theme.media?.[match[1]] ?? `(--${match[1]})`;
|
|
88
102
|
return {
|
|
89
103
|
matcher: matcher.slice(match[0].length),
|
|
90
|
-
|
|
104
|
+
handle: (input, next) => next({
|
|
105
|
+
...input,
|
|
106
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media ${media}`
|
|
107
|
+
})
|
|
91
108
|
};
|
|
92
109
|
}
|
|
93
|
-
}
|
|
110
|
+
},
|
|
111
|
+
multiPass: true
|
|
94
112
|
};
|
|
95
113
|
|
|
96
114
|
const variantColorsMediaOrClass = (options = {}) => {
|
|
97
115
|
if (options?.dark === "class") {
|
|
98
116
|
return [
|
|
99
|
-
variants$1.variantMatcher("dark", (input) => `.dark $$ ${input}`),
|
|
100
|
-
variants$1.variantMatcher("light", (input) => `.light $$ ${input}`)
|
|
117
|
+
variants$1.variantMatcher("dark", (input) => ({ prefix: `.dark $$ ${input.prefix}` })),
|
|
118
|
+
variants$1.variantMatcher("light", (input) => ({ prefix: `.light $$ ${input.prefix}` }))
|
|
101
119
|
];
|
|
102
120
|
}
|
|
103
121
|
return [
|
|
@@ -107,8 +125,8 @@ const variantColorsMediaOrClass = (options = {}) => {
|
|
|
107
125
|
};
|
|
108
126
|
|
|
109
127
|
const variantLanguageDirections = [
|
|
110
|
-
variants$1.variantMatcher("rtl", (input) => `[dir="rtl"] $$ ${input}`),
|
|
111
|
-
variants$1.variantMatcher("ltr", (input) => `[dir="ltr"] $$ ${input}`)
|
|
128
|
+
variants$1.variantMatcher("rtl", (input) => ({ prefix: `[dir="rtl"] $$ ${input.prefix}` })),
|
|
129
|
+
variants$1.variantMatcher("ltr", (input) => ({ prefix: `[dir="ltr"] $$ ${input.prefix}` }))
|
|
112
130
|
];
|
|
113
131
|
|
|
114
132
|
const variantSelector = {
|
|
@@ -130,7 +148,10 @@ const variantCssLayer = {
|
|
|
130
148
|
if (match) {
|
|
131
149
|
return {
|
|
132
150
|
matcher: matcher.slice(match[0].length),
|
|
133
|
-
|
|
151
|
+
handle: (input, next) => next({
|
|
152
|
+
...input,
|
|
153
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@layer ${match[1]}`
|
|
154
|
+
})
|
|
134
155
|
};
|
|
135
156
|
}
|
|
136
157
|
}
|
|
@@ -159,6 +180,30 @@ const variantScope = {
|
|
|
159
180
|
}
|
|
160
181
|
}
|
|
161
182
|
};
|
|
183
|
+
const variantVariables = {
|
|
184
|
+
name: "variables",
|
|
185
|
+
match(matcher) {
|
|
186
|
+
const match = matcher.match(/^(\[.+?\]):/);
|
|
187
|
+
if (match) {
|
|
188
|
+
const variant = utilities.handler.bracket(match[1]) ?? "";
|
|
189
|
+
return {
|
|
190
|
+
matcher: matcher.slice(match[0].length),
|
|
191
|
+
handle(input, next) {
|
|
192
|
+
const updates = variant.startsWith("@") ? {
|
|
193
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}${variant}`
|
|
194
|
+
} : {
|
|
195
|
+
selector: variant.replace(/&/g, input.selector)
|
|
196
|
+
};
|
|
197
|
+
return next({
|
|
198
|
+
...input,
|
|
199
|
+
...updates
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
multiPass: true
|
|
206
|
+
};
|
|
162
207
|
|
|
163
208
|
const numberRE = /[0-9.]+(?:[a-z]+|%)?/;
|
|
164
209
|
const ignoreProps = [
|
|
@@ -282,7 +327,7 @@ const sortValue = (pseudo) => {
|
|
|
282
327
|
return 1;
|
|
283
328
|
};
|
|
284
329
|
const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
285
|
-
const rawRe = new RegExp(
|
|
330
|
+
const rawRe = new RegExp(`${core.escapeRegExp(parent)}:`);
|
|
286
331
|
const pseudoRE = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))[:-]`);
|
|
287
332
|
const pseudoColonRE = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesColonStr}))[:]`);
|
|
288
333
|
return {
|
|
@@ -295,8 +340,11 @@ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
|
295
340
|
pseudo = `:${match[2]}(${pseudo})`;
|
|
296
341
|
return {
|
|
297
342
|
matcher: input.slice(match[0].length),
|
|
298
|
-
|
|
299
|
-
|
|
343
|
+
handle: (input2, next) => next({
|
|
344
|
+
...input2,
|
|
345
|
+
prefix: rawRe.test(input2.prefix) ? input2.prefix.replace(rawRe, `${parent}${pseudo}:`) : `${parent}${pseudo}${combinator}${input2.prefix}`,
|
|
346
|
+
sort: sortValue(match[3])
|
|
347
|
+
})
|
|
300
348
|
};
|
|
301
349
|
}
|
|
302
350
|
}
|
|
@@ -314,8 +362,18 @@ const variantPseudoClassesAndElements = {
|
|
|
314
362
|
const pseudo = PseudoClasses[match[1]] || PseudoClassesColon[match[1]] || `:${match[1]}`;
|
|
315
363
|
return {
|
|
316
364
|
matcher: input.slice(match[0].length),
|
|
317
|
-
|
|
318
|
-
|
|
365
|
+
handle: (input2, next) => {
|
|
366
|
+
const selectors = pseudo.startsWith("::") ? {
|
|
367
|
+
pseudo: `${input2.pseudo}${pseudo}`
|
|
368
|
+
} : {
|
|
369
|
+
selector: `${input2.selector}${pseudo}`
|
|
370
|
+
};
|
|
371
|
+
return next({
|
|
372
|
+
...input2,
|
|
373
|
+
...selectors,
|
|
374
|
+
sort: sortValue(match[1])
|
|
375
|
+
});
|
|
376
|
+
}
|
|
319
377
|
};
|
|
320
378
|
}
|
|
321
379
|
},
|
|
@@ -376,6 +434,7 @@ const partClasses = {
|
|
|
376
434
|
};
|
|
377
435
|
|
|
378
436
|
const variants = (options) => [
|
|
437
|
+
variantVariables,
|
|
379
438
|
variantCssLayer,
|
|
380
439
|
variantSelector,
|
|
381
440
|
variantInternalLayer,
|
|
@@ -410,4 +469,5 @@ exports.variantPseudoClassesAndElements = variantPseudoClassesAndElements;
|
|
|
410
469
|
exports.variantScope = variantScope;
|
|
411
470
|
exports.variantSelector = variantSelector;
|
|
412
471
|
exports.variantTaggedPseudoClasses = variantTaggedPseudoClasses;
|
|
472
|
+
exports.variantVariables = variantVariables;
|
|
413
473
|
exports.variants = variants;
|
package/dist/chunks/default3.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as resolveBreakpoints, C as CONTROL_MINI_NO_NEGATIVE } from './utilities.mjs';
|
|
1
|
+
import { k as resolveBreakpoints, h as handler, C as CONTROL_MINI_NO_NEGATIVE } from './utilities.mjs';
|
|
2
2
|
import { v as variantParentMatcher, a as variantMatcher } from './variants.mjs';
|
|
3
3
|
import { escapeRegExp } from '@unocss/core';
|
|
4
4
|
|
|
@@ -30,22 +30,35 @@ const variantBreakpoints = {
|
|
|
30
30
|
order -= idx + 1;
|
|
31
31
|
return {
|
|
32
32
|
matcher: m,
|
|
33
|
-
|
|
33
|
+
handle: (input, next) => next({
|
|
34
|
+
...input,
|
|
35
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (max-width: ${calcMaxWidthBySize(size)})`,
|
|
36
|
+
parentOrder: order
|
|
37
|
+
})
|
|
34
38
|
};
|
|
35
39
|
}
|
|
36
40
|
order += idx + 1;
|
|
37
41
|
if (isAtPrefix && idx < variantEntries.length - 1) {
|
|
38
42
|
return {
|
|
39
43
|
matcher: m,
|
|
40
|
-
|
|
44
|
+
handle: (input, next) => next({
|
|
45
|
+
...input,
|
|
46
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (min-width: ${size}) and (max-width: ${calcMaxWidthBySize(variantEntries[idx + 1][1])})`,
|
|
47
|
+
parentOrder: order
|
|
48
|
+
})
|
|
41
49
|
};
|
|
42
50
|
}
|
|
43
51
|
return {
|
|
44
52
|
matcher: m,
|
|
45
|
-
|
|
53
|
+
handle: (input, next) => next({
|
|
54
|
+
...input,
|
|
55
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (min-width: ${size})`,
|
|
56
|
+
parentOrder: order
|
|
57
|
+
})
|
|
46
58
|
};
|
|
47
59
|
}
|
|
48
60
|
},
|
|
61
|
+
multiPass: true,
|
|
49
62
|
autocomplete: "(at-|lt-|)$breakpoints:"
|
|
50
63
|
};
|
|
51
64
|
|
|
@@ -61,7 +74,8 @@ const scopeMatcher = (strict, name, template) => {
|
|
|
61
74
|
selector: (s) => template.replace("&&-s", s).replace("&&-c", match[1] ?? "*")
|
|
62
75
|
};
|
|
63
76
|
}
|
|
64
|
-
}
|
|
77
|
+
},
|
|
78
|
+
multiPass: true
|
|
65
79
|
};
|
|
66
80
|
};
|
|
67
81
|
const variantCombinators = [
|
|
@@ -85,17 +99,21 @@ const variantCustomMedia = {
|
|
|
85
99
|
const media = theme.media?.[match[1]] ?? `(--${match[1]})`;
|
|
86
100
|
return {
|
|
87
101
|
matcher: matcher.slice(match[0].length),
|
|
88
|
-
|
|
102
|
+
handle: (input, next) => next({
|
|
103
|
+
...input,
|
|
104
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media ${media}`
|
|
105
|
+
})
|
|
89
106
|
};
|
|
90
107
|
}
|
|
91
|
-
}
|
|
108
|
+
},
|
|
109
|
+
multiPass: true
|
|
92
110
|
};
|
|
93
111
|
|
|
94
112
|
const variantColorsMediaOrClass = (options = {}) => {
|
|
95
113
|
if (options?.dark === "class") {
|
|
96
114
|
return [
|
|
97
|
-
variantMatcher("dark", (input) => `.dark $$ ${input}`),
|
|
98
|
-
variantMatcher("light", (input) => `.light $$ ${input}`)
|
|
115
|
+
variantMatcher("dark", (input) => ({ prefix: `.dark $$ ${input.prefix}` })),
|
|
116
|
+
variantMatcher("light", (input) => ({ prefix: `.light $$ ${input.prefix}` }))
|
|
99
117
|
];
|
|
100
118
|
}
|
|
101
119
|
return [
|
|
@@ -105,8 +123,8 @@ const variantColorsMediaOrClass = (options = {}) => {
|
|
|
105
123
|
};
|
|
106
124
|
|
|
107
125
|
const variantLanguageDirections = [
|
|
108
|
-
variantMatcher("rtl", (input) => `[dir="rtl"] $$ ${input}`),
|
|
109
|
-
variantMatcher("ltr", (input) => `[dir="ltr"] $$ ${input}`)
|
|
126
|
+
variantMatcher("rtl", (input) => ({ prefix: `[dir="rtl"] $$ ${input.prefix}` })),
|
|
127
|
+
variantMatcher("ltr", (input) => ({ prefix: `[dir="ltr"] $$ ${input.prefix}` }))
|
|
110
128
|
];
|
|
111
129
|
|
|
112
130
|
const variantSelector = {
|
|
@@ -128,7 +146,10 @@ const variantCssLayer = {
|
|
|
128
146
|
if (match) {
|
|
129
147
|
return {
|
|
130
148
|
matcher: matcher.slice(match[0].length),
|
|
131
|
-
|
|
149
|
+
handle: (input, next) => next({
|
|
150
|
+
...input,
|
|
151
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@layer ${match[1]}`
|
|
152
|
+
})
|
|
132
153
|
};
|
|
133
154
|
}
|
|
134
155
|
}
|
|
@@ -157,6 +178,30 @@ const variantScope = {
|
|
|
157
178
|
}
|
|
158
179
|
}
|
|
159
180
|
};
|
|
181
|
+
const variantVariables = {
|
|
182
|
+
name: "variables",
|
|
183
|
+
match(matcher) {
|
|
184
|
+
const match = matcher.match(/^(\[.+?\]):/);
|
|
185
|
+
if (match) {
|
|
186
|
+
const variant = handler.bracket(match[1]) ?? "";
|
|
187
|
+
return {
|
|
188
|
+
matcher: matcher.slice(match[0].length),
|
|
189
|
+
handle(input, next) {
|
|
190
|
+
const updates = variant.startsWith("@") ? {
|
|
191
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}${variant}`
|
|
192
|
+
} : {
|
|
193
|
+
selector: variant.replace(/&/g, input.selector)
|
|
194
|
+
};
|
|
195
|
+
return next({
|
|
196
|
+
...input,
|
|
197
|
+
...updates
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
multiPass: true
|
|
204
|
+
};
|
|
160
205
|
|
|
161
206
|
const numberRE = /[0-9.]+(?:[a-z]+|%)?/;
|
|
162
207
|
const ignoreProps = [
|
|
@@ -280,7 +325,7 @@ const sortValue = (pseudo) => {
|
|
|
280
325
|
return 1;
|
|
281
326
|
};
|
|
282
327
|
const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
283
|
-
const rawRe = new RegExp(
|
|
328
|
+
const rawRe = new RegExp(`${escapeRegExp(parent)}:`);
|
|
284
329
|
const pseudoRE = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))[:-]`);
|
|
285
330
|
const pseudoColonRE = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesColonStr}))[:]`);
|
|
286
331
|
return {
|
|
@@ -293,8 +338,11 @@ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
|
293
338
|
pseudo = `:${match[2]}(${pseudo})`;
|
|
294
339
|
return {
|
|
295
340
|
matcher: input.slice(match[0].length),
|
|
296
|
-
|
|
297
|
-
|
|
341
|
+
handle: (input2, next) => next({
|
|
342
|
+
...input2,
|
|
343
|
+
prefix: rawRe.test(input2.prefix) ? input2.prefix.replace(rawRe, `${parent}${pseudo}:`) : `${parent}${pseudo}${combinator}${input2.prefix}`,
|
|
344
|
+
sort: sortValue(match[3])
|
|
345
|
+
})
|
|
298
346
|
};
|
|
299
347
|
}
|
|
300
348
|
}
|
|
@@ -312,8 +360,18 @@ const variantPseudoClassesAndElements = {
|
|
|
312
360
|
const pseudo = PseudoClasses[match[1]] || PseudoClassesColon[match[1]] || `:${match[1]}`;
|
|
313
361
|
return {
|
|
314
362
|
matcher: input.slice(match[0].length),
|
|
315
|
-
|
|
316
|
-
|
|
363
|
+
handle: (input2, next) => {
|
|
364
|
+
const selectors = pseudo.startsWith("::") ? {
|
|
365
|
+
pseudo: `${input2.pseudo}${pseudo}`
|
|
366
|
+
} : {
|
|
367
|
+
selector: `${input2.selector}${pseudo}`
|
|
368
|
+
};
|
|
369
|
+
return next({
|
|
370
|
+
...input2,
|
|
371
|
+
...selectors,
|
|
372
|
+
sort: sortValue(match[1])
|
|
373
|
+
});
|
|
374
|
+
}
|
|
317
375
|
};
|
|
318
376
|
}
|
|
319
377
|
},
|
|
@@ -374,6 +432,7 @@ const partClasses = {
|
|
|
374
432
|
};
|
|
375
433
|
|
|
376
434
|
const variants = (options) => [
|
|
435
|
+
variantVariables,
|
|
377
436
|
variantCssLayer,
|
|
378
437
|
variantSelector,
|
|
379
438
|
variantInternalLayer,
|
|
@@ -392,4 +451,4 @@ const variants = (options) => [
|
|
|
392
451
|
variantScope
|
|
393
452
|
];
|
|
394
453
|
|
|
395
|
-
export { variantBreakpoints as a, variantCombinators as b, variantPrint as c, variantCustomMedia as d, variantColorsMediaOrClass as e, variantLanguageDirections as f, variantSelector as g, variantCssLayer as h, variantInternalLayer as i, variantScope as j,
|
|
454
|
+
export { variantBreakpoints as a, variantCombinators as b, variantPrint as c, variantCustomMedia as d, variantColorsMediaOrClass as e, variantLanguageDirections as f, variantSelector as g, variantCssLayer as h, variantInternalLayer as i, variantScope as j, variantVariables as k, variantPseudoClassesAndElements as l, variantPseudoClassFunctions as m, variantTaggedPseudoClasses as n, variantImportant as o, partClasses as p, variantNegative as q, variants as v };
|
|
@@ -11,35 +11,43 @@ const displays = [
|
|
|
11
11
|
["flow-root", { display: "flow-root" }],
|
|
12
12
|
["list-item", { display: "list-item" }],
|
|
13
13
|
["hidden", { display: "none" }],
|
|
14
|
-
[/^display-(.+)$/, ([, c]) => ({ display: utilities.handler.bracket.cssvar(c) || c })]
|
|
14
|
+
[/^display-(.+)$/, ([, c]) => ({ display: utilities.handler.bracket.cssvar.global(c) || c })]
|
|
15
15
|
];
|
|
16
16
|
const appearances = [
|
|
17
17
|
["visible", { visibility: "visible" }],
|
|
18
18
|
["invisible", { visibility: "hidden" }],
|
|
19
19
|
["backface-visible", { "backface-visibility": "visible" }],
|
|
20
|
-
["backface-hidden", { "backface-visibility": "hidden" }]
|
|
20
|
+
["backface-hidden", { "backface-visibility": "hidden" }],
|
|
21
|
+
...utilities.makeGlobalStaticRules("backface", "backface-visibility")
|
|
21
22
|
];
|
|
22
23
|
const cursors = [
|
|
23
|
-
[/^cursor-(.+)$/, ([, c]) => ({ cursor: utilities.handler.bracket.cssvar(c) || c })]
|
|
24
|
+
[/^cursor-(.+)$/, ([, c]) => ({ cursor: utilities.handler.bracket.cssvar.global(c) || c })]
|
|
24
25
|
];
|
|
25
26
|
const pointerEvents = [
|
|
26
27
|
["pointer-events-auto", { "pointer-events": "auto" }],
|
|
27
|
-
["pointer-events-none", { "pointer-events": "none" }]
|
|
28
|
+
["pointer-events-none", { "pointer-events": "none" }],
|
|
29
|
+
...utilities.makeGlobalStaticRules("pointer-events")
|
|
28
30
|
];
|
|
29
31
|
const resizes = [
|
|
30
32
|
["resize-x", { resize: "horizontal" }],
|
|
31
33
|
["resize-y", { resize: "vertical" }],
|
|
32
34
|
["resize", { resize: "both" }],
|
|
33
|
-
["resize-none", { resize: "none" }]
|
|
35
|
+
["resize-none", { resize: "none" }],
|
|
36
|
+
...utilities.makeGlobalStaticRules("resize")
|
|
34
37
|
];
|
|
35
38
|
const userSelects = [
|
|
36
39
|
["select-auto", { "user-select": "auto" }],
|
|
37
40
|
["select-all", { "user-select": "all" }],
|
|
38
41
|
["select-text", { "user-select": "text" }],
|
|
39
|
-
["select-none", { "user-select": "none" }]
|
|
42
|
+
["select-none", { "user-select": "none" }],
|
|
43
|
+
...utilities.makeGlobalStaticRules("select", "user-select")
|
|
40
44
|
];
|
|
41
45
|
const whitespaces = [
|
|
42
|
-
[
|
|
46
|
+
[
|
|
47
|
+
/^(?:whitespace-|ws-)([-\w]+)$/,
|
|
48
|
+
([, v]) => ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces", ...utilities.globalKeywords].includes(v) ? { "white-space": v } : void 0,
|
|
49
|
+
{ autocomplete: "(whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap|break-spaces)" }
|
|
50
|
+
]
|
|
43
51
|
];
|
|
44
52
|
const contents = [
|
|
45
53
|
[/^content-\[(.+)\]$/, ([, v]) => ({ content: `"${v}"` })],
|
|
@@ -61,7 +69,8 @@ const textTransforms = [
|
|
|
61
69
|
["case-upper", { "text-transform": "uppercase" }],
|
|
62
70
|
["case-lower", { "text-transform": "lowercase" }],
|
|
63
71
|
["case-capital", { "text-transform": "capitalize" }],
|
|
64
|
-
["case-normal", { "text-transform": "none" }]
|
|
72
|
+
["case-normal", { "text-transform": "none" }],
|
|
73
|
+
...utilities.makeGlobalStaticRules("case", "text-transform")
|
|
65
74
|
];
|
|
66
75
|
const fontStyles = [
|
|
67
76
|
["italic", { "font-style": "italic" }],
|
|
@@ -209,7 +218,8 @@ const transforms = [
|
|
|
209
218
|
["transform", { transform: transformCpu }],
|
|
210
219
|
["transform-cpu", { transform: transformCpu }],
|
|
211
220
|
["transform-gpu", { transform: transformGpu }],
|
|
212
|
-
["transform-none", { transform: "none" }]
|
|
221
|
+
["transform-none", { transform: "none" }],
|
|
222
|
+
...utilities.makeGlobalStaticRules("transform")
|
|
213
223
|
];
|
|
214
224
|
function handleTranslate([, d, b], { theme }) {
|
|
215
225
|
const v = theme.spacing?.[b] ?? utilities.handler.bracket.cssvar.fraction.rem(b);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as handler, c as colorResolver, i as colorableShadows,
|
|
1
|
+
import { h as handler, m as makeGlobalStaticRules, g as globalKeywords, c as colorResolver, i as colorableShadows, n as positionMap, x as xyzMap } from './utilities.mjs';
|
|
2
2
|
|
|
3
3
|
const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
|
|
4
4
|
const displays = [
|
|
@@ -9,35 +9,43 @@ const displays = [
|
|
|
9
9
|
["flow-root", { display: "flow-root" }],
|
|
10
10
|
["list-item", { display: "list-item" }],
|
|
11
11
|
["hidden", { display: "none" }],
|
|
12
|
-
[/^display-(.+)$/, ([, c]) => ({ display: handler.bracket.cssvar(c) || c })]
|
|
12
|
+
[/^display-(.+)$/, ([, c]) => ({ display: handler.bracket.cssvar.global(c) || c })]
|
|
13
13
|
];
|
|
14
14
|
const appearances = [
|
|
15
15
|
["visible", { visibility: "visible" }],
|
|
16
16
|
["invisible", { visibility: "hidden" }],
|
|
17
17
|
["backface-visible", { "backface-visibility": "visible" }],
|
|
18
|
-
["backface-hidden", { "backface-visibility": "hidden" }]
|
|
18
|
+
["backface-hidden", { "backface-visibility": "hidden" }],
|
|
19
|
+
...makeGlobalStaticRules("backface", "backface-visibility")
|
|
19
20
|
];
|
|
20
21
|
const cursors = [
|
|
21
|
-
[/^cursor-(.+)$/, ([, c]) => ({ cursor: handler.bracket.cssvar(c) || c })]
|
|
22
|
+
[/^cursor-(.+)$/, ([, c]) => ({ cursor: handler.bracket.cssvar.global(c) || c })]
|
|
22
23
|
];
|
|
23
24
|
const pointerEvents = [
|
|
24
25
|
["pointer-events-auto", { "pointer-events": "auto" }],
|
|
25
|
-
["pointer-events-none", { "pointer-events": "none" }]
|
|
26
|
+
["pointer-events-none", { "pointer-events": "none" }],
|
|
27
|
+
...makeGlobalStaticRules("pointer-events")
|
|
26
28
|
];
|
|
27
29
|
const resizes = [
|
|
28
30
|
["resize-x", { resize: "horizontal" }],
|
|
29
31
|
["resize-y", { resize: "vertical" }],
|
|
30
32
|
["resize", { resize: "both" }],
|
|
31
|
-
["resize-none", { resize: "none" }]
|
|
33
|
+
["resize-none", { resize: "none" }],
|
|
34
|
+
...makeGlobalStaticRules("resize")
|
|
32
35
|
];
|
|
33
36
|
const userSelects = [
|
|
34
37
|
["select-auto", { "user-select": "auto" }],
|
|
35
38
|
["select-all", { "user-select": "all" }],
|
|
36
39
|
["select-text", { "user-select": "text" }],
|
|
37
|
-
["select-none", { "user-select": "none" }]
|
|
40
|
+
["select-none", { "user-select": "none" }],
|
|
41
|
+
...makeGlobalStaticRules("select", "user-select")
|
|
38
42
|
];
|
|
39
43
|
const whitespaces = [
|
|
40
|
-
[
|
|
44
|
+
[
|
|
45
|
+
/^(?:whitespace-|ws-)([-\w]+)$/,
|
|
46
|
+
([, v]) => ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces", ...globalKeywords].includes(v) ? { "white-space": v } : void 0,
|
|
47
|
+
{ autocomplete: "(whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap|break-spaces)" }
|
|
48
|
+
]
|
|
41
49
|
];
|
|
42
50
|
const contents = [
|
|
43
51
|
[/^content-\[(.+)\]$/, ([, v]) => ({ content: `"${v}"` })],
|
|
@@ -59,7 +67,8 @@ const textTransforms = [
|
|
|
59
67
|
["case-upper", { "text-transform": "uppercase" }],
|
|
60
68
|
["case-lower", { "text-transform": "lowercase" }],
|
|
61
69
|
["case-capital", { "text-transform": "capitalize" }],
|
|
62
|
-
["case-normal", { "text-transform": "none" }]
|
|
70
|
+
["case-normal", { "text-transform": "none" }],
|
|
71
|
+
...makeGlobalStaticRules("case", "text-transform")
|
|
63
72
|
];
|
|
64
73
|
const fontStyles = [
|
|
65
74
|
["italic", { "font-style": "italic" }],
|
|
@@ -207,7 +216,8 @@ const transforms = [
|
|
|
207
216
|
["transform", { transform: transformCpu }],
|
|
208
217
|
["transform-cpu", { transform: transformCpu }],
|
|
209
218
|
["transform-gpu", { transform: transformGpu }],
|
|
210
|
-
["transform-none", { transform: "none" }]
|
|
219
|
+
["transform-none", { transform: "none" }],
|
|
220
|
+
...makeGlobalStaticRules("transform")
|
|
211
221
|
];
|
|
212
222
|
function handleTranslate([, d, b], { theme }) {
|
|
213
223
|
const v = theme.spacing?.[b] ?? handler.bracket.cssvar.fraction.rem(b);
|
|
@@ -449,7 +449,7 @@ function bracketWithType(str, type) {
|
|
|
449
449
|
else if (type && match[1] === type)
|
|
450
450
|
base = str.slice(match[0].length, -1);
|
|
451
451
|
if (base !== void 0) {
|
|
452
|
-
return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/([^\\])_/g, "$1 ").replace(/calc\((.*)/g, (v) => {
|
|
452
|
+
return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/([^\\])_/g, "$1 ").replace(/(?:calc|clamp|max|min)\((.*)/g, (v) => {
|
|
453
453
|
return v.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ");
|
|
454
454
|
});
|
|
455
455
|
}
|
|
@@ -528,7 +528,7 @@ const h = handler;
|
|
|
528
528
|
|
|
529
529
|
const CONTROL_MINI_NO_NEGATIVE = "$$mini-no-negative";
|
|
530
530
|
const directionSize = (propertyPrefix) => ([_, direction, size], { theme }) => {
|
|
531
|
-
const v = theme.spacing?.[size || "DEFAULT"] ?? handler.bracket.cssvar.auto.fraction.rem(size);
|
|
531
|
+
const v = theme.spacing?.[size || "DEFAULT"] ?? handler.bracket.cssvar.global.auto.fraction.rem(size);
|
|
532
532
|
if (v != null)
|
|
533
533
|
return directionMap[direction].map((i) => [`${propertyPrefix}${i}`, v]);
|
|
534
534
|
};
|
|
@@ -639,6 +639,9 @@ const resolveVerticalBreakpoints = ({ theme, generator }) => {
|
|
|
639
639
|
verticalBreakpoints = theme.verticalBreakpoints;
|
|
640
640
|
return verticalBreakpoints;
|
|
641
641
|
};
|
|
642
|
+
const makeGlobalStaticRules = (prefix, property) => {
|
|
643
|
+
return globalKeywords.map((keyword) => [`${prefix}-${keyword}`, { [property ?? prefix]: keyword }]);
|
|
644
|
+
};
|
|
642
645
|
|
|
643
646
|
exports.CONTROL_MINI_NO_NEGATIVE = CONTROL_MINI_NO_NEGATIVE;
|
|
644
647
|
exports.colorOpacityToString = colorOpacityToString;
|
|
@@ -655,6 +658,7 @@ exports.handler = handler;
|
|
|
655
658
|
exports.hasParseableColor = hasParseableColor;
|
|
656
659
|
exports.hex2rgba = hex2rgba;
|
|
657
660
|
exports.insetMap = insetMap;
|
|
661
|
+
exports.makeGlobalStaticRules = makeGlobalStaticRules;
|
|
658
662
|
exports.parseColor = parseColor;
|
|
659
663
|
exports.parseCssColor = parseCssColor;
|
|
660
664
|
exports.positionMap = positionMap;
|
|
@@ -447,7 +447,7 @@ function bracketWithType(str, type) {
|
|
|
447
447
|
else if (type && match[1] === type)
|
|
448
448
|
base = str.slice(match[0].length, -1);
|
|
449
449
|
if (base !== void 0) {
|
|
450
|
-
return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/([^\\])_/g, "$1 ").replace(/calc\((.*)/g, (v) => {
|
|
450
|
+
return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/([^\\])_/g, "$1 ").replace(/(?:calc|clamp|max|min)\((.*)/g, (v) => {
|
|
451
451
|
return v.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ");
|
|
452
452
|
});
|
|
453
453
|
}
|
|
@@ -526,7 +526,7 @@ const h = handler;
|
|
|
526
526
|
|
|
527
527
|
const CONTROL_MINI_NO_NEGATIVE = "$$mini-no-negative";
|
|
528
528
|
const directionSize = (propertyPrefix) => ([_, direction, size], { theme }) => {
|
|
529
|
-
const v = theme.spacing?.[size || "DEFAULT"] ?? handler.bracket.cssvar.auto.fraction.rem(size);
|
|
529
|
+
const v = theme.spacing?.[size || "DEFAULT"] ?? handler.bracket.cssvar.global.auto.fraction.rem(size);
|
|
530
530
|
if (v != null)
|
|
531
531
|
return directionMap[direction].map((i) => [`${propertyPrefix}${i}`, v]);
|
|
532
532
|
};
|
|
@@ -637,5 +637,8 @@ const resolveVerticalBreakpoints = ({ theme, generator }) => {
|
|
|
637
637
|
verticalBreakpoints = theme.verticalBreakpoints;
|
|
638
638
|
return verticalBreakpoints;
|
|
639
639
|
};
|
|
640
|
+
const makeGlobalStaticRules = (prefix, property) => {
|
|
641
|
+
return globalKeywords.map((keyword) => [`${prefix}-${keyword}`, { [property ?? prefix]: keyword }]);
|
|
642
|
+
};
|
|
640
643
|
|
|
641
|
-
export { CONTROL_MINI_NO_NEGATIVE as C, hasParseableColor as a, colorToString as b, colorResolver as c, directionMap as d, colorOpacityToString as e, cornerMap as f, globalKeywords as g, handler as h, colorableShadows as i, insetMap as j, resolveBreakpoints as k, directionSize as l,
|
|
644
|
+
export { CONTROL_MINI_NO_NEGATIVE as C, hasParseableColor as a, colorToString as b, colorResolver as c, directionMap as d, colorOpacityToString as e, cornerMap as f, globalKeywords as g, handler as h, colorableShadows as i, insetMap as j, resolveBreakpoints as k, directionSize as l, makeGlobalStaticRules as m, positionMap as n, hex2rgba as o, parseColor as p, parseCssColor as q, resolveVerticalBreakpoints as r, getComponents as s, h as t, valueHandlers as v, xyzMap as x };
|
package/dist/chunks/variants.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const core = require('@unocss/core');
|
|
4
4
|
|
|
5
|
-
const variantMatcher = (name,
|
|
5
|
+
const variantMatcher = (name, handler) => {
|
|
6
6
|
const re = new RegExp(`^${core.escapeRegExp(name)}[:-]`);
|
|
7
7
|
return {
|
|
8
8
|
name,
|
|
@@ -11,7 +11,10 @@ const variantMatcher = (name, selector) => {
|
|
|
11
11
|
if (match) {
|
|
12
12
|
return {
|
|
13
13
|
matcher: input.slice(match[0].length),
|
|
14
|
-
|
|
14
|
+
handle: (input2, next) => next({
|
|
15
|
+
...input2,
|
|
16
|
+
...handler(input2)
|
|
17
|
+
})
|
|
15
18
|
};
|
|
16
19
|
}
|
|
17
20
|
},
|
|
@@ -27,7 +30,10 @@ const variantParentMatcher = (name, parent) => {
|
|
|
27
30
|
if (match) {
|
|
28
31
|
return {
|
|
29
32
|
matcher: input.slice(match[0].length),
|
|
30
|
-
|
|
33
|
+
handle: (input2, next) => next({
|
|
34
|
+
...input2,
|
|
35
|
+
parent: `${input2.parent ? `${input2.parent} $$ ` : ""}${parent}`
|
|
36
|
+
})
|
|
31
37
|
};
|
|
32
38
|
}
|
|
33
39
|
},
|
package/dist/chunks/variants.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { escapeRegExp } from '@unocss/core';
|
|
2
2
|
|
|
3
|
-
const variantMatcher = (name,
|
|
3
|
+
const variantMatcher = (name, handler) => {
|
|
4
4
|
const re = new RegExp(`^${escapeRegExp(name)}[:-]`);
|
|
5
5
|
return {
|
|
6
6
|
name,
|
|
@@ -9,7 +9,10 @@ const variantMatcher = (name, selector) => {
|
|
|
9
9
|
if (match) {
|
|
10
10
|
return {
|
|
11
11
|
matcher: input.slice(match[0].length),
|
|
12
|
-
|
|
12
|
+
handle: (input2, next) => next({
|
|
13
|
+
...input2,
|
|
14
|
+
...handler(input2)
|
|
15
|
+
})
|
|
13
16
|
};
|
|
14
17
|
}
|
|
15
18
|
},
|
|
@@ -25,7 +28,10 @@ const variantParentMatcher = (name, parent) => {
|
|
|
25
28
|
if (match) {
|
|
26
29
|
return {
|
|
27
30
|
matcher: input.slice(match[0].length),
|
|
28
|
-
|
|
31
|
+
handle: (input2, next) => next({
|
|
32
|
+
...input2,
|
|
33
|
+
parent: `${input2.parent ? `${input2.parent} $$ ` : ""}${parent}`
|
|
34
|
+
})
|
|
29
35
|
};
|
|
30
36
|
}
|
|
31
37
|
},
|
package/dist/index.cjs
CHANGED
|
@@ -15,8 +15,10 @@ const preflights = [
|
|
|
15
15
|
{
|
|
16
16
|
layer: "preflights",
|
|
17
17
|
getCSS(ctx) {
|
|
18
|
-
if (ctx.theme.preflightBase)
|
|
19
|
-
|
|
18
|
+
if (ctx.theme.preflightBase) {
|
|
19
|
+
const css = core.entriesToCss(Object.entries(ctx.theme.preflightBase));
|
|
20
|
+
return `*,::before,::after{${css}}::backdrop{${css}}`;
|
|
21
|
+
}
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
];
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { T as Theme } from './types-2a2972f5.js';
|
|
|
3
3
|
export { T as Theme, a as ThemeAnimation } from './types-2a2972f5.js';
|
|
4
4
|
export { t as theme } from './default-08edad2c.js';
|
|
5
5
|
export { c as colors } from './colors-b075335e.js';
|
|
6
|
-
export { p as parseColor } from './utilities-
|
|
6
|
+
export { p as parseColor } from './utilities-02300cd4.js';
|
|
7
7
|
|
|
8
8
|
declare const preflights: Preflight[];
|
|
9
9
|
|
package/dist/index.mjs
CHANGED
|
@@ -12,8 +12,10 @@ const preflights = [
|
|
|
12
12
|
{
|
|
13
13
|
layer: "preflights",
|
|
14
14
|
getCSS(ctx) {
|
|
15
|
-
if (ctx.theme.preflightBase)
|
|
16
|
-
|
|
15
|
+
if (ctx.theme.preflightBase) {
|
|
16
|
+
const css = entriesToCss(Object.entries(ctx.theme.preflightBase));
|
|
17
|
+
return `*,::before,::after{${css}}::backdrop{${css}}`;
|
|
18
|
+
}
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RuleContext, CSSEntries, ParsedColorValue, CSSObject, VariantContext } from '@unocss/core';
|
|
1
|
+
import { RuleContext, CSSEntries, ParsedColorValue, CSSObject, VariantContext, Rule } from '@unocss/core';
|
|
2
2
|
import { T as Theme } from './types-2a2972f5.js';
|
|
3
3
|
|
|
4
4
|
declare const CONTROL_MINI_NO_NEGATIVE = "$$mini-no-negative";
|
|
@@ -55,5 +55,6 @@ declare const colorableShadows: (shadows: string | string[], colorVar: string) =
|
|
|
55
55
|
declare const hasParseableColor: (color: string | undefined, theme: Theme) => boolean;
|
|
56
56
|
declare const resolveBreakpoints: ({ theme, generator }: Readonly<VariantContext<Theme>>) => Record<string, string> | undefined;
|
|
57
57
|
declare const resolveVerticalBreakpoints: ({ theme, generator }: Readonly<VariantContext<Theme>>) => Record<string, string> | undefined;
|
|
58
|
+
declare const makeGlobalStaticRules: (prefix: string, property?: string) => Rule<{}>[];
|
|
58
59
|
|
|
59
|
-
export { CONTROL_MINI_NO_NEGATIVE as C, colorableShadows as a, resolveVerticalBreakpoints as b, colorResolver as c, directionSize as d, hasParseableColor as h, parseColor as p, resolveBreakpoints as r };
|
|
60
|
+
export { CONTROL_MINI_NO_NEGATIVE as C, colorableShadows as a, resolveVerticalBreakpoints as b, colorResolver as c, directionSize as d, hasParseableColor as h, makeGlobalStaticRules as m, parseColor as p, resolveBreakpoints as r };
|
package/dist/utils.cjs
CHANGED
|
@@ -23,6 +23,7 @@ exports.handler = utilities.handler;
|
|
|
23
23
|
exports.hasParseableColor = utilities.hasParseableColor;
|
|
24
24
|
exports.hex2rgba = utilities.hex2rgba;
|
|
25
25
|
exports.insetMap = utilities.insetMap;
|
|
26
|
+
exports.makeGlobalStaticRules = utilities.makeGlobalStaticRules;
|
|
26
27
|
exports.parseColor = utilities.parseColor;
|
|
27
28
|
exports.parseCssColor = utilities.parseCssColor;
|
|
28
29
|
exports.positionMap = utilities.positionMap;
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _unocss_core from '@unocss/core';
|
|
2
|
-
import { RGBAColorValue, CSSColorValue, VariantObject } from '@unocss/core';
|
|
3
|
-
export { C as CONTROL_MINI_NO_NEGATIVE, c as colorResolver, a as colorableShadows, d as directionSize, h as hasParseableColor, p as parseColor, r as resolveBreakpoints, b as resolveVerticalBreakpoints } from './utilities-
|
|
2
|
+
import { RGBAColorValue, CSSColorValue, VariantHandlerContext, VariantObject } from '@unocss/core';
|
|
3
|
+
export { C as CONTROL_MINI_NO_NEGATIVE, c as colorResolver, a as colorableShadows, d as directionSize, h as hasParseableColor, m as makeGlobalStaticRules, p as parseColor, r as resolveBreakpoints, b as resolveVerticalBreakpoints } from './utilities-02300cd4.js';
|
|
4
4
|
import './types-2a2972f5.js';
|
|
5
5
|
|
|
6
6
|
declare function hex2rgba(hex?: string): RGBAColorValue | undefined;
|
|
@@ -76,7 +76,7 @@ declare namespace handlers {
|
|
|
76
76
|
declare const handler: _unocss_core.ValueHandler<"number" | "auto" | "global" | "position" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "bracketOfPosition" | "cssvar" | "time" | "degree" | "properties">;
|
|
77
77
|
declare const h: _unocss_core.ValueHandler<"number" | "auto" | "global" | "position" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "bracketOfPosition" | "cssvar" | "time" | "degree" | "properties">;
|
|
78
78
|
|
|
79
|
-
declare const variantMatcher: (name: string,
|
|
79
|
+
declare const variantMatcher: (name: string, handler: (input: VariantHandlerContext) => Record<string, any>) => VariantObject;
|
|
80
80
|
declare const variantParentMatcher: (name: string, parent: string) => VariantObject;
|
|
81
81
|
|
|
82
82
|
export { colorOpacityToString, colorToString, cornerMap, directionMap, getComponents, globalKeywords, h, handler, hex2rgba, insetMap, parseCssColor, positionMap, handlers as valueHandlers, variantMatcher, variantParentMatcher, xyzMap };
|
package/dist/utils.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { C as CONTROL_MINI_NO_NEGATIVE, e as colorOpacityToString, c as colorResolver, b as colorToString, i as colorableShadows, f as cornerMap, d as directionMap, l as directionSize,
|
|
1
|
+
export { C as CONTROL_MINI_NO_NEGATIVE, e as colorOpacityToString, c as colorResolver, b as colorToString, i as colorableShadows, f as cornerMap, d as directionMap, l as directionSize, s as getComponents, g as globalKeywords, t as h, h as handler, a as hasParseableColor, o as hex2rgba, j as insetMap, m as makeGlobalStaticRules, p as parseColor, q as parseCssColor, n as positionMap, k as resolveBreakpoints, r as resolveVerticalBreakpoints, v as valueHandlers, x as xyzMap } from './chunks/utilities.mjs';
|
|
2
2
|
export { a as variantMatcher, v as variantParentMatcher } from './chunks/variants.mjs';
|
|
3
3
|
import '@unocss/core';
|
package/dist/variants.cjs
CHANGED
|
@@ -25,4 +25,5 @@ exports.variantPseudoClassesAndElements = _default.variantPseudoClassesAndElemen
|
|
|
25
25
|
exports.variantScope = _default.variantScope;
|
|
26
26
|
exports.variantSelector = _default.variantSelector;
|
|
27
27
|
exports.variantTaggedPseudoClasses = _default.variantTaggedPseudoClasses;
|
|
28
|
+
exports.variantVariables = _default.variantVariables;
|
|
28
29
|
exports.variants = _default.variants;
|
package/dist/variants.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { T as Theme } from './types-2a2972f5.js';
|
|
|
3
3
|
import { PresetMiniOptions } from './index.js';
|
|
4
4
|
import './default-08edad2c.js';
|
|
5
5
|
import './colors-b075335e.js';
|
|
6
|
-
import './utilities-
|
|
6
|
+
import './utilities-02300cd4.js';
|
|
7
7
|
|
|
8
8
|
declare const variantBreakpoints: Variant<Theme>;
|
|
9
9
|
|
|
@@ -22,6 +22,7 @@ declare const variantSelector: Variant;
|
|
|
22
22
|
declare const variantCssLayer: Variant;
|
|
23
23
|
declare const variantInternalLayer: Variant;
|
|
24
24
|
declare const variantScope: Variant;
|
|
25
|
+
declare const variantVariables: Variant;
|
|
25
26
|
|
|
26
27
|
declare const variantPseudoClassesAndElements: VariantObject;
|
|
27
28
|
declare const variantPseudoClassFunctions: VariantObject;
|
|
@@ -32,4 +33,4 @@ declare const variantImportant: Variant;
|
|
|
32
33
|
|
|
33
34
|
declare const variantNegative: Variant;
|
|
34
35
|
|
|
35
|
-
export { partClasses, variantBreakpoints, variantColorsMediaOrClass, variantCombinators, variantCssLayer, variantCustomMedia, variantImportant, variantInternalLayer, variantLanguageDirections, variantNegative, variantPrint, variantPseudoClassFunctions, variantPseudoClassesAndElements, variantScope, variantSelector, variantTaggedPseudoClasses, variants };
|
|
36
|
+
export { partClasses, variantBreakpoints, variantColorsMediaOrClass, variantCombinators, variantCssLayer, variantCustomMedia, variantImportant, variantInternalLayer, variantLanguageDirections, variantNegative, variantPrint, variantPseudoClassFunctions, variantPseudoClassesAndElements, variantScope, variantSelector, variantTaggedPseudoClasses, variantVariables, variants };
|
package/dist/variants.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { p as partClasses, a as variantBreakpoints, e as variantColorsMediaOrClass, b as variantCombinators, h as variantCssLayer, d as variantCustomMedia,
|
|
1
|
+
export { p as partClasses, a as variantBreakpoints, e as variantColorsMediaOrClass, b as variantCombinators, h as variantCssLayer, d as variantCustomMedia, o as variantImportant, i as variantInternalLayer, f as variantLanguageDirections, q as variantNegative, c as variantPrint, m as variantPseudoClassFunctions, l as variantPseudoClassesAndElements, j as variantScope, g as variantSelector, n as variantTaggedPseudoClasses, k as variantVariables, v as variants } from './chunks/default3.mjs';
|
|
2
2
|
import './chunks/utilities.mjs';
|
|
3
3
|
import '@unocss/core';
|
|
4
4
|
import './chunks/variants.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-mini",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.1",
|
|
4
4
|
"description": "The minimal preset for UnoCSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"*.css"
|
|
62
62
|
],
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@unocss/core": "0.
|
|
64
|
+
"@unocss/core": "0.41.1"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "unbuild",
|