@unocss/preset-mini 0.29.1 → 0.29.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/default2.cjs +20 -20
- package/dist/chunks/default2.mjs +20 -20
- package/dist/chunks/default3.cjs +49 -41
- package/dist/chunks/default3.mjs +49 -41
- package/dist/chunks/variants.cjs +22 -16
- package/dist/chunks/variants.mjs +22 -16
- package/dist/utils.d.ts +5 -5
- package/dist/variants.d.ts +3 -3
- package/package.json +2 -2
package/dist/chunks/default2.cjs
CHANGED
|
@@ -9,7 +9,7 @@ const verticalAlignAlias = {
|
|
|
9
9
|
btm: "bottom"
|
|
10
10
|
};
|
|
11
11
|
const verticalAligns = [
|
|
12
|
-
[/^(?:vertical|align|v)-(baseline|top|middle|bottom|text-top|text-bottom|sub|super|mid|base|btm)$/, ([, v]) => ({ "vertical-align": verticalAlignAlias[v] || v })]
|
|
12
|
+
[/^(?:vertical|align|v)-(baseline|top|middle|bottom|text-top|text-bottom|sub|super|mid|base|btm)$/, ([, v]) => ({ "vertical-align": verticalAlignAlias[v] || v }), { autocomplete: "(vertical|align|v)-(baseline|top|middle|bottom|text-top|text-bottom|sub|super|mid|base|btm)" }]
|
|
13
13
|
];
|
|
14
14
|
const textAligns = [
|
|
15
15
|
["text-center", { "text-align": "center" }],
|
|
@@ -19,11 +19,11 @@ const textAligns = [
|
|
|
19
19
|
];
|
|
20
20
|
|
|
21
21
|
const outline = [
|
|
22
|
-
[/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) })],
|
|
23
|
-
[/^outline-(?:color-)?(.+)$/, utilities.colorResolver("outline-color", "outline-color")],
|
|
24
|
-
[/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) })],
|
|
22
|
+
[/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) }), { autocomplete: "outline-(width|size)-<num>" }],
|
|
23
|
+
[/^outline-(?:color-)?(.+)$/, utilities.colorResolver("outline-color", "outline-color"), { autocomplete: "outline-$colors" }],
|
|
24
|
+
[/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) }), { autocomplete: "outline-(offset)-<num>" }],
|
|
25
25
|
["outline", { "outline-style": "solid" }],
|
|
26
|
-
[/^outline-(auto|dashed|dotted|double|hidden|solid|groove|ridge|inset|outset|inherit|initial|revert|unset)$/, ([, c]) => ({ "outline-style": c })],
|
|
26
|
+
[/^outline-(auto|dashed|dotted|double|hidden|solid|groove|ridge|inset|outset|inherit|initial|revert|unset)$/, ([, c]) => ({ "outline-style": c }), { autocomplete: "outline-(auto|dashed|dotted|double|hidden|solid|groove|ridge|inset|outset|inherit|initial|revert|unset)" }],
|
|
27
27
|
["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }]
|
|
28
28
|
];
|
|
29
29
|
const appearance = [
|
|
@@ -48,22 +48,22 @@ const borders = [
|
|
|
48
48
|
[/^(?:border|b)-([rltbse])(?:-(.+))?$/, handlerBorder],
|
|
49
49
|
[/^(?:border|b)-(block|inline)(?:-(.+))?$/, handlerBorder],
|
|
50
50
|
[/^(?:border|b)-([bi][se])(?:-(.+))?$/, handlerBorder],
|
|
51
|
-
[/^(?:border|b)-()(?:width|size)-(.+)$/, handlerBorderSize, { autocomplete: "(border|b)-<num>" }],
|
|
51
|
+
[/^(?:border|b)-()(?:width|size)-(.+)$/, handlerBorderSize, { autocomplete: ["(border|b)-<num>", "(border|b)-<directions>-<num>"] }],
|
|
52
52
|
[/^(?:border|b)-([xy])-(?:width|size)-(.+)$/, handlerBorderSize],
|
|
53
53
|
[/^(?:border|b)-([rltbse])-(?:width|size)-(.+)$/, handlerBorderSize],
|
|
54
54
|
[/^(?:border|b)-(block|inline)-(?:width|size)-(.+)$/, handlerBorderSize],
|
|
55
55
|
[/^(?:border|b)-([bi][se])-(?:width|size)-(.+)$/, handlerBorderSize],
|
|
56
|
-
[/^(?:border|b)-()(?:color-)?(.+)$/, handlerBorderColor, { autocomplete: "(border|b)-$colors" }],
|
|
56
|
+
[/^(?:border|b)-()(?:color-)?(.+)$/, handlerBorderColor, { autocomplete: ["(border|b)-$colors", "(border|b)-<directions>-$colors"] }],
|
|
57
57
|
[/^(?:border|b)-([xy])-(?:color-)?(.+)$/, handlerBorderColor],
|
|
58
58
|
[/^(?:border|b)-([rltbse])-(?:color-)?(.+)$/, handlerBorderColor],
|
|
59
59
|
[/^(?:border|b)-(block|inline)-(?:color-)?(.+)$/, handlerBorderColor],
|
|
60
60
|
[/^(?:border|b)-([bi][se])-(?:color-)?(.+)$/, handlerBorderColor],
|
|
61
|
-
[/^(?:border|b)-()op(?:acity)?-?(.+)$/, handlerBorderOpacity, { autocomplete: "(border|b)-(op|opacity)-<
|
|
61
|
+
[/^(?:border|b)-()op(?:acity)?-?(.+)$/, handlerBorderOpacity, { autocomplete: "(border|b)-(op|opacity)-<percent>" }],
|
|
62
62
|
[/^(?:border|b)-([xy])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
63
63
|
[/^(?:border|b)-([rltbse])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
64
64
|
[/^(?:border|b)-(block|inline)-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
65
65
|
[/^(?:border|b)-([bi][se])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
66
|
-
[/^(?:border-|b-)?(?:rounded|rd)()(?:-(.+))?$/, handlerRounded, { autocomplete: ["(border|b)-(rounded
|
|
66
|
+
[/^(?:border-|b-)?(?:rounded|rd)()(?:-(.+))?$/, handlerRounded, { autocomplete: ["(border|b)-(rounded|rd)", "(border|b)-(rounded|rd)-<num>", "(rounded|rd)", "(rounded|rd)-<num>"] }],
|
|
67
67
|
[/^(?:border-|b-)?(?:rounded|rd)-([rltb])(?:-(.+))?$/, handlerRounded],
|
|
68
68
|
[/^(?:border-|b-)?(?:rounded|rd)-([rltb]{2})(?:-(.+))?$/, handlerRounded],
|
|
69
69
|
[/^(?:border-|b-)?(?:rounded|rd)-([bi][se])(?:-(.+))?$/, handlerRounded],
|
|
@@ -139,11 +139,11 @@ const opacity = [
|
|
|
139
139
|
];
|
|
140
140
|
const textColors = [
|
|
141
141
|
[/^(?:text|color|c)-(.+)$/, utilities.colorResolver("color", "text"), { autocomplete: "(text|color|c)-$colors" }],
|
|
142
|
-
[/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-text-opacity": utilities.handler.bracket.percent(opacity2) }), { autocomplete: "(text|color|c)-(op|opacity)-<
|
|
142
|
+
[/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-text-opacity": utilities.handler.bracket.percent(opacity2) }), { autocomplete: "(text|color|c)-(op|opacity)-<percent>" }]
|
|
143
143
|
];
|
|
144
144
|
const bgColors = [
|
|
145
|
-
[/^bg-(.+)$/, utilities.colorResolver("background-color", "bg")],
|
|
146
|
-
[/^bg-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-bg-opacity": utilities.handler.bracket.percent(opacity2) })]
|
|
145
|
+
[/^bg-(.+)$/, utilities.colorResolver("background-color", "bg"), { autocomplete: "bg-$colors" }],
|
|
146
|
+
[/^bg-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-bg-opacity": utilities.handler.bracket.percent(opacity2) }), { autocomplete: "bg-(op|opacity)-<percent>" }]
|
|
147
147
|
];
|
|
148
148
|
|
|
149
149
|
const transitionPropertyGroup = {
|
|
@@ -568,7 +568,7 @@ const rings = [
|
|
|
568
568
|
["ring-offset", { "--un-ring-offset-width": "1px" }],
|
|
569
569
|
[/^ring-offset-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "--un-ring-offset-width": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) })],
|
|
570
570
|
[/^ring-(.+)$/, utilities.colorResolver("--un-ring-color", "ring"), { autocomplete: "ring-$colors" }],
|
|
571
|
-
[/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "ring-(op|opacity)-<
|
|
571
|
+
[/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "ring-(op|opacity)-<percent>" }],
|
|
572
572
|
[/^ring-offset-(.+)$/, utilities.colorResolver("--un-ring-offset-color", "ring-offset")],
|
|
573
573
|
[/^ring-offset-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-offset-opacity": utilities.handler.bracket.percent(opacity) })],
|
|
574
574
|
["ring-inset", { "--un-ring-inset": "inset" }]
|
|
@@ -838,9 +838,9 @@ ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
|
|
|
838
838
|
];
|
|
839
839
|
|
|
840
840
|
const textDecorations = [
|
|
841
|
-
[/^(?:decoration-)?(underline|overline|line-through)$/, ([, s]) => ({ "text-decoration-line": s })],
|
|
842
|
-
[/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? utilities.handler.bracket.cssvar.px(s) })],
|
|
843
|
-
[/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s })],
|
|
841
|
+
[/^(?:decoration-)?(underline|overline|line-through)$/, ([, s]) => ({ "text-decoration-line": s }), { autocomplete: "decoration-(underline|overline|line-through)" }],
|
|
842
|
+
[/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? utilities.handler.bracket.cssvar.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
|
|
843
|
+
[/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s }), { autocomplete: "(underline|decoration)-(auto|from-font)" }],
|
|
844
844
|
[/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
|
|
845
845
|
const result = utilities.colorResolver("text-decoration-color", "line")(match, ctx);
|
|
846
846
|
if (result) {
|
|
@@ -849,10 +849,10 @@ const textDecorations = [
|
|
|
849
849
|
...result
|
|
850
850
|
};
|
|
851
851
|
}
|
|
852
|
-
}],
|
|
853
|
-
[/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": utilities.handler.bracket.percent(opacity) })],
|
|
854
|
-
[/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? utilities.handler.auto.bracket.cssvar.px(s) })],
|
|
855
|
-
[/^(?:underline|decoration)-(solid|double|dotted|dashed|wavy|inherit|initial|revert|unset)$/, ([, d]) => ({ "text-decoration-style": d })],
|
|
852
|
+
}, { autocomplete: "(underline|decoration)-$colors" }],
|
|
853
|
+
[/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "(underline|decoration)-(op|opacity)-<percent>" }],
|
|
854
|
+
[/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? utilities.handler.auto.bracket.cssvar.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
|
|
855
|
+
[/^(?:underline|decoration)-(solid|double|dotted|dashed|wavy|inherit|initial|revert|unset)$/, ([, d]) => ({ "text-decoration-style": d }), { autocomplete: "(underline|decoration)-(solid|double|dotted|dashed|wavy|inherit|initial|revert|unset)" }],
|
|
856
856
|
["no-underline", { "text-decoration": "none" }],
|
|
857
857
|
["decoration-none", { "text-decoration": "none" }]
|
|
858
858
|
];
|
package/dist/chunks/default2.mjs
CHANGED
|
@@ -7,7 +7,7 @@ const verticalAlignAlias = {
|
|
|
7
7
|
btm: "bottom"
|
|
8
8
|
};
|
|
9
9
|
const verticalAligns = [
|
|
10
|
-
[/^(?:vertical|align|v)-(baseline|top|middle|bottom|text-top|text-bottom|sub|super|mid|base|btm)$/, ([, v]) => ({ "vertical-align": verticalAlignAlias[v] || v })]
|
|
10
|
+
[/^(?:vertical|align|v)-(baseline|top|middle|bottom|text-top|text-bottom|sub|super|mid|base|btm)$/, ([, v]) => ({ "vertical-align": verticalAlignAlias[v] || v }), { autocomplete: "(vertical|align|v)-(baseline|top|middle|bottom|text-top|text-bottom|sub|super|mid|base|btm)" }]
|
|
11
11
|
];
|
|
12
12
|
const textAligns = [
|
|
13
13
|
["text-center", { "text-align": "center" }],
|
|
@@ -17,11 +17,11 @@ const textAligns = [
|
|
|
17
17
|
];
|
|
18
18
|
|
|
19
19
|
const outline = [
|
|
20
|
-
[/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ?? handler.bracket.cssvar.px(d) })],
|
|
21
|
-
[/^outline-(?:color-)?(.+)$/, colorResolver("outline-color", "outline-color")],
|
|
22
|
-
[/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ?? handler.bracket.cssvar.px(d) })],
|
|
20
|
+
[/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ?? handler.bracket.cssvar.px(d) }), { autocomplete: "outline-(width|size)-<num>" }],
|
|
21
|
+
[/^outline-(?:color-)?(.+)$/, colorResolver("outline-color", "outline-color"), { autocomplete: "outline-$colors" }],
|
|
22
|
+
[/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ?? handler.bracket.cssvar.px(d) }), { autocomplete: "outline-(offset)-<num>" }],
|
|
23
23
|
["outline", { "outline-style": "solid" }],
|
|
24
|
-
[/^outline-(auto|dashed|dotted|double|hidden|solid|groove|ridge|inset|outset|inherit|initial|revert|unset)$/, ([, c]) => ({ "outline-style": c })],
|
|
24
|
+
[/^outline-(auto|dashed|dotted|double|hidden|solid|groove|ridge|inset|outset|inherit|initial|revert|unset)$/, ([, c]) => ({ "outline-style": c }), { autocomplete: "outline-(auto|dashed|dotted|double|hidden|solid|groove|ridge|inset|outset|inherit|initial|revert|unset)" }],
|
|
25
25
|
["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }]
|
|
26
26
|
];
|
|
27
27
|
const appearance = [
|
|
@@ -46,22 +46,22 @@ const borders = [
|
|
|
46
46
|
[/^(?:border|b)-([rltbse])(?:-(.+))?$/, handlerBorder],
|
|
47
47
|
[/^(?:border|b)-(block|inline)(?:-(.+))?$/, handlerBorder],
|
|
48
48
|
[/^(?:border|b)-([bi][se])(?:-(.+))?$/, handlerBorder],
|
|
49
|
-
[/^(?:border|b)-()(?:width|size)-(.+)$/, handlerBorderSize, { autocomplete: "(border|b)-<num>" }],
|
|
49
|
+
[/^(?:border|b)-()(?:width|size)-(.+)$/, handlerBorderSize, { autocomplete: ["(border|b)-<num>", "(border|b)-<directions>-<num>"] }],
|
|
50
50
|
[/^(?:border|b)-([xy])-(?:width|size)-(.+)$/, handlerBorderSize],
|
|
51
51
|
[/^(?:border|b)-([rltbse])-(?:width|size)-(.+)$/, handlerBorderSize],
|
|
52
52
|
[/^(?:border|b)-(block|inline)-(?:width|size)-(.+)$/, handlerBorderSize],
|
|
53
53
|
[/^(?:border|b)-([bi][se])-(?:width|size)-(.+)$/, handlerBorderSize],
|
|
54
|
-
[/^(?:border|b)-()(?:color-)?(.+)$/, handlerBorderColor, { autocomplete: "(border|b)-$colors" }],
|
|
54
|
+
[/^(?:border|b)-()(?:color-)?(.+)$/, handlerBorderColor, { autocomplete: ["(border|b)-$colors", "(border|b)-<directions>-$colors"] }],
|
|
55
55
|
[/^(?:border|b)-([xy])-(?:color-)?(.+)$/, handlerBorderColor],
|
|
56
56
|
[/^(?:border|b)-([rltbse])-(?:color-)?(.+)$/, handlerBorderColor],
|
|
57
57
|
[/^(?:border|b)-(block|inline)-(?:color-)?(.+)$/, handlerBorderColor],
|
|
58
58
|
[/^(?:border|b)-([bi][se])-(?:color-)?(.+)$/, handlerBorderColor],
|
|
59
|
-
[/^(?:border|b)-()op(?:acity)?-?(.+)$/, handlerBorderOpacity, { autocomplete: "(border|b)-(op|opacity)-<
|
|
59
|
+
[/^(?:border|b)-()op(?:acity)?-?(.+)$/, handlerBorderOpacity, { autocomplete: "(border|b)-(op|opacity)-<percent>" }],
|
|
60
60
|
[/^(?:border|b)-([xy])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
61
61
|
[/^(?:border|b)-([rltbse])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
62
62
|
[/^(?:border|b)-(block|inline)-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
63
63
|
[/^(?:border|b)-([bi][se])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
64
|
-
[/^(?:border-|b-)?(?:rounded|rd)()(?:-(.+))?$/, handlerRounded, { autocomplete: ["(border|b)-(rounded
|
|
64
|
+
[/^(?:border-|b-)?(?:rounded|rd)()(?:-(.+))?$/, handlerRounded, { autocomplete: ["(border|b)-(rounded|rd)", "(border|b)-(rounded|rd)-<num>", "(rounded|rd)", "(rounded|rd)-<num>"] }],
|
|
65
65
|
[/^(?:border-|b-)?(?:rounded|rd)-([rltb])(?:-(.+))?$/, handlerRounded],
|
|
66
66
|
[/^(?:border-|b-)?(?:rounded|rd)-([rltb]{2})(?:-(.+))?$/, handlerRounded],
|
|
67
67
|
[/^(?:border-|b-)?(?:rounded|rd)-([bi][se])(?:-(.+))?$/, handlerRounded],
|
|
@@ -137,11 +137,11 @@ const opacity = [
|
|
|
137
137
|
];
|
|
138
138
|
const textColors = [
|
|
139
139
|
[/^(?:text|color|c)-(.+)$/, colorResolver("color", "text"), { autocomplete: "(text|color|c)-$colors" }],
|
|
140
|
-
[/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-text-opacity": handler.bracket.percent(opacity2) }), { autocomplete: "(text|color|c)-(op|opacity)-<
|
|
140
|
+
[/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-text-opacity": handler.bracket.percent(opacity2) }), { autocomplete: "(text|color|c)-(op|opacity)-<percent>" }]
|
|
141
141
|
];
|
|
142
142
|
const bgColors = [
|
|
143
|
-
[/^bg-(.+)$/, colorResolver("background-color", "bg")],
|
|
144
|
-
[/^bg-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-bg-opacity": handler.bracket.percent(opacity2) })]
|
|
143
|
+
[/^bg-(.+)$/, colorResolver("background-color", "bg"), { autocomplete: "bg-$colors" }],
|
|
144
|
+
[/^bg-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-bg-opacity": handler.bracket.percent(opacity2) }), { autocomplete: "bg-(op|opacity)-<percent>" }]
|
|
145
145
|
];
|
|
146
146
|
|
|
147
147
|
const transitionPropertyGroup = {
|
|
@@ -566,7 +566,7 @@ const rings = [
|
|
|
566
566
|
["ring-offset", { "--un-ring-offset-width": "1px" }],
|
|
567
567
|
[/^ring-offset-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "--un-ring-offset-width": theme.lineWidth?.[d] ?? handler.bracket.cssvar.px(d) })],
|
|
568
568
|
[/^ring-(.+)$/, colorResolver("--un-ring-color", "ring"), { autocomplete: "ring-$colors" }],
|
|
569
|
-
[/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": handler.bracket.percent(opacity) }), { autocomplete: "ring-(op|opacity)-<
|
|
569
|
+
[/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": handler.bracket.percent(opacity) }), { autocomplete: "ring-(op|opacity)-<percent>" }],
|
|
570
570
|
[/^ring-offset-(.+)$/, colorResolver("--un-ring-offset-color", "ring-offset")],
|
|
571
571
|
[/^ring-offset-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-offset-opacity": handler.bracket.percent(opacity) })],
|
|
572
572
|
["ring-inset", { "--un-ring-inset": "inset" }]
|
|
@@ -836,9 +836,9 @@ ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
|
|
|
836
836
|
];
|
|
837
837
|
|
|
838
838
|
const textDecorations = [
|
|
839
|
-
[/^(?:decoration-)?(underline|overline|line-through)$/, ([, s]) => ({ "text-decoration-line": s })],
|
|
840
|
-
[/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? handler.bracket.cssvar.px(s) })],
|
|
841
|
-
[/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s })],
|
|
839
|
+
[/^(?:decoration-)?(underline|overline|line-through)$/, ([, s]) => ({ "text-decoration-line": s }), { autocomplete: "decoration-(underline|overline|line-through)" }],
|
|
840
|
+
[/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? handler.bracket.cssvar.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
|
|
841
|
+
[/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s }), { autocomplete: "(underline|decoration)-(auto|from-font)" }],
|
|
842
842
|
[/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
|
|
843
843
|
const result = colorResolver("text-decoration-color", "line")(match, ctx);
|
|
844
844
|
if (result) {
|
|
@@ -847,10 +847,10 @@ const textDecorations = [
|
|
|
847
847
|
...result
|
|
848
848
|
};
|
|
849
849
|
}
|
|
850
|
-
}],
|
|
851
|
-
[/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": handler.bracket.percent(opacity) })],
|
|
852
|
-
[/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? handler.auto.bracket.cssvar.px(s) })],
|
|
853
|
-
[/^(?:underline|decoration)-(solid|double|dotted|dashed|wavy|inherit|initial|revert|unset)$/, ([, d]) => ({ "text-decoration-style": d })],
|
|
850
|
+
}, { autocomplete: "(underline|decoration)-$colors" }],
|
|
851
|
+
[/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": handler.bracket.percent(opacity) }), { autocomplete: "(underline|decoration)-(op|opacity)-<percent>" }],
|
|
852
|
+
[/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? handler.auto.bracket.cssvar.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
|
|
853
|
+
[/^(?:underline|decoration)-(solid|double|dotted|dashed|wavy|inherit|initial|revert|unset)$/, ([, d]) => ({ "text-decoration-style": d }), { autocomplete: "(underline|decoration)-(solid|double|dotted|dashed|wavy|inherit|initial|revert|unset)" }],
|
|
854
854
|
["no-underline", { "text-decoration": "none" }],
|
|
855
855
|
["decoration-none", { "text-decoration": "none" }]
|
|
856
856
|
];
|
package/dist/chunks/default3.cjs
CHANGED
|
@@ -10,40 +10,43 @@ const calcMaxWidthBySize = (size) => {
|
|
|
10
10
|
const maxWidth = parseFloat(value) - 0.1;
|
|
11
11
|
return Number.isNaN(maxWidth) ? size : `${maxWidth}${unit}`;
|
|
12
12
|
};
|
|
13
|
-
const variantBreakpoints =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
13
|
+
const variantBreakpoints = {
|
|
14
|
+
match(matcher, { theme }) {
|
|
15
|
+
const variantEntries = Object.entries(theme.breakpoints || {}).map(([point, size], idx) => [point, size, idx]);
|
|
16
|
+
for (const [point, size, idx] of variantEntries) {
|
|
17
|
+
if (!regexCache[point])
|
|
18
|
+
regexCache[point] = new RegExp(`^((?:[al]t-)?${point}[:-])`);
|
|
19
|
+
const match = matcher.match(regexCache[point]);
|
|
20
|
+
if (!match)
|
|
21
|
+
continue;
|
|
22
|
+
const [, pre] = match;
|
|
23
|
+
const m = matcher.slice(pre.length);
|
|
24
|
+
if (m === "container")
|
|
25
|
+
continue;
|
|
26
|
+
const isLtPrefix = pre.startsWith("lt-");
|
|
27
|
+
const isAtPrefix = pre.startsWith("at-");
|
|
28
|
+
let order = 1e3;
|
|
29
|
+
if (isLtPrefix) {
|
|
30
|
+
order -= idx + 1;
|
|
31
|
+
return {
|
|
32
|
+
matcher: m,
|
|
33
|
+
parent: [`@media (max-width: ${calcMaxWidthBySize(size)})`, order]
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
order += idx + 1;
|
|
37
|
+
if (isAtPrefix && idx < variantEntries.length - 1) {
|
|
38
|
+
return {
|
|
39
|
+
matcher: m,
|
|
40
|
+
parent: [`@media (min-width: ${size}) and (max-width: ${calcMaxWidthBySize(variantEntries[idx + 1][1])})`, order]
|
|
41
|
+
};
|
|
42
|
+
}
|
|
30
43
|
return {
|
|
31
44
|
matcher: m,
|
|
32
|
-
parent: [`@media (
|
|
45
|
+
parent: [`@media (min-width: ${size})`, order]
|
|
33
46
|
};
|
|
34
47
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return {
|
|
38
|
-
matcher: m,
|
|
39
|
-
parent: [`@media (min-width: ${size}) and (max-width: ${calcMaxWidthBySize(variantEntries[idx + 1][1])})`, order]
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
return {
|
|
43
|
-
matcher: m,
|
|
44
|
-
parent: [`@media (min-width: ${size})`, order]
|
|
45
|
-
};
|
|
46
|
-
}
|
|
48
|
+
},
|
|
49
|
+
autocomplete: "(at-|lt-|)$breakpoints:"
|
|
47
50
|
};
|
|
48
51
|
|
|
49
52
|
const scopeMatcher = (strict, name, template) => {
|
|
@@ -250,15 +253,18 @@ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
|
250
253
|
}
|
|
251
254
|
};
|
|
252
255
|
};
|
|
253
|
-
const variantPseudoElements =
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
256
|
+
const variantPseudoElements = {
|
|
257
|
+
match: (input) => {
|
|
258
|
+
const match = input.match(PseudoElementsRE);
|
|
259
|
+
if (match) {
|
|
260
|
+
const pseudo = PseudoElements[match[1]] || `::${match[1]}`;
|
|
261
|
+
return {
|
|
262
|
+
matcher: input.slice(match[0].length),
|
|
263
|
+
selector: (s) => `${s}${pseudo}`
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
autocomplete: `(${PseudoElementsStr}):`
|
|
262
268
|
};
|
|
263
269
|
const variantPseudoClasses = {
|
|
264
270
|
match: (input) => {
|
|
@@ -272,7 +278,8 @@ const variantPseudoClasses = {
|
|
|
272
278
|
};
|
|
273
279
|
}
|
|
274
280
|
},
|
|
275
|
-
multiPass: true
|
|
281
|
+
multiPass: true,
|
|
282
|
+
autocomplete: `(${PseudoClassesStr}):`
|
|
276
283
|
};
|
|
277
284
|
const variantPseudoClassFunctions = {
|
|
278
285
|
match: (input) => {
|
|
@@ -286,7 +293,8 @@ const variantPseudoClassFunctions = {
|
|
|
286
293
|
};
|
|
287
294
|
}
|
|
288
295
|
},
|
|
289
|
-
multiPass: true
|
|
296
|
+
multiPass: true,
|
|
297
|
+
autocomplete: `(${PseudoClassFunctionsStr})-(${PseudoClassesStr}):`
|
|
290
298
|
};
|
|
291
299
|
const variantTaggedPseudoClasses = (options = {}) => {
|
|
292
300
|
const attributify = !!options?.attributifyPseudo;
|
package/dist/chunks/default3.mjs
CHANGED
|
@@ -8,40 +8,43 @@ const calcMaxWidthBySize = (size) => {
|
|
|
8
8
|
const maxWidth = parseFloat(value) - 0.1;
|
|
9
9
|
return Number.isNaN(maxWidth) ? size : `${maxWidth}${unit}`;
|
|
10
10
|
};
|
|
11
|
-
const variantBreakpoints =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
11
|
+
const variantBreakpoints = {
|
|
12
|
+
match(matcher, { theme }) {
|
|
13
|
+
const variantEntries = Object.entries(theme.breakpoints || {}).map(([point, size], idx) => [point, size, idx]);
|
|
14
|
+
for (const [point, size, idx] of variantEntries) {
|
|
15
|
+
if (!regexCache[point])
|
|
16
|
+
regexCache[point] = new RegExp(`^((?:[al]t-)?${point}[:-])`);
|
|
17
|
+
const match = matcher.match(regexCache[point]);
|
|
18
|
+
if (!match)
|
|
19
|
+
continue;
|
|
20
|
+
const [, pre] = match;
|
|
21
|
+
const m = matcher.slice(pre.length);
|
|
22
|
+
if (m === "container")
|
|
23
|
+
continue;
|
|
24
|
+
const isLtPrefix = pre.startsWith("lt-");
|
|
25
|
+
const isAtPrefix = pre.startsWith("at-");
|
|
26
|
+
let order = 1e3;
|
|
27
|
+
if (isLtPrefix) {
|
|
28
|
+
order -= idx + 1;
|
|
29
|
+
return {
|
|
30
|
+
matcher: m,
|
|
31
|
+
parent: [`@media (max-width: ${calcMaxWidthBySize(size)})`, order]
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
order += idx + 1;
|
|
35
|
+
if (isAtPrefix && idx < variantEntries.length - 1) {
|
|
36
|
+
return {
|
|
37
|
+
matcher: m,
|
|
38
|
+
parent: [`@media (min-width: ${size}) and (max-width: ${calcMaxWidthBySize(variantEntries[idx + 1][1])})`, order]
|
|
39
|
+
};
|
|
40
|
+
}
|
|
28
41
|
return {
|
|
29
42
|
matcher: m,
|
|
30
|
-
parent: [`@media (
|
|
43
|
+
parent: [`@media (min-width: ${size})`, order]
|
|
31
44
|
};
|
|
32
45
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return {
|
|
36
|
-
matcher: m,
|
|
37
|
-
parent: [`@media (min-width: ${size}) and (max-width: ${calcMaxWidthBySize(variantEntries[idx + 1][1])})`, order]
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
return {
|
|
41
|
-
matcher: m,
|
|
42
|
-
parent: [`@media (min-width: ${size})`, order]
|
|
43
|
-
};
|
|
44
|
-
}
|
|
46
|
+
},
|
|
47
|
+
autocomplete: "(at-|lt-|)$breakpoints:"
|
|
45
48
|
};
|
|
46
49
|
|
|
47
50
|
const scopeMatcher = (strict, name, template) => {
|
|
@@ -248,15 +251,18 @@ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
|
248
251
|
}
|
|
249
252
|
};
|
|
250
253
|
};
|
|
251
|
-
const variantPseudoElements =
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
254
|
+
const variantPseudoElements = {
|
|
255
|
+
match: (input) => {
|
|
256
|
+
const match = input.match(PseudoElementsRE);
|
|
257
|
+
if (match) {
|
|
258
|
+
const pseudo = PseudoElements[match[1]] || `::${match[1]}`;
|
|
259
|
+
return {
|
|
260
|
+
matcher: input.slice(match[0].length),
|
|
261
|
+
selector: (s) => `${s}${pseudo}`
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
autocomplete: `(${PseudoElementsStr}):`
|
|
260
266
|
};
|
|
261
267
|
const variantPseudoClasses = {
|
|
262
268
|
match: (input) => {
|
|
@@ -270,7 +276,8 @@ const variantPseudoClasses = {
|
|
|
270
276
|
};
|
|
271
277
|
}
|
|
272
278
|
},
|
|
273
|
-
multiPass: true
|
|
279
|
+
multiPass: true,
|
|
280
|
+
autocomplete: `(${PseudoClassesStr}):`
|
|
274
281
|
};
|
|
275
282
|
const variantPseudoClassFunctions = {
|
|
276
283
|
match: (input) => {
|
|
@@ -284,7 +291,8 @@ const variantPseudoClassFunctions = {
|
|
|
284
291
|
};
|
|
285
292
|
}
|
|
286
293
|
},
|
|
287
|
-
multiPass: true
|
|
294
|
+
multiPass: true,
|
|
295
|
+
autocomplete: `(${PseudoClassFunctionsStr})-(${PseudoClassesStr}):`
|
|
288
296
|
};
|
|
289
297
|
const variantTaggedPseudoClasses = (options = {}) => {
|
|
290
298
|
const attributify = !!options?.attributifyPseudo;
|
package/dist/chunks/variants.cjs
CHANGED
|
@@ -4,26 +4,32 @@ const core = require('@unocss/core');
|
|
|
4
4
|
|
|
5
5
|
const variantMatcher = (name, selector) => {
|
|
6
6
|
const re = new RegExp(`^${core.escapeRegExp(name)}[:-]`);
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
return {
|
|
8
|
+
match: (input) => {
|
|
9
|
+
const match = input.match(re);
|
|
10
|
+
if (match) {
|
|
11
|
+
return {
|
|
12
|
+
matcher: input.slice(match[0].length),
|
|
13
|
+
selector
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
autocomplete: `${name}:`
|
|
15
18
|
};
|
|
16
19
|
};
|
|
17
20
|
const variantParentMatcher = (name, parent) => {
|
|
18
21
|
const re = new RegExp(`^${core.escapeRegExp(name)}[:-]`);
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
return {
|
|
23
|
+
match: (input) => {
|
|
24
|
+
const match = input.match(re);
|
|
25
|
+
if (match) {
|
|
26
|
+
return {
|
|
27
|
+
matcher: input.slice(match[0].length),
|
|
28
|
+
parent
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
autocomplete: `${name}:`
|
|
27
33
|
};
|
|
28
34
|
};
|
|
29
35
|
|
package/dist/chunks/variants.mjs
CHANGED
|
@@ -2,26 +2,32 @@ import { escapeRegExp } from '@unocss/core';
|
|
|
2
2
|
|
|
3
3
|
const variantMatcher = (name, selector) => {
|
|
4
4
|
const re = new RegExp(`^${escapeRegExp(name)}[:-]`);
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
return {
|
|
6
|
+
match: (input) => {
|
|
7
|
+
const match = input.match(re);
|
|
8
|
+
if (match) {
|
|
9
|
+
return {
|
|
10
|
+
matcher: input.slice(match[0].length),
|
|
11
|
+
selector
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
autocomplete: `${name}:`
|
|
13
16
|
};
|
|
14
17
|
};
|
|
15
18
|
const variantParentMatcher = (name, parent) => {
|
|
16
19
|
const re = new RegExp(`^${escapeRegExp(name)}[:-]`);
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
return {
|
|
21
|
+
match: (input) => {
|
|
22
|
+
const match = input.match(re);
|
|
23
|
+
if (match) {
|
|
24
|
+
return {
|
|
25
|
+
matcher: input.slice(match[0].length),
|
|
26
|
+
parent
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
autocomplete: `${name}:`
|
|
25
31
|
};
|
|
26
32
|
};
|
|
27
33
|
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _unocss_core from '@unocss/core';
|
|
2
|
-
import { RGBAColorValue, CSSColorValue,
|
|
2
|
+
import { RGBAColorValue, CSSColorValue, VariantObject } from '@unocss/core';
|
|
3
3
|
export { c as colorResolver, a as colorableShadows, d as directionSize, h as hasParseableColor, p as parseColor } from './utilities-820bcff8.js';
|
|
4
4
|
import './types-f7b2c653.js';
|
|
5
5
|
|
|
@@ -65,10 +65,10 @@ declare namespace handlers {
|
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
declare const handler: _unocss_core.ValueHandler<"number" | "auto" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "cssvar" | "time" | "degree" | "
|
|
69
|
-
declare const h: _unocss_core.ValueHandler<"number" | "auto" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "cssvar" | "time" | "degree" | "
|
|
68
|
+
declare const handler: _unocss_core.ValueHandler<"number" | "global" | "auto" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "cssvar" | "time" | "degree" | "properties">;
|
|
69
|
+
declare const h: _unocss_core.ValueHandler<"number" | "global" | "auto" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "cssvar" | "time" | "degree" | "properties">;
|
|
70
70
|
|
|
71
|
-
declare const variantMatcher: (name: string, selector?: ((input: string) => string | undefined) | undefined) =>
|
|
72
|
-
declare const variantParentMatcher: (name: string, parent: string) =>
|
|
71
|
+
declare const variantMatcher: (name: string, selector?: ((input: string) => string | undefined) | undefined) => VariantObject;
|
|
72
|
+
declare const variantParentMatcher: (name: string, parent: string) => VariantObject;
|
|
73
73
|
|
|
74
74
|
export { colorToString, cornerMap, directionMap, getComponents, h, handler, hex2rgba, insetMap, parseCssColor, positionMap, handlers as valueHandlers, variantMatcher, variantParentMatcher, xyzMap };
|
package/dist/variants.d.ts
CHANGED
|
@@ -9,10 +9,10 @@ declare const variantBreakpoints: Variant<Theme>;
|
|
|
9
9
|
|
|
10
10
|
declare const variantCombinators: Variant[];
|
|
11
11
|
|
|
12
|
-
declare const variantPrint:
|
|
12
|
+
declare const variantPrint: Variant;
|
|
13
13
|
declare const variantCustomMedia: VariantFunction;
|
|
14
14
|
|
|
15
|
-
declare const variantColorsMediaOrClass: (options?: PresetMiniOptions) =>
|
|
15
|
+
declare const variantColorsMediaOrClass: (options?: PresetMiniOptions) => Variant[];
|
|
16
16
|
|
|
17
17
|
declare const variants: (options: PresetMiniOptions) => Variant<Theme>[];
|
|
18
18
|
|
|
@@ -24,7 +24,7 @@ declare const variantScope: Variant;
|
|
|
24
24
|
declare const variantImportant: Variant;
|
|
25
25
|
declare const variantNegative: Variant;
|
|
26
26
|
|
|
27
|
-
declare const variantPseudoElements:
|
|
27
|
+
declare const variantPseudoElements: VariantObject;
|
|
28
28
|
declare const variantPseudoClasses: VariantObject;
|
|
29
29
|
declare const variantPseudoClassFunctions: VariantObject;
|
|
30
30
|
declare const variantTaggedPseudoClasses: (options?: PresetMiniOptions) => VariantObject[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-mini",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.4",
|
|
4
4
|
"description": "The minimal preset for UnoCSS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unocss",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
],
|
|
62
62
|
"sideEffects": false,
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@unocss/core": "0.29.
|
|
64
|
+
"@unocss/core": "0.29.4"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "unbuild",
|