@unocss/preset-mini 0.44.7 → 0.45.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/colors.cjs +704 -333
- package/dist/chunks/colors.mjs +680 -333
- package/dist/chunks/colors2.cjs +333 -700
- package/dist/chunks/colors2.mjs +333 -676
- package/dist/chunks/decoration.cjs +770 -0
- package/dist/chunks/decoration.mjs +724 -0
- package/dist/chunks/default.cjs +291 -280
- package/dist/chunks/default.mjs +278 -256
- package/dist/chunks/default2.cjs +276 -753
- package/dist/chunks/default2.mjs +252 -715
- package/dist/chunks/default3.cjs +2 -2
- package/dist/chunks/default3.mjs +2 -2
- package/dist/colors.cjs +1 -1
- package/dist/colors.mjs +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +6 -6
- package/dist/rules.cjs +48 -48
- package/dist/rules.mjs +3 -3
- package/dist/theme.cjs +4 -4
- package/dist/theme.mjs +4 -4
- package/dist/utils.cjs +1 -1
- package/dist/utils.mjs +1 -1
- package/dist/variants.cjs +1 -1
- package/dist/variants.d.ts +1 -1
- package/dist/variants.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunks/transform.cjs +0 -298
- package/dist/chunks/transform.mjs +0 -277
package/dist/chunks/default.cjs
CHANGED
|
@@ -1,295 +1,306 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const decoration = require('./decoration.cjs');
|
|
3
4
|
const colors = require('./colors.cjs');
|
|
4
|
-
|
|
5
|
+
require('@unocss/core');
|
|
5
6
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
'"Apple Color Emoji"',
|
|
19
|
-
'"Segoe UI Emoji"',
|
|
20
|
-
'"Segoe UI Symbol"',
|
|
21
|
-
'"Noto Color Emoji"'
|
|
22
|
-
].join(","),
|
|
23
|
-
serif: [
|
|
24
|
-
"ui-serif",
|
|
25
|
-
"Georgia",
|
|
26
|
-
"Cambria",
|
|
27
|
-
'"Times New Roman"',
|
|
28
|
-
"Times",
|
|
29
|
-
"serif"
|
|
30
|
-
].join(","),
|
|
31
|
-
mono: [
|
|
32
|
-
"ui-monospace",
|
|
33
|
-
"SFMono-Regular",
|
|
34
|
-
"Menlo",
|
|
35
|
-
"Monaco",
|
|
36
|
-
"Consolas",
|
|
37
|
-
'"Liberation Mono"',
|
|
38
|
-
'"Courier New"',
|
|
39
|
-
"monospace"
|
|
40
|
-
].join(",")
|
|
41
|
-
};
|
|
42
|
-
const fontSize = {
|
|
43
|
-
"xs": ["0.75rem", "1rem"],
|
|
44
|
-
"sm": ["0.875rem", "1.25rem"],
|
|
45
|
-
"base": ["1rem", "1.5rem"],
|
|
46
|
-
"lg": ["1.125rem", "1.75rem"],
|
|
47
|
-
"xl": ["1.25rem", "1.75rem"],
|
|
48
|
-
"2xl": ["1.5rem", "2rem"],
|
|
49
|
-
"3xl": ["1.875rem", "2.25rem"],
|
|
50
|
-
"4xl": ["2.25rem", "2.5rem"],
|
|
51
|
-
"5xl": ["3rem", "1"],
|
|
52
|
-
"6xl": ["3.75rem", "1"],
|
|
53
|
-
"7xl": ["4.5rem", "1"],
|
|
54
|
-
"8xl": ["6rem", "1"],
|
|
55
|
-
"9xl": ["8rem", "1"]
|
|
56
|
-
};
|
|
57
|
-
const textIndent = {
|
|
58
|
-
"DEFAULT": "1.5rem",
|
|
59
|
-
"xs": "0.5rem",
|
|
60
|
-
"sm": "1rem",
|
|
61
|
-
"md": "1.5rem",
|
|
62
|
-
"lg": "2rem",
|
|
63
|
-
"xl": "2.5rem",
|
|
64
|
-
"2xl": "3rem",
|
|
65
|
-
"3xl": "4rem"
|
|
66
|
-
};
|
|
67
|
-
const textStrokeWidth = {
|
|
68
|
-
DEFAULT: "1.5rem",
|
|
69
|
-
none: "0",
|
|
70
|
-
sm: "thin",
|
|
71
|
-
md: "medium",
|
|
72
|
-
lg: "thick"
|
|
73
|
-
};
|
|
74
|
-
const textShadow = {
|
|
75
|
-
DEFAULT: ["0 0 1px rgba(0,0,0,0.2)", "0 0 1px rgba(1,0,5,0.1)"],
|
|
76
|
-
none: "0 0 rgba(0,0,0,0)",
|
|
77
|
-
sm: "1px 1px 3px rgba(36,37,47,0.25)",
|
|
78
|
-
md: ["0 1px 2px rgba(30,29,39,0.19)", "1px 2px 4px rgba(54,64,147,0.18)"],
|
|
79
|
-
lg: ["3px 3px 6px rgba(0,0,0,0.26)", "0 0 5px rgba(15,3,86,0.22)"],
|
|
80
|
-
xl: ["1px 1px 3px rgba(0,0,0,0.29)", "2px 4px 7px rgba(73,64,125,0.35)"]
|
|
81
|
-
};
|
|
82
|
-
const lineHeight = {
|
|
83
|
-
none: "1",
|
|
84
|
-
tight: "1.25",
|
|
85
|
-
snug: "1.375",
|
|
86
|
-
normal: "1.5",
|
|
87
|
-
relaxed: "1.625",
|
|
88
|
-
loose: "2"
|
|
89
|
-
};
|
|
90
|
-
const letterSpacing = {
|
|
91
|
-
tighter: "-0.05em",
|
|
92
|
-
tight: "-0.025em",
|
|
93
|
-
normal: "0em",
|
|
94
|
-
wide: "0.025em",
|
|
95
|
-
wider: "0.05em",
|
|
96
|
-
widest: "0.1em"
|
|
97
|
-
};
|
|
98
|
-
const wordSpacing = letterSpacing;
|
|
7
|
+
const opacity = [
|
|
8
|
+
[/^op(?:acity)?-?(.+)$/, ([, d]) => ({ opacity: colors.handler.bracket.percent.cssvar(d) })]
|
|
9
|
+
];
|
|
10
|
+
const textColors = [
|
|
11
|
+
[/^(?:color|c)-(.+)$/, colors.colorResolver("color", "text"), { autocomplete: "(text|color|c)-$colors" }],
|
|
12
|
+
[/^text-(.+)$/, colors.colorResolver("color", "text", (css) => !css.color?.toString().match(colors.numberWithUnitRE)), { autocomplete: "(text|color|c)-$colors" }],
|
|
13
|
+
[/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-text-opacity": colors.handler.bracket.percent(opacity2) }), { autocomplete: "(text|color|c)-(op|opacity)-<percent>" }]
|
|
14
|
+
];
|
|
15
|
+
const bgColors = [
|
|
16
|
+
[/^bg-(.+)$/, colors.colorResolver("background-color", "bg"), { autocomplete: "bg-$colors" }],
|
|
17
|
+
[/^bg-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-bg-opacity": colors.handler.bracket.percent(opacity2) }), { autocomplete: "bg-(op|opacity)-<percent>" }]
|
|
18
|
+
];
|
|
99
19
|
|
|
100
|
-
const
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
|
|
120
|
-
"3xl": "1.875rem",
|
|
121
|
-
"4xl": "2.25rem",
|
|
122
|
-
"5xl": "3rem",
|
|
123
|
-
"6xl": "3.75rem",
|
|
124
|
-
"7xl": "4.5rem",
|
|
125
|
-
"8xl": "6rem",
|
|
126
|
-
"9xl": "8rem"
|
|
127
|
-
};
|
|
128
|
-
const duration = {
|
|
129
|
-
DEFAULT: "150ms",
|
|
130
|
-
none: "0ms",
|
|
131
|
-
75: "75ms",
|
|
132
|
-
100: "100ms",
|
|
133
|
-
150: "150ms",
|
|
134
|
-
200: "200ms",
|
|
135
|
-
300: "300ms",
|
|
136
|
-
500: "500ms",
|
|
137
|
-
700: "700ms",
|
|
138
|
-
1e3: "1000ms"
|
|
139
|
-
};
|
|
140
|
-
const borderRadius = {
|
|
141
|
-
"DEFAULT": "0.25rem",
|
|
142
|
-
"none": "0rem",
|
|
143
|
-
"sm": "0.125rem",
|
|
144
|
-
"md": "0.375rem",
|
|
145
|
-
"lg": "0.5rem",
|
|
146
|
-
"xl": "0.75rem",
|
|
147
|
-
"2xl": "1rem",
|
|
148
|
-
"3xl": "1.5rem",
|
|
149
|
-
"full": "9999px"
|
|
150
|
-
};
|
|
151
|
-
const boxShadow = {
|
|
152
|
-
"DEFAULT": ["var(--un-shadow-inset) 0 1px 3px 0 rgba(0,0,0,0.1)", "var(--un-shadow-inset) 0 1px 2px -1px rgba(0,0,0,0.1)"],
|
|
153
|
-
"none": "0 0 rgba(0,0,0,0)",
|
|
154
|
-
"sm": "var(--un-shadow-inset) 0 1px 2px 0 rgba(0,0,0,0.05)",
|
|
155
|
-
"md": ["var(--un-shadow-inset) 0 4px 6px -1px rgba(0,0,0,0.1)", "var(--un-shadow-inset) 0 2px 4px -2px rgba(0,0,0,0.1)"],
|
|
156
|
-
"lg": ["var(--un-shadow-inset) 0 10px 15px -3px rgba(0,0,0,0.1)", "var(--un-shadow-inset) 0 4px 6px -4px rgba(0,0,0,0.1)"],
|
|
157
|
-
"xl": ["var(--un-shadow-inset) 0 20px 25px -5px rgba(0,0,0,0.1)", "var(--un-shadow-inset) 0 8px 10px -6px rgba(0,0,0,0.1)"],
|
|
158
|
-
"2xl": "var(--un-shadow-inset) 0 25px 50px -12px rgba(0,0,0,0.25)",
|
|
159
|
-
"inner": "inset 0 2px 4px 0 rgba(0,0,0,0.05)"
|
|
160
|
-
};
|
|
161
|
-
const easing = {
|
|
162
|
-
"DEFAULT": "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
163
|
-
"linear": "linear",
|
|
164
|
-
"in": "cubic-bezier(0.4, 0, 1, 1)",
|
|
165
|
-
"out": "cubic-bezier(0, 0, 0.2, 1)",
|
|
166
|
-
"in-out": "cubic-bezier(0.4, 0, 0.2, 1)"
|
|
167
|
-
};
|
|
168
|
-
const ringWidth = {
|
|
169
|
-
DEFAULT: "1px",
|
|
170
|
-
none: "0px"
|
|
171
|
-
};
|
|
20
|
+
const flex = [
|
|
21
|
+
["flex", { display: "flex" }],
|
|
22
|
+
["inline-flex", { display: "inline-flex" }],
|
|
23
|
+
["flex-inline", { display: "inline-flex" }],
|
|
24
|
+
[/^flex-(.*)$/, ([, d]) => ({ flex: colors.handler.bracket(d) != null ? colors.handler.bracket(d).split(" ").map((e) => colors.handler.cssvar.fraction(e) ?? e).join(" ") : colors.handler.cssvar.fraction(d) })],
|
|
25
|
+
["flex-1", { flex: "1 1 0%" }],
|
|
26
|
+
["flex-auto", { flex: "1 1 auto" }],
|
|
27
|
+
["flex-initial", { flex: "0 1 auto" }],
|
|
28
|
+
["flex-none", { flex: "none" }],
|
|
29
|
+
[/^(?:flex-)?shrink(?:-(.*))?$/, ([, d = ""]) => ({ "flex-shrink": colors.handler.bracket.cssvar.number(d) ?? 1 }), { autocomplete: ["flex-shrink-<num>", "shrink-<num>"] }],
|
|
30
|
+
[/^(?:flex-)?grow(?:-(.*))?$/, ([, d = ""]) => ({ "flex-grow": colors.handler.bracket.cssvar.number(d) ?? 1 }), { autocomplete: ["flex-grow-<num>", "grow-<num>"] }],
|
|
31
|
+
[/^(?:flex-)?basis-(.+)$/, ([, d], { theme }) => ({ "flex-basis": theme.spacing?.[d] ?? colors.handler.bracket.cssvar.auto.fraction.rem(d) }), { autocomplete: ["flex-basis-$spacing", "basis-$spacing"] }],
|
|
32
|
+
["flex-row", { "flex-direction": "row" }],
|
|
33
|
+
["flex-row-reverse", { "flex-direction": "row-reverse" }],
|
|
34
|
+
["flex-col", { "flex-direction": "column" }],
|
|
35
|
+
["flex-col-reverse", { "flex-direction": "column-reverse" }],
|
|
36
|
+
["flex-wrap", { "flex-wrap": "wrap" }],
|
|
37
|
+
["flex-wrap-reverse", { "flex-wrap": "wrap-reverse" }],
|
|
38
|
+
["flex-nowrap", { "flex-wrap": "nowrap" }]
|
|
39
|
+
];
|
|
172
40
|
|
|
173
|
-
const
|
|
174
|
-
"
|
|
175
|
-
"
|
|
176
|
-
"
|
|
177
|
-
"md": "12px",
|
|
178
|
-
"lg": "16px",
|
|
179
|
-
"xl": "24px",
|
|
180
|
-
"2xl": "40px",
|
|
181
|
-
"3xl": "64px"
|
|
41
|
+
const directions = {
|
|
42
|
+
"": "",
|
|
43
|
+
"x": "column-",
|
|
44
|
+
"y": "row-"
|
|
182
45
|
};
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
46
|
+
const handleGap = ([, d = "", s], { theme }) => {
|
|
47
|
+
const v = theme.spacing?.[s] ?? colors.handler.bracket.cssvar.global.rem(s);
|
|
48
|
+
if (v != null) {
|
|
49
|
+
return {
|
|
50
|
+
[`grid-${directions[d]}gap`]: v,
|
|
51
|
+
[`${directions[d]}gap`]: v
|
|
52
|
+
};
|
|
53
|
+
}
|
|
191
54
|
};
|
|
55
|
+
const gaps = [
|
|
56
|
+
[/^(?:flex-|grid-)?gap-?()(.+)$/, handleGap, { autocomplete: ["gap-$spacing", "gap-<num>"] }],
|
|
57
|
+
[/^(?:flex-|grid-)?gap-([xy])-?(.+)$/, handleGap, { autocomplete: ["gap-(x|y)-$spacing", "gap-(x|y)-<num>"] }]
|
|
58
|
+
];
|
|
192
59
|
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
auto: "auto",
|
|
209
|
-
...baseSize,
|
|
210
|
-
screen: "100vw"
|
|
211
|
-
};
|
|
212
|
-
const maxWidth = {
|
|
213
|
-
none: "none",
|
|
214
|
-
...baseSize,
|
|
215
|
-
screen: "100vw"
|
|
216
|
-
};
|
|
217
|
-
const height = {
|
|
218
|
-
auto: "auto",
|
|
219
|
-
...baseSize,
|
|
220
|
-
screen: "100vh"
|
|
221
|
-
};
|
|
222
|
-
const maxHeight = {
|
|
223
|
-
none: "none",
|
|
224
|
-
...baseSize,
|
|
225
|
-
screen: "100vh"
|
|
60
|
+
const rowCol = (s) => s.replace("col", "column");
|
|
61
|
+
const rowColTheme = (s) => s[0] === "r" ? "Row" : "Column";
|
|
62
|
+
const autoDirection = (c, theme, prop) => {
|
|
63
|
+
const v = theme[`gridAuto${rowColTheme(c)}`]?.[prop];
|
|
64
|
+
if (v != null)
|
|
65
|
+
return v;
|
|
66
|
+
switch (prop) {
|
|
67
|
+
case "min":
|
|
68
|
+
return "min-content";
|
|
69
|
+
case "max":
|
|
70
|
+
return "max-content";
|
|
71
|
+
case "fr":
|
|
72
|
+
return "minmax(0,1fr)";
|
|
73
|
+
}
|
|
74
|
+
return colors.handler.bracket.cssvar.auto.rem(prop);
|
|
226
75
|
};
|
|
76
|
+
const grids = [
|
|
77
|
+
["grid", { display: "grid" }],
|
|
78
|
+
["inline-grid", { display: "inline-grid" }],
|
|
79
|
+
[/^(?:grid-)?(row|col)-(.+)$/, ([, c, v], { theme }) => ({
|
|
80
|
+
[`grid-${rowCol(c)}`]: theme[`grid${rowColTheme(c)}`]?.[v] ?? colors.handler.bracket.cssvar.auto(v)
|
|
81
|
+
})],
|
|
82
|
+
[/^(?:grid-)?(row|col)-span-(.+)$/, ([, c, s]) => {
|
|
83
|
+
if (s === "full")
|
|
84
|
+
return { [`grid-${rowCol(c)}`]: "1/-1" };
|
|
85
|
+
const v = colors.handler.bracket.number(s);
|
|
86
|
+
if (v != null)
|
|
87
|
+
return { [`grid-${rowCol(c)}`]: `span ${v}/span ${v}` };
|
|
88
|
+
}, { autocomplete: ["grid-(row|col)-span-<num>", "(row|col)-span-<num>"] }],
|
|
89
|
+
[/^(?:grid-)?(row|col)-start-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-start`]: colors.handler.bracket.cssvar(v) ?? v })],
|
|
90
|
+
[/^(?:grid-)?(row|col)-end-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]: colors.handler.bracket.cssvar(v) ?? v }), { autocomplete: ["grid-(row|col)-(start|end)-<num>"] }],
|
|
91
|
+
[/^(?:grid-)?auto-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({ [`grid-auto-${rowCol(c)}`]: autoDirection(c, theme, v) }), { autocomplete: ["grid-auto-(rows|cols)-<num>"] }],
|
|
92
|
+
[/^(?:grid-auto-flow|auto-flow|grid-flow)-(.+)$/, ([, v]) => ({ "grid-auto-flow": colors.handler.bracket.cssvar(v) })],
|
|
93
|
+
[/^(?:grid-auto-flow|auto-flow|grid-flow)-(row|col|dense|row-dense|col-dense)$/, ([, v]) => ({ "grid-auto-flow": rowCol(v).replace("-", " ") }), { autocomplete: ["(grid-auto-flow|auto-flow|grid-flow)-(row|col|dense|row-dense|col-dense)"] }],
|
|
94
|
+
[/^grid-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({
|
|
95
|
+
[`grid-template-${rowCol(c)}`]: theme[`gridTemplate${rowColTheme(c)}`]?.[v] ?? colors.handler.bracket.cssvar(v)
|
|
96
|
+
})],
|
|
97
|
+
[/^grid-(rows|cols)-minmax-([\w.-]+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(auto-fill,minmax(${d},1fr))` })],
|
|
98
|
+
[/^grid-(rows|cols)-(\d+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(${d},minmax(0,1fr))` }), { autocomplete: ["grid-(rows|cols)-<num>", "grid-(rows|cols)-none"] }],
|
|
99
|
+
["grid-rows-none", { "grid-template-rows": "none" }],
|
|
100
|
+
["grid-cols-none", { "grid-template-columns": "none" }]
|
|
101
|
+
];
|
|
227
102
|
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
103
|
+
const sizeMapping = {
|
|
104
|
+
h: "height",
|
|
105
|
+
w: "width",
|
|
106
|
+
inline: "inline-size",
|
|
107
|
+
block: "block-size"
|
|
232
108
|
};
|
|
109
|
+
function getPropName(minmax, hw) {
|
|
110
|
+
return `${minmax || ""}${sizeMapping[hw]}`;
|
|
111
|
+
}
|
|
112
|
+
function getSizeValue(minmax, hw, theme, prop) {
|
|
113
|
+
const str = getPropName(minmax, hw).replace(/-(\w)/g, (_, p) => p.toUpperCase());
|
|
114
|
+
const v = theme[str]?.[prop];
|
|
115
|
+
if (v != null)
|
|
116
|
+
return v;
|
|
117
|
+
switch (prop) {
|
|
118
|
+
case "fit":
|
|
119
|
+
case "max":
|
|
120
|
+
case "min":
|
|
121
|
+
return `${prop}-content`;
|
|
122
|
+
}
|
|
123
|
+
return colors.handler.bracket.cssvar.global.auto.fraction.rem(prop);
|
|
124
|
+
}
|
|
125
|
+
const sizes = [
|
|
126
|
+
[/^(min-|max-)?([wh])-?(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
|
|
127
|
+
[/^(min-|max-)?(block|inline)-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) }), {
|
|
128
|
+
autocomplete: [
|
|
129
|
+
"(w|h)-$width|height|maxWidth|maxHeight|minWidth|minHeight|inlineSize|blockSize|maxInlineSize|maxBlockSize|minInlineSize|minBlockSize",
|
|
130
|
+
"(block|inline)-$width|height|maxWidth|maxHeight|minWidth|minHeight|inlineSize|blockSize|maxInlineSize|maxBlockSize|minInlineSize|minBlockSize",
|
|
131
|
+
"(max|min)-(w|h|block|inline)",
|
|
132
|
+
"(max|min)-(w|h|block|inline)-$width|height|maxWidth|maxHeight|minWidth|minHeight|inlineSize|blockSize|maxInlineSize|maxBlockSize|minInlineSize|minBlockSize"
|
|
133
|
+
]
|
|
134
|
+
}],
|
|
135
|
+
[/^(min-|max-)?(h)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]: colors.resolveVerticalBreakpoints(context)?.[s] })],
|
|
136
|
+
[/^(min-|max-)?(w)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]: colors.resolveBreakpoints(context)?.[s] }), {
|
|
137
|
+
autocomplete: [
|
|
138
|
+
"(w|h)-screen",
|
|
139
|
+
"(min|max)-(w|h)-screen",
|
|
140
|
+
"h-screen-$verticalBreakpoints",
|
|
141
|
+
"(min|max)-h-screen-$verticalBreakpoints",
|
|
142
|
+
"w-screen-$breakpoints",
|
|
143
|
+
"(min|max)-w-screen-$breakpoints"
|
|
144
|
+
]
|
|
145
|
+
}]
|
|
146
|
+
];
|
|
147
|
+
function getAspectRatio(prop) {
|
|
148
|
+
if (/^\d+\/\d+$/.test(prop))
|
|
149
|
+
return prop;
|
|
150
|
+
switch (prop) {
|
|
151
|
+
case "square":
|
|
152
|
+
return "1/1";
|
|
153
|
+
case "video":
|
|
154
|
+
return "16/9";
|
|
155
|
+
}
|
|
156
|
+
return colors.handler.bracket.cssvar.global.auto.number(prop);
|
|
157
|
+
}
|
|
158
|
+
const aspectRatio = [
|
|
159
|
+
[/^aspect-(?:ratio-)?(.+)$/, ([, d]) => ({ "aspect-ratio": getAspectRatio(d) }), { autocomplete: ["aspect-(square|video|ratio)", "aspect-ratio-(square|video)"] }]
|
|
160
|
+
];
|
|
161
|
+
|
|
162
|
+
const paddings = [
|
|
163
|
+
[/^pa?()-?(-?.+)$/, colors.directionSize("padding"), { autocomplete: ["(m|p)<num>", "(m|p)-<num>"] }],
|
|
164
|
+
[/^p-?xy()()$/, colors.directionSize("padding"), { autocomplete: "(m|p)-(xy)" }],
|
|
165
|
+
[/^p-?([xy])(?:-?(-?.+))?$/, colors.directionSize("padding")],
|
|
166
|
+
[/^p-?([rltbse])(?:-?(-?.+))?$/, colors.directionSize("padding"), { autocomplete: "(m|p)<directions>-<num>" }],
|
|
167
|
+
[/^p-(block|inline)(?:-(-?.+))?$/, colors.directionSize("padding"), { autocomplete: "(m|p)-(block|inline)-<num>" }],
|
|
168
|
+
[/^p-?([bi][se])(?:-?(-?.+))?$/, colors.directionSize("padding"), { autocomplete: "(m|p)-(bs|be|is|ie)-<num>" }]
|
|
169
|
+
];
|
|
170
|
+
const margins = [
|
|
171
|
+
[/^ma?()-?(-?.+)$/, colors.directionSize("margin")],
|
|
172
|
+
[/^m-?xy()()$/, colors.directionSize("margin")],
|
|
173
|
+
[/^m-?([xy])(?:-?(-?.+))?$/, colors.directionSize("margin")],
|
|
174
|
+
[/^m-?([rltbse])(?:-?(-?.+))?$/, colors.directionSize("margin")],
|
|
175
|
+
[/^m-(block|inline)(?:-(-?.+))?$/, colors.directionSize("margin")],
|
|
176
|
+
[/^m-?([bi][se])(?:-?(-?.+))?$/, colors.directionSize("margin")]
|
|
177
|
+
];
|
|
233
178
|
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
fontFamily,
|
|
249
|
-
fontSize,
|
|
250
|
-
breakpoints,
|
|
251
|
-
verticalBreakpoints,
|
|
252
|
-
borderRadius,
|
|
253
|
-
lineHeight,
|
|
254
|
-
letterSpacing,
|
|
255
|
-
wordSpacing,
|
|
256
|
-
boxShadow,
|
|
257
|
-
textIndent,
|
|
258
|
-
textShadow,
|
|
259
|
-
textStrokeWidth,
|
|
260
|
-
blur,
|
|
261
|
-
dropShadow,
|
|
262
|
-
easing,
|
|
263
|
-
lineWidth,
|
|
264
|
-
spacing,
|
|
265
|
-
duration,
|
|
266
|
-
ringWidth,
|
|
267
|
-
preflightBase
|
|
179
|
+
const variablesAbbrMap = {
|
|
180
|
+
backface: "backface-visibility",
|
|
181
|
+
break: "word-break",
|
|
182
|
+
case: "text-transform",
|
|
183
|
+
content: "align-content",
|
|
184
|
+
fw: "font-weight",
|
|
185
|
+
items: "align-items",
|
|
186
|
+
justify: "justify-content",
|
|
187
|
+
select: "user-select",
|
|
188
|
+
self: "align-self",
|
|
189
|
+
vertical: "vertical-align",
|
|
190
|
+
visible: "visibility",
|
|
191
|
+
whitespace: "white-space",
|
|
192
|
+
ws: "white-space"
|
|
268
193
|
};
|
|
194
|
+
const cssVariables = [
|
|
195
|
+
[/^(.+?)-(\$.+)$/, ([, name, varname]) => {
|
|
196
|
+
const prop = variablesAbbrMap[name];
|
|
197
|
+
if (prop)
|
|
198
|
+
return { [prop]: colors.handler.cssvar(varname) };
|
|
199
|
+
}]
|
|
200
|
+
];
|
|
201
|
+
const cssProperty = [
|
|
202
|
+
[/^\[([\w_-]+):([^'"]+)\]$/, ([, prop, value]) => ({ [prop]: colors.handler.bracket(`[${value}]`) })]
|
|
203
|
+
];
|
|
204
|
+
|
|
205
|
+
const questionMark = [
|
|
206
|
+
[
|
|
207
|
+
/^(where|\?)$/,
|
|
208
|
+
(_, { constructCSS, generator }) => {
|
|
209
|
+
if (generator.userConfig.envMode === "dev")
|
|
210
|
+
return `@keyframes __un_qm{0%{box-shadow:inset 4px 4px #ff1e90, inset -4px -4px #ff1e90}100%{box-shadow:inset 8px 8px #3399ff, inset -8px -8px #3399ff}}
|
|
211
|
+
${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
];
|
|
215
|
+
|
|
216
|
+
const svgUtilities = [
|
|
217
|
+
[/^fill-(.+)$/, colors.colorResolver("fill", "fill"), { autocomplete: "fill-$colors" }],
|
|
218
|
+
[/^fill-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-fill-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "fill-(op|opacity)-<percent>" }],
|
|
219
|
+
["fill-none", { fill: "none" }],
|
|
220
|
+
[/^stroke-(?:width-|size-)?(.+)$/, ([, s], { theme }) => ({ "stroke-width": theme.lineWidth?.[s] ?? colors.handler.bracket.cssvar.fraction.px.number(s) }), { autocomplete: ["stroke-width-$lineWidth", "stroke-size-$lineWidth"] }],
|
|
221
|
+
[/^stroke-dash-(.+)$/, ([, s]) => ({ "stroke-dasharray": colors.handler.bracket.cssvar.number(s) }), { autocomplete: "stroke-dash-<num>" }],
|
|
222
|
+
[/^stroke-offset-(.+)$/, ([, s], { theme }) => ({ "stroke-dashoffset": theme.lineWidth?.[s] ?? colors.handler.bracket.cssvar.px.numberWithUnit(s) }), { autocomplete: "stroke-offset-$lineWidth" }],
|
|
223
|
+
[/^stroke-(.+)$/, colors.colorResolver("stroke", "stroke"), { autocomplete: "stroke-$colors" }],
|
|
224
|
+
[/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "stroke-(op|opacity)-<percent>" }],
|
|
225
|
+
["stroke-cap-square", { "stroke-linecap": "square" }],
|
|
226
|
+
["stroke-cap-round", { "stroke-linecap": "round" }],
|
|
227
|
+
["stroke-cap-auto", { "stroke-linecap": "butt" }],
|
|
228
|
+
["stroke-join-arcs", { "stroke-linejoin": "arcs" }],
|
|
229
|
+
["stroke-join-bevel", { "stroke-linejoin": "bevel" }],
|
|
230
|
+
["stroke-join-clip", { "stroke-linejoin": "miter-clip" }],
|
|
231
|
+
["stroke-join-round", { "stroke-linejoin": "round" }],
|
|
232
|
+
["stroke-join-auto", { "stroke-linejoin": "miter" }],
|
|
233
|
+
["stroke-none", { stroke: "none" }]
|
|
234
|
+
];
|
|
235
|
+
|
|
236
|
+
const rules = [
|
|
237
|
+
cssVariables,
|
|
238
|
+
cssProperty,
|
|
239
|
+
paddings,
|
|
240
|
+
margins,
|
|
241
|
+
decoration.displays,
|
|
242
|
+
opacity,
|
|
243
|
+
bgColors,
|
|
244
|
+
svgUtilities,
|
|
245
|
+
decoration.borders,
|
|
246
|
+
decoration.contents,
|
|
247
|
+
decoration.fonts,
|
|
248
|
+
decoration.tabSizes,
|
|
249
|
+
decoration.textIndents,
|
|
250
|
+
decoration.textOverflows,
|
|
251
|
+
decoration.textDecorations,
|
|
252
|
+
decoration.textStrokes,
|
|
253
|
+
decoration.textShadows,
|
|
254
|
+
decoration.textTransforms,
|
|
255
|
+
decoration.textAligns,
|
|
256
|
+
textColors,
|
|
257
|
+
decoration.fontStyles,
|
|
258
|
+
decoration.fontSmoothings,
|
|
259
|
+
decoration.boxShadows,
|
|
260
|
+
decoration.rings,
|
|
261
|
+
flex,
|
|
262
|
+
grids,
|
|
263
|
+
gaps,
|
|
264
|
+
decoration.positions,
|
|
265
|
+
sizes,
|
|
266
|
+
aspectRatio,
|
|
267
|
+
decoration.cursors,
|
|
268
|
+
decoration.appearances,
|
|
269
|
+
decoration.pointerEvents,
|
|
270
|
+
decoration.resizes,
|
|
271
|
+
decoration.verticalAligns,
|
|
272
|
+
decoration.userSelects,
|
|
273
|
+
decoration.whitespaces,
|
|
274
|
+
decoration.breaks,
|
|
275
|
+
decoration.overflows,
|
|
276
|
+
decoration.outline,
|
|
277
|
+
decoration.appearance,
|
|
278
|
+
decoration.orders,
|
|
279
|
+
decoration.justifies,
|
|
280
|
+
decoration.alignments,
|
|
281
|
+
decoration.placements,
|
|
282
|
+
decoration.insets,
|
|
283
|
+
decoration.floats,
|
|
284
|
+
decoration.zIndexes,
|
|
285
|
+
decoration.boxSizing,
|
|
286
|
+
decoration.transitions,
|
|
287
|
+
decoration.transforms,
|
|
288
|
+
decoration.willChange,
|
|
289
|
+
questionMark
|
|
290
|
+
].flat(1);
|
|
269
291
|
|
|
270
|
-
exports.
|
|
271
|
-
exports.
|
|
272
|
-
exports.
|
|
273
|
-
exports.
|
|
274
|
-
exports.
|
|
275
|
-
exports.
|
|
276
|
-
exports.
|
|
277
|
-
exports.
|
|
278
|
-
exports.
|
|
279
|
-
exports.
|
|
280
|
-
exports.
|
|
281
|
-
exports.
|
|
282
|
-
exports.
|
|
283
|
-
exports.
|
|
284
|
-
exports.
|
|
285
|
-
exports.maxWidth = maxWidth;
|
|
286
|
-
exports.preflightBase = preflightBase;
|
|
287
|
-
exports.ringWidth = ringWidth;
|
|
288
|
-
exports.spacing = spacing;
|
|
289
|
-
exports.textIndent = textIndent;
|
|
290
|
-
exports.textShadow = textShadow;
|
|
291
|
-
exports.textStrokeWidth = textStrokeWidth;
|
|
292
|
-
exports.theme = theme;
|
|
293
|
-
exports.verticalBreakpoints = verticalBreakpoints;
|
|
294
|
-
exports.width = width;
|
|
295
|
-
exports.wordSpacing = wordSpacing;
|
|
292
|
+
exports.aspectRatio = aspectRatio;
|
|
293
|
+
exports.bgColors = bgColors;
|
|
294
|
+
exports.cssProperty = cssProperty;
|
|
295
|
+
exports.cssVariables = cssVariables;
|
|
296
|
+
exports.flex = flex;
|
|
297
|
+
exports.gaps = gaps;
|
|
298
|
+
exports.grids = grids;
|
|
299
|
+
exports.margins = margins;
|
|
300
|
+
exports.opacity = opacity;
|
|
301
|
+
exports.paddings = paddings;
|
|
302
|
+
exports.questionMark = questionMark;
|
|
303
|
+
exports.rules = rules;
|
|
304
|
+
exports.sizes = sizes;
|
|
305
|
+
exports.svgUtilities = svgUtilities;
|
|
306
|
+
exports.textColors = textColors;
|