@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/default2.cjs
CHANGED
|
@@ -1,774 +1,297 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const colors = require('./colors2.cjs');
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const decoration = require('./decoration.cjs');
|
|
5
|
+
require('./colors.cjs');
|
|
6
|
+
require('@unocss/core');
|
|
6
7
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
const fontFamily = {
|
|
9
|
+
sans: [
|
|
10
|
+
"ui-sans-serif",
|
|
11
|
+
"system-ui",
|
|
12
|
+
"-apple-system",
|
|
13
|
+
"BlinkMacSystemFont",
|
|
14
|
+
'"Segoe UI"',
|
|
15
|
+
"Roboto",
|
|
16
|
+
'"Helvetica Neue"',
|
|
17
|
+
"Arial",
|
|
18
|
+
'"Noto Sans"',
|
|
19
|
+
"sans-serif",
|
|
20
|
+
'"Apple Color Emoji"',
|
|
21
|
+
'"Segoe UI Emoji"',
|
|
22
|
+
'"Segoe UI Symbol"',
|
|
23
|
+
'"Noto Color Emoji"'
|
|
24
|
+
].join(","),
|
|
25
|
+
serif: [
|
|
26
|
+
"ui-serif",
|
|
27
|
+
"Georgia",
|
|
28
|
+
"Cambria",
|
|
29
|
+
'"Times New Roman"',
|
|
30
|
+
"Times",
|
|
31
|
+
"serif"
|
|
32
|
+
].join(","),
|
|
33
|
+
mono: [
|
|
34
|
+
"ui-monospace",
|
|
35
|
+
"SFMono-Regular",
|
|
36
|
+
"Menlo",
|
|
37
|
+
"Monaco",
|
|
38
|
+
"Consolas",
|
|
39
|
+
'"Liberation Mono"',
|
|
40
|
+
'"Courier New"',
|
|
41
|
+
"monospace"
|
|
42
|
+
].join(",")
|
|
20
43
|
};
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
]
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
]
|
|
34
|
-
|
|
35
|
-
["appearance-none", {
|
|
36
|
-
"appearance": "none",
|
|
37
|
-
"-webkit-appearance": "none"
|
|
38
|
-
}]
|
|
39
|
-
];
|
|
40
|
-
const willChangeProperty = (prop) => {
|
|
41
|
-
return colors.handler.properties.auto.global(prop) ?? {
|
|
42
|
-
contents: "contents",
|
|
43
|
-
scroll: "scroll-position"
|
|
44
|
-
}[prop];
|
|
44
|
+
const fontSize = {
|
|
45
|
+
"xs": ["0.75rem", "1rem"],
|
|
46
|
+
"sm": ["0.875rem", "1.25rem"],
|
|
47
|
+
"base": ["1rem", "1.5rem"],
|
|
48
|
+
"lg": ["1.125rem", "1.75rem"],
|
|
49
|
+
"xl": ["1.25rem", "1.75rem"],
|
|
50
|
+
"2xl": ["1.5rem", "2rem"],
|
|
51
|
+
"3xl": ["1.875rem", "2.25rem"],
|
|
52
|
+
"4xl": ["2.25rem", "2.5rem"],
|
|
53
|
+
"5xl": ["3rem", "1"],
|
|
54
|
+
"6xl": ["3.75rem", "1"],
|
|
55
|
+
"7xl": ["4.5rem", "1"],
|
|
56
|
+
"8xl": ["6rem", "1"],
|
|
57
|
+
"9xl": ["8rem", "1"]
|
|
45
58
|
};
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
[/^(?:border|b)-(block|inline)(?:-(.+))?$/, handlerBorder],
|
|
56
|
-
[/^(?:border|b)-([bi][se])(?:-(.+))?$/, handlerBorder],
|
|
57
|
-
[/^(?:border|b)-()(?:width|size)-(.+)$/, handlerBorderSize, { autocomplete: ["(border|b)-<num>", "(border|b)-<directions>-<num>"] }],
|
|
58
|
-
[/^(?:border|b)-([xy])-(?:width|size)-(.+)$/, handlerBorderSize],
|
|
59
|
-
[/^(?:border|b)-([rltbse])-(?:width|size)-(.+)$/, handlerBorderSize],
|
|
60
|
-
[/^(?:border|b)-(block|inline)-(?:width|size)-(.+)$/, handlerBorderSize],
|
|
61
|
-
[/^(?:border|b)-([bi][se])-(?:width|size)-(.+)$/, handlerBorderSize],
|
|
62
|
-
[/^(?:border|b)-()(?:color-)?(.+)$/, handlerBorderColor, { autocomplete: ["(border|b)-$colors", "(border|b)-<directions>-$colors"] }],
|
|
63
|
-
[/^(?:border|b)-([xy])-(?:color-)?(.+)$/, handlerBorderColor],
|
|
64
|
-
[/^(?:border|b)-([rltbse])-(?:color-)?(.+)$/, handlerBorderColor],
|
|
65
|
-
[/^(?:border|b)-(block|inline)-(?:color-)?(.+)$/, handlerBorderColor],
|
|
66
|
-
[/^(?:border|b)-([bi][se])-(?:color-)?(.+)$/, handlerBorderColor],
|
|
67
|
-
[/^(?:border|b)-()op(?:acity)?-?(.+)$/, handlerBorderOpacity, { autocomplete: "(border|b)-(op|opacity)-<percent>" }],
|
|
68
|
-
[/^(?:border|b)-([xy])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
69
|
-
[/^(?:border|b)-([rltbse])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
70
|
-
[/^(?:border|b)-(block|inline)-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
71
|
-
[/^(?:border|b)-([bi][se])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
72
|
-
[/^(?:border-|b-)?(?:rounded|rd)()(?:-(.+))?$/, handlerRounded, { autocomplete: ["(border|b)-(rounded|rd)", "(border|b)-(rounded|rd)-<num>", "(rounded|rd)", "(rounded|rd)-<num>"] }],
|
|
73
|
-
[/^(?:border-|b-)?(?:rounded|rd)-([rltb])(?:-(.+))?$/, handlerRounded],
|
|
74
|
-
[/^(?:border-|b-)?(?:rounded|rd)-([rltb]{2})(?:-(.+))?$/, handlerRounded],
|
|
75
|
-
[/^(?:border-|b-)?(?:rounded|rd)-([bi][se])(?:-(.+))?$/, handlerRounded],
|
|
76
|
-
[/^(?:border-|b-)?(?:rounded|rd)-([bi][se]-[bi][se])(?:-(.+))?$/, handlerRounded],
|
|
77
|
-
[/^(?:border|b)-(?:style-)?()(.+)$/, handlerBorderStyle, { autocomplete: ["(border|b)-style", `(border|b)-(${borderStyles.join("|")})`, "(border|b)-<directions>-style", `(border|b)-<directions>-(${borderStyles.join("|")})`, `(border|b)-<directions>-style-(${borderStyles.join("|")})`, `(border|b)-style-(${borderStyles.join("|")})`] }],
|
|
78
|
-
[/^(?:border|b)-([xy])-(?:style-)?(.+)$/, handlerBorderStyle],
|
|
79
|
-
[/^(?:border|b)-([rltbse])-(?:style-)?(.+)$/, handlerBorderStyle],
|
|
80
|
-
[/^(?:border|b)-(block|inline)-(?:style-)?(.+)$/, handlerBorderStyle],
|
|
81
|
-
[/^(?:border|b)-([bi][se])-(?:style-)?(.+)$/, handlerBorderStyle]
|
|
82
|
-
];
|
|
83
|
-
const borderColorResolver = (direction) => ([, body], theme) => {
|
|
84
|
-
const data = colors.parseColor(body, theme);
|
|
85
|
-
if (!data)
|
|
86
|
-
return;
|
|
87
|
-
const { alpha, color, cssColor } = data;
|
|
88
|
-
if (cssColor) {
|
|
89
|
-
if (alpha != null) {
|
|
90
|
-
return {
|
|
91
|
-
[`border${direction}-color`]: colors.colorToString(cssColor, alpha)
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
if (direction === "") {
|
|
95
|
-
return {
|
|
96
|
-
"--un-border-opacity": colors.colorOpacityToString(cssColor),
|
|
97
|
-
"border-color": colors.colorToString(cssColor, "var(--un-border-opacity)")
|
|
98
|
-
};
|
|
99
|
-
} else {
|
|
100
|
-
return {
|
|
101
|
-
"--un-border-opacity": colors.colorOpacityToString(cssColor),
|
|
102
|
-
[`--un-border${direction}-opacity`]: "var(--un-border-opacity)",
|
|
103
|
-
[`border${direction}-color`]: colors.colorToString(cssColor, `var(--un-border${direction}-opacity)`)
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
} else if (color) {
|
|
107
|
-
return {
|
|
108
|
-
[`border${direction}-color`]: colors.colorToString(color, alpha)
|
|
109
|
-
};
|
|
110
|
-
}
|
|
59
|
+
const textIndent = {
|
|
60
|
+
"DEFAULT": "1.5rem",
|
|
61
|
+
"xs": "0.5rem",
|
|
62
|
+
"sm": "1rem",
|
|
63
|
+
"md": "1.5rem",
|
|
64
|
+
"lg": "2rem",
|
|
65
|
+
"xl": "2.5rem",
|
|
66
|
+
"2xl": "3rem",
|
|
67
|
+
"3xl": "4rem"
|
|
111
68
|
};
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
...borderStyle
|
|
119
|
-
];
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
function handlerBorderSize([, a = "", b], { theme }) {
|
|
123
|
-
const v = theme.lineWidth?.[b || "DEFAULT"] ?? colors.handler.bracket.cssvar.global.px(b || "1");
|
|
124
|
-
if (a in colors.directionMap && v != null)
|
|
125
|
-
return colors.directionMap[a].map((i) => [`border${i}-width`, v]);
|
|
126
|
-
}
|
|
127
|
-
function handlerBorderColor([, a = "", c], { theme }) {
|
|
128
|
-
if (a in colors.directionMap && colors.hasParseableColor(c, theme)) {
|
|
129
|
-
return Object.assign({}, ...colors.directionMap[a].map((i) => borderColorResolver(i)(["", c], theme)));
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
function handlerBorderOpacity([, a = "", opacity]) {
|
|
133
|
-
const v = colors.handler.bracket.percent(opacity);
|
|
134
|
-
if (a in colors.directionMap && v != null)
|
|
135
|
-
return colors.directionMap[a].map((i) => [`--un-border${i}-opacity`, v]);
|
|
136
|
-
}
|
|
137
|
-
function handlerRounded([, a = "", s], { theme }) {
|
|
138
|
-
const v = theme.borderRadius?.[s || "DEFAULT"] || colors.handler.bracket.cssvar.global.fraction.rem(s || "1");
|
|
139
|
-
if (a in colors.cornerMap && v != null)
|
|
140
|
-
return colors.cornerMap[a].map((i) => [`border${i}-radius`, v]);
|
|
141
|
-
}
|
|
142
|
-
function handlerBorderStyle([, a = "", s]) {
|
|
143
|
-
if (borderStyles.includes(s) && a in colors.directionMap)
|
|
144
|
-
return colors.directionMap[a].map((i) => [`border${i}-style`, s]);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
const opacity = [
|
|
148
|
-
[/^op(?:acity)?-?(.+)$/, ([, d]) => ({ opacity: colors.handler.bracket.percent.cssvar(d) })]
|
|
149
|
-
];
|
|
150
|
-
const textColors = [
|
|
151
|
-
[/^(?:color|c)-(.+)$/, colors.colorResolver("color", "text"), { autocomplete: "(text|color|c)-$colors" }],
|
|
152
|
-
[/^text-(.+)$/, colors.colorResolver("color", "text", (css) => !css.color?.toString().match(colors.numberWithUnitRE)), { autocomplete: "(text|color|c)-$colors" }],
|
|
153
|
-
[/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-text-opacity": colors.handler.bracket.percent(opacity2) }), { autocomplete: "(text|color|c)-(op|opacity)-<percent>" }]
|
|
154
|
-
];
|
|
155
|
-
const bgColors = [
|
|
156
|
-
[/^bg-(.+)$/, colors.colorResolver("background-color", "bg"), { autocomplete: "bg-$colors" }],
|
|
157
|
-
[/^bg-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-bg-opacity": colors.handler.bracket.percent(opacity2) }), { autocomplete: "bg-(op|opacity)-<percent>" }]
|
|
158
|
-
];
|
|
159
|
-
|
|
160
|
-
const transitionPropertyGroup = {
|
|
161
|
-
all: "all",
|
|
162
|
-
colors: ["color", "background-color", "border-color", "text-decoration-color", "fill", "stroke"].join(","),
|
|
163
|
-
none: "none",
|
|
164
|
-
opacity: "opacity",
|
|
165
|
-
shadow: "box-shadow",
|
|
166
|
-
transform: "transform"
|
|
69
|
+
const textStrokeWidth = {
|
|
70
|
+
DEFAULT: "1.5rem",
|
|
71
|
+
none: "0",
|
|
72
|
+
sm: "thin",
|
|
73
|
+
md: "medium",
|
|
74
|
+
lg: "thick"
|
|
167
75
|
};
|
|
168
|
-
const
|
|
169
|
-
|
|
76
|
+
const textShadow = {
|
|
77
|
+
DEFAULT: ["0 0 1px rgba(0,0,0,0.2)", "0 0 1px rgba(1,0,5,0.1)"],
|
|
78
|
+
none: "0 0 rgba(0,0,0,0)",
|
|
79
|
+
sm: "1px 1px 3px rgba(36,37,47,0.25)",
|
|
80
|
+
md: ["0 1px 2px rgba(30,29,39,0.19)", "1px 2px 4px rgba(54,64,147,0.18)"],
|
|
81
|
+
lg: ["3px 3px 6px rgba(0,0,0,0.26)", "0 0 5px rgba(15,3,86,0.22)"],
|
|
82
|
+
xl: ["1px 1px 3px rgba(0,0,0,0.29)", "2px 4px 7px rgba(73,64,125,0.35)"]
|
|
170
83
|
};
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
"transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
179
|
-
"transition-duration": duration
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
}, { autocomplete: `transition-(${Object.keys(transitionPropertyGroup).join("|")})` }],
|
|
183
|
-
[
|
|
184
|
-
/^(?:transition-)?duration-(.+)$/,
|
|
185
|
-
([, d], { theme }) => ({ "transition-duration": theme.duration?.[d || "DEFAULT"] ?? colors.handler.bracket.cssvar.time(d) }),
|
|
186
|
-
{ autocomplete: ["transition-duration-$duration", "duration-$duration"] }
|
|
187
|
-
],
|
|
188
|
-
[
|
|
189
|
-
/^(?:transition-)?delay-(.+)$/,
|
|
190
|
-
([, d], { theme }) => ({ "transition-delay": theme.duration?.[d || "DEFAULT"] ?? colors.handler.bracket.cssvar.time(d) }),
|
|
191
|
-
{ autocomplete: ["transition-delay-$duration", "delay-$duration"] }
|
|
192
|
-
],
|
|
193
|
-
[
|
|
194
|
-
/^(?:transition-)?ease(?:-(.+))?$/,
|
|
195
|
-
([, d], { theme }) => ({ "transition-timing-function": theme.easing?.[d || "DEFAULT"] ?? colors.handler.bracket.cssvar(d) }),
|
|
196
|
-
{ autocomplete: ["transition-ease-(linear|in|out|in-out|DEFAULT)", "ease-(linear|in|out|in-out|DEFAULT)"] }
|
|
197
|
-
],
|
|
198
|
-
[
|
|
199
|
-
/^(?:transition-)?property-(.+)$/,
|
|
200
|
-
([, v]) => ({ "transition-property": colors.handler.bracket.global(v) || transitionProperty(v) }),
|
|
201
|
-
{ autocomplete: [`transition-property-(${[...colors.globalKeywords, ...Object.keys(transitionPropertyGroup)].join("|")})`] }
|
|
202
|
-
],
|
|
203
|
-
["transition-none", { transition: "none" }],
|
|
204
|
-
...colors.makeGlobalStaticRules("transition")
|
|
205
|
-
];
|
|
206
|
-
|
|
207
|
-
const flex = [
|
|
208
|
-
["flex", { display: "flex" }],
|
|
209
|
-
["inline-flex", { display: "inline-flex" }],
|
|
210
|
-
["flex-inline", { display: "inline-flex" }],
|
|
211
|
-
[/^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) })],
|
|
212
|
-
["flex-1", { flex: "1 1 0%" }],
|
|
213
|
-
["flex-auto", { flex: "1 1 auto" }],
|
|
214
|
-
["flex-initial", { flex: "0 1 auto" }],
|
|
215
|
-
["flex-none", { flex: "none" }],
|
|
216
|
-
[/^(?:flex-)?shrink(?:-(.*))?$/, ([, d = ""]) => ({ "flex-shrink": colors.handler.bracket.cssvar.number(d) ?? 1 }), { autocomplete: ["flex-shrink-<num>", "shrink-<num>"] }],
|
|
217
|
-
[/^(?:flex-)?grow(?:-(.*))?$/, ([, d = ""]) => ({ "flex-grow": colors.handler.bracket.cssvar.number(d) ?? 1 }), { autocomplete: ["flex-grow-<num>", "grow-<num>"] }],
|
|
218
|
-
[/^(?:flex-)?basis-(.+)$/, ([, d], { theme }) => ({ "flex-basis": theme.spacing?.[d] ?? colors.handler.bracket.cssvar.auto.fraction.rem(d) }), { autocomplete: ["flex-basis-$spacing", "basis-$spacing"] }],
|
|
219
|
-
["flex-row", { "flex-direction": "row" }],
|
|
220
|
-
["flex-row-reverse", { "flex-direction": "row-reverse" }],
|
|
221
|
-
["flex-col", { "flex-direction": "column" }],
|
|
222
|
-
["flex-col-reverse", { "flex-direction": "column-reverse" }],
|
|
223
|
-
["flex-wrap", { "flex-wrap": "wrap" }],
|
|
224
|
-
["flex-wrap-reverse", { "flex-wrap": "wrap-reverse" }],
|
|
225
|
-
["flex-nowrap", { "flex-wrap": "nowrap" }]
|
|
226
|
-
];
|
|
227
|
-
|
|
228
|
-
const weightMap = {
|
|
229
|
-
thin: "100",
|
|
230
|
-
extralight: "200",
|
|
231
|
-
light: "300",
|
|
232
|
-
normal: "400",
|
|
233
|
-
medium: "500",
|
|
234
|
-
semibold: "600",
|
|
235
|
-
bold: "700",
|
|
236
|
-
extrabold: "800",
|
|
237
|
-
black: "900"
|
|
84
|
+
const lineHeight = {
|
|
85
|
+
none: "1",
|
|
86
|
+
tight: "1.25",
|
|
87
|
+
snug: "1.375",
|
|
88
|
+
normal: "1.5",
|
|
89
|
+
relaxed: "1.625",
|
|
90
|
+
loose: "2"
|
|
238
91
|
};
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
const themed = core.toArray(theme.fontSize?.[s]);
|
|
249
|
-
if (themed?.[0]) {
|
|
250
|
-
const [size, height = "1"] = themed;
|
|
251
|
-
return {
|
|
252
|
-
"font-size": size,
|
|
253
|
-
"line-height": height
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
return { "font-size": colors.handler.bracketOfLength.rem(s) };
|
|
257
|
-
},
|
|
258
|
-
{ autocomplete: "text-$fontSize" }
|
|
259
|
-
],
|
|
260
|
-
[/^text-size-(.+)$/, ([, s], { theme }) => {
|
|
261
|
-
const themed = core.toArray(theme.fontSize?.[s]);
|
|
262
|
-
const size = themed?.[0] ?? colors.handler.bracket.cssvar.global.rem(s);
|
|
263
|
-
if (size != null)
|
|
264
|
-
return { "font-size": size };
|
|
265
|
-
}, { autocomplete: "text-size-$fontSize" }],
|
|
266
|
-
[
|
|
267
|
-
/^(?:font|fw)-?([^-]+)$/,
|
|
268
|
-
([, s]) => ({ "font-weight": weightMap[s] || colors.handler.global.number(s) }),
|
|
269
|
-
{ autocomplete: `(font|fw)-(100|200|300|400|500|600|700|800|900|${Object.keys(weightMap).join("|")})` }
|
|
270
|
-
],
|
|
271
|
-
[
|
|
272
|
-
/^(?:font-)?(?:leading|lh)-(.+)$/,
|
|
273
|
-
([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] || colors.handler.bracket.cssvar.global.rem(s) }),
|
|
274
|
-
{ autocomplete: "(leading|lh)-$lineHeight" }
|
|
275
|
-
],
|
|
276
|
-
["font-synthesis-weight", { "font-synthesis": "weight" }],
|
|
277
|
-
["font-synthesis-style", { "font-synthesis": "style" }],
|
|
278
|
-
["font-synthesis-small-caps", { "font-synthesis": "small-caps" }],
|
|
279
|
-
["font-synthesis-none", { "font-synthesis": "none" }],
|
|
280
|
-
[/^font-synthesis-(.+)$/, ([, s]) => ({ "font-synthesis": colors.handler.bracket.cssvar.global(s) })],
|
|
281
|
-
[
|
|
282
|
-
/^(?:font-)?tracking-(.+)$/,
|
|
283
|
-
([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || colors.handler.bracket.cssvar.global.rem(s) }),
|
|
284
|
-
{ autocomplete: "tracking-$letterSpacing" }
|
|
285
|
-
],
|
|
286
|
-
[
|
|
287
|
-
/^(?:font-)?word-spacing-(.+)$/,
|
|
288
|
-
([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] || colors.handler.bracket.cssvar.global.rem(s) }),
|
|
289
|
-
{ autocomplete: "word-spacing-$wordSpacing" }
|
|
290
|
-
]
|
|
291
|
-
];
|
|
292
|
-
const tabSizes = [
|
|
293
|
-
[/^tab(?:-(.+))?$/, ([, s]) => {
|
|
294
|
-
const v = colors.handler.bracket.cssvar.global.number(s || "4");
|
|
295
|
-
if (v != null) {
|
|
296
|
-
return {
|
|
297
|
-
"-moz-tab-size": v,
|
|
298
|
-
"-o-tab-size": v,
|
|
299
|
-
"tab-size": v
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
}]
|
|
303
|
-
];
|
|
304
|
-
const textIndents = [
|
|
305
|
-
[/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] || colors.handler.bracket.cssvar.global.fraction.rem(s) }), { autocomplete: "indent-$textIndent" }]
|
|
306
|
-
];
|
|
307
|
-
const textStrokes = [
|
|
308
|
-
[/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => ({ "-webkit-text-stroke-width": theme.textStrokeWidth?.[s || "DEFAULT"] || colors.handler.bracket.cssvar.px(s) }), { autocomplete: "text-stroke-$textStrokeWidth" }],
|
|
309
|
-
[/^text-stroke-(.+)$/, colors.colorResolver("-webkit-text-stroke-color", "text-stroke"), { autocomplete: "text-stroke-$colors" }],
|
|
310
|
-
[/^text-stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-stroke-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "text-stroke-(op|opacity)-<percent>" }]
|
|
311
|
-
];
|
|
312
|
-
const textShadows = [
|
|
313
|
-
[/^text-shadow(?:-(.+))?$/, ([, s], { theme }) => {
|
|
314
|
-
const v = theme.textShadow?.[s || "DEFAULT"];
|
|
315
|
-
if (v != null) {
|
|
316
|
-
return {
|
|
317
|
-
"--un-text-shadow": colors.colorableShadows(v, "--un-text-shadow-color").join(","),
|
|
318
|
-
"text-shadow": "var(--un-text-shadow)"
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
return { "text-shadow": colors.handler.bracket.cssvar.global(s) };
|
|
322
|
-
}, { autocomplete: "text-shadow-$textShadow" }],
|
|
323
|
-
[/^text-shadow-color-(.+)$/, colors.colorResolver("--un-text-shadow-color", "text-shadow"), { autocomplete: "text-shadow-color-$colors" }],
|
|
324
|
-
[/^text-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-shadow-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "text-shadow-color-(op|opacity)-<percent>" }]
|
|
325
|
-
];
|
|
92
|
+
const letterSpacing = {
|
|
93
|
+
tighter: "-0.05em",
|
|
94
|
+
tight: "-0.025em",
|
|
95
|
+
normal: "0em",
|
|
96
|
+
wide: "0.025em",
|
|
97
|
+
wider: "0.05em",
|
|
98
|
+
widest: "0.1em"
|
|
99
|
+
};
|
|
100
|
+
const wordSpacing = letterSpacing;
|
|
326
101
|
|
|
327
|
-
const
|
|
328
|
-
"": "",
|
|
329
|
-
"
|
|
330
|
-
"
|
|
102
|
+
const breakpoints = {
|
|
103
|
+
"sm": "640px",
|
|
104
|
+
"md": "768px",
|
|
105
|
+
"lg": "1024px",
|
|
106
|
+
"xl": "1280px",
|
|
107
|
+
"2xl": "1536px"
|
|
331
108
|
};
|
|
332
|
-
const
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
[`grid-${directions[d]}gap`]: v,
|
|
337
|
-
[`${directions[d]}gap`]: v
|
|
338
|
-
};
|
|
339
|
-
}
|
|
109
|
+
const verticalBreakpoints = { ...breakpoints };
|
|
110
|
+
const lineWidth = {
|
|
111
|
+
DEFAULT: "1px",
|
|
112
|
+
none: "0px"
|
|
340
113
|
};
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
return "max-content";
|
|
357
|
-
case "fr":
|
|
358
|
-
return "minmax(0,1fr)";
|
|
359
|
-
}
|
|
360
|
-
return colors.handler.bracket.cssvar.auto.rem(prop);
|
|
114
|
+
const spacing = {
|
|
115
|
+
"DEFAULT": "1rem",
|
|
116
|
+
"none": "0rem",
|
|
117
|
+
"xs": "0.75rem",
|
|
118
|
+
"sm": "0.875rem",
|
|
119
|
+
"lg": "1.125rem",
|
|
120
|
+
"xl": "1.25rem",
|
|
121
|
+
"2xl": "1.5rem",
|
|
122
|
+
"3xl": "1.875rem",
|
|
123
|
+
"4xl": "2.25rem",
|
|
124
|
+
"5xl": "3rem",
|
|
125
|
+
"6xl": "3.75rem",
|
|
126
|
+
"7xl": "4.5rem",
|
|
127
|
+
"8xl": "6rem",
|
|
128
|
+
"9xl": "8rem"
|
|
361
129
|
};
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
return { [`grid-${rowCol(c)}`]: `span ${v}/span ${v}` };
|
|
374
|
-
}, { autocomplete: ["grid-(row|col)-span-<num>", "(row|col)-span-<num>"] }],
|
|
375
|
-
[/^(?:grid-)?(row|col)-start-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-start`]: colors.handler.bracket.cssvar(v) ?? v })],
|
|
376
|
-
[/^(?:grid-)?(row|col)-end-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]: colors.handler.bracket.cssvar(v) ?? v }), { autocomplete: ["grid-(row|col)-(start|end)-<num>"] }],
|
|
377
|
-
[/^(?:grid-)?auto-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({ [`grid-auto-${rowCol(c)}`]: autoDirection(c, theme, v) }), { autocomplete: ["grid-auto-(rows|cols)-<num>"] }],
|
|
378
|
-
[/^(?:grid-auto-flow|auto-flow|grid-flow)-(.+)$/, ([, v]) => ({ "grid-auto-flow": colors.handler.bracket.cssvar(v) })],
|
|
379
|
-
[/^(?: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)"] }],
|
|
380
|
-
[/^grid-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({
|
|
381
|
-
[`grid-template-${rowCol(c)}`]: theme[`gridTemplate${rowColTheme(c)}`]?.[v] ?? colors.handler.bracket.cssvar(v)
|
|
382
|
-
})],
|
|
383
|
-
[/^grid-(rows|cols)-minmax-([\w.-]+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(auto-fill,minmax(${d},1fr))` })],
|
|
384
|
-
[/^grid-(rows|cols)-(\d+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(${d},minmax(0,1fr))` }), { autocomplete: ["grid-(rows|cols)-<num>", "grid-(rows|cols)-none"] }],
|
|
385
|
-
["grid-rows-none", { "grid-template-rows": "none" }],
|
|
386
|
-
["grid-cols-none", { "grid-template-columns": "none" }]
|
|
387
|
-
];
|
|
388
|
-
|
|
389
|
-
const overflowValues = [
|
|
390
|
-
"auto",
|
|
391
|
-
"hidden",
|
|
392
|
-
"clip",
|
|
393
|
-
"visible",
|
|
394
|
-
"scroll",
|
|
395
|
-
...colors.globalKeywords
|
|
396
|
-
];
|
|
397
|
-
const overflows = [
|
|
398
|
-
[/^(?:overflow|of)-(.+)$/, ([, v]) => overflowValues.includes(v) ? { overflow: v } : void 0, { autocomplete: [`(overflow|of)-(${overflowValues.join("|")})`, `(overflow|of)-(x|y)-(${overflowValues.join("|")})`] }],
|
|
399
|
-
[/^(?:overflow|of)-([xy])-(.+)$/, ([, d, v]) => overflowValues.includes(v) ? { [`overflow-${d}`]: v } : void 0]
|
|
400
|
-
];
|
|
401
|
-
|
|
402
|
-
const positions = [
|
|
403
|
-
[/^(?:position-|pos-)?(relative|absolute|fixed|sticky)$/, ([, v]) => ({ position: v })],
|
|
404
|
-
[/^(?:position-|pos-)([-\w]+)$/, ([, v]) => colors.globalKeywords.includes(v) ? { position: v } : void 0],
|
|
405
|
-
[/^(?:position-|pos-)?(static)$/, ([, v]) => ({ position: v })]
|
|
406
|
-
];
|
|
407
|
-
const justifies = [
|
|
408
|
-
["justify-start", { "justify-content": "flex-start" }],
|
|
409
|
-
["justify-end", { "justify-content": "flex-end" }],
|
|
410
|
-
["justify-center", { "justify-content": "center" }],
|
|
411
|
-
["justify-between", { "justify-content": "space-between" }],
|
|
412
|
-
["justify-around", { "justify-content": "space-around" }],
|
|
413
|
-
["justify-evenly", { "justify-content": "space-evenly" }],
|
|
414
|
-
...colors.makeGlobalStaticRules("justify", "justify-content"),
|
|
415
|
-
["justify-items-start", { "justify-items": "start" }],
|
|
416
|
-
["justify-items-end", { "justify-items": "end" }],
|
|
417
|
-
["justify-items-center", { "justify-items": "center" }],
|
|
418
|
-
["justify-items-stretch", { "justify-items": "stretch" }],
|
|
419
|
-
...colors.makeGlobalStaticRules("justify-items"),
|
|
420
|
-
["justify-self-auto", { "justify-self": "auto" }],
|
|
421
|
-
["justify-self-start", { "justify-self": "start" }],
|
|
422
|
-
["justify-self-end", { "justify-self": "end" }],
|
|
423
|
-
["justify-self-center", { "justify-self": "center" }],
|
|
424
|
-
["justify-self-stretch", { "justify-self": "stretch" }],
|
|
425
|
-
...colors.makeGlobalStaticRules("justify-self")
|
|
426
|
-
];
|
|
427
|
-
const orders = [
|
|
428
|
-
[/^order-(.+)$/, ([, v]) => ({ order: colors.handler.bracket.cssvar.number(v) })],
|
|
429
|
-
["order-first", { order: "-9999" }],
|
|
430
|
-
["order-last", { order: "9999" }],
|
|
431
|
-
["order-none", { order: "0" }]
|
|
432
|
-
];
|
|
433
|
-
const alignments = [
|
|
434
|
-
["content-center", { "align-content": "center" }],
|
|
435
|
-
["content-start", { "align-content": "flex-start" }],
|
|
436
|
-
["content-end", { "align-content": "flex-end" }],
|
|
437
|
-
["content-between", { "align-content": "space-between" }],
|
|
438
|
-
["content-around", { "align-content": "space-around" }],
|
|
439
|
-
["content-evenly", { "align-content": "space-evenly" }],
|
|
440
|
-
...colors.makeGlobalStaticRules("content", "align-content"),
|
|
441
|
-
["items-start", { "align-items": "flex-start" }],
|
|
442
|
-
["items-end", { "align-items": "flex-end" }],
|
|
443
|
-
["items-center", { "align-items": "center" }],
|
|
444
|
-
["items-baseline", { "align-items": "baseline" }],
|
|
445
|
-
["items-stretch", { "align-items": "stretch" }],
|
|
446
|
-
...colors.makeGlobalStaticRules("items", "align-items"),
|
|
447
|
-
["self-auto", { "align-self": "auto" }],
|
|
448
|
-
["self-start", { "align-self": "flex-start" }],
|
|
449
|
-
["self-end", { "align-self": "flex-end" }],
|
|
450
|
-
["self-center", { "align-self": "center" }],
|
|
451
|
-
["self-stretch", { "align-self": "stretch" }],
|
|
452
|
-
["self-baseline", { "align-self": "baseline" }],
|
|
453
|
-
...colors.makeGlobalStaticRules("self", "align-self")
|
|
454
|
-
];
|
|
455
|
-
const placements = [
|
|
456
|
-
["place-content-center", { "place-content": "center" }],
|
|
457
|
-
["place-content-start", { "place-content": "start" }],
|
|
458
|
-
["place-content-end", { "place-content": "end" }],
|
|
459
|
-
["place-content-between", { "place-content": "space-between" }],
|
|
460
|
-
["place-content-around", { "place-content": "space-around" }],
|
|
461
|
-
["place-content-evenly", { "place-content": "space-evenly" }],
|
|
462
|
-
["place-content-stretch", { "place-content": "stretch" }],
|
|
463
|
-
...colors.makeGlobalStaticRules("place-content"),
|
|
464
|
-
["place-items-start", { "place-items": "start" }],
|
|
465
|
-
["place-items-end", { "place-items": "end" }],
|
|
466
|
-
["place-items-center", { "place-items": "center" }],
|
|
467
|
-
["place-items-stretch", { "place-items": "stretch" }],
|
|
468
|
-
...colors.makeGlobalStaticRules("place-items"),
|
|
469
|
-
["place-self-auto", { "place-self": "auto" }],
|
|
470
|
-
["place-self-start", { "place-self": "start" }],
|
|
471
|
-
["place-self-end", { "place-self": "end" }],
|
|
472
|
-
["place-self-center", { "place-self": "center" }],
|
|
473
|
-
["place-self-stretch", { "place-self": "stretch" }],
|
|
474
|
-
...colors.makeGlobalStaticRules("place-self")
|
|
475
|
-
];
|
|
476
|
-
function handleInsetValue(v, { theme }) {
|
|
477
|
-
return theme.spacing?.[v] ?? colors.handler.bracket.cssvar.global.auto.fraction.rem(v);
|
|
478
|
-
}
|
|
479
|
-
function handleInsetValues([, d, v], ctx) {
|
|
480
|
-
const r = handleInsetValue(v, ctx);
|
|
481
|
-
if (r != null && d in colors.insetMap)
|
|
482
|
-
return colors.insetMap[d].map((i) => [i.slice(1), r]);
|
|
483
|
-
}
|
|
484
|
-
const insets = [
|
|
485
|
-
[
|
|
486
|
-
/^(?:position-|pos-)?inset-(.+)$/,
|
|
487
|
-
([, v], ctx) => ({ inset: handleInsetValue(v, ctx) }),
|
|
488
|
-
{
|
|
489
|
-
autocomplete: [
|
|
490
|
-
"(position|pos)-inset-<directions>-$spacing",
|
|
491
|
-
"(position|pos)-inset-(block|inline)-$spacing",
|
|
492
|
-
"(position|pos)-inset-(bs|be|is|ie)-$spacing",
|
|
493
|
-
"(position|pos)-(top|left|right|bottom)-$spacing"
|
|
494
|
-
]
|
|
495
|
-
}
|
|
496
|
-
],
|
|
497
|
-
[/^(?:position-|pos-)?inset-([xy])-(.+)$/, handleInsetValues],
|
|
498
|
-
[/^(?:position-|pos-)?inset-([rltbse])-(.+)$/, handleInsetValues],
|
|
499
|
-
[/^(?:position-|pos-)?inset-(block|inline)-(.+)$/, handleInsetValues],
|
|
500
|
-
[/^(?:position-|pos-)?inset-([bi][se])-(.+)$/, handleInsetValues],
|
|
501
|
-
[/^(?:position-|pos-)?(top|left|right|bottom)-(.+)$/, ([, d, v], ctx) => ({ [d]: handleInsetValue(v, ctx) })]
|
|
502
|
-
];
|
|
503
|
-
const floats = [
|
|
504
|
-
["float-left", { float: "left" }],
|
|
505
|
-
["float-right", { float: "right" }],
|
|
506
|
-
["float-none", { float: "none" }],
|
|
507
|
-
...colors.makeGlobalStaticRules("float"),
|
|
508
|
-
["clear-left", { clear: "left" }],
|
|
509
|
-
["clear-right", { clear: "right" }],
|
|
510
|
-
["clear-both", { clear: "both" }],
|
|
511
|
-
["clear-none", { clear: "none" }],
|
|
512
|
-
...colors.makeGlobalStaticRules("clear")
|
|
513
|
-
];
|
|
514
|
-
const zIndexes = [
|
|
515
|
-
[/^z([\d.]+)$/, ([, v]) => ({ "z-index": colors.handler.number(v) })],
|
|
516
|
-
[/^z-(.+)$/, ([, v]) => ({ "z-index": colors.handler.bracket.cssvar.global.auto.number(v) }), { autocomplete: "z-<num>" }]
|
|
517
|
-
];
|
|
518
|
-
const boxSizing = [
|
|
519
|
-
["box-border", { "box-sizing": "border-box" }],
|
|
520
|
-
["box-content", { "box-sizing": "content-box" }],
|
|
521
|
-
...colors.makeGlobalStaticRules("box", "box-sizing")
|
|
522
|
-
];
|
|
523
|
-
|
|
524
|
-
const sizeMapping = {
|
|
525
|
-
h: "height",
|
|
526
|
-
w: "width",
|
|
527
|
-
inline: "inline-size",
|
|
528
|
-
block: "block-size"
|
|
130
|
+
const duration = {
|
|
131
|
+
DEFAULT: "150ms",
|
|
132
|
+
none: "0ms",
|
|
133
|
+
75: "75ms",
|
|
134
|
+
100: "100ms",
|
|
135
|
+
150: "150ms",
|
|
136
|
+
200: "200ms",
|
|
137
|
+
300: "300ms",
|
|
138
|
+
500: "500ms",
|
|
139
|
+
700: "700ms",
|
|
140
|
+
1e3: "1000ms"
|
|
529
141
|
};
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
[
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
"h-screen-$verticalBreakpoints",
|
|
562
|
-
"(min|max)-h-screen-$verticalBreakpoints",
|
|
563
|
-
"w-screen-$breakpoints",
|
|
564
|
-
"(min|max)-w-screen-$breakpoints"
|
|
565
|
-
]
|
|
566
|
-
}]
|
|
567
|
-
];
|
|
568
|
-
function getAspectRatio(prop) {
|
|
569
|
-
if (/^\d+\/\d+$/.test(prop))
|
|
570
|
-
return prop;
|
|
571
|
-
switch (prop) {
|
|
572
|
-
case "square":
|
|
573
|
-
return "1/1";
|
|
574
|
-
case "video":
|
|
575
|
-
return "16/9";
|
|
576
|
-
}
|
|
577
|
-
return colors.handler.bracket.cssvar.global.auto.number(prop);
|
|
578
|
-
}
|
|
579
|
-
const aspectRatio = [
|
|
580
|
-
[/^aspect-(?:ratio-)?(.+)$/, ([, d]) => ({ "aspect-ratio": getAspectRatio(d) }), { autocomplete: ["aspect-(square|video|ratio)", "aspect-ratio-(square|video)"] }]
|
|
581
|
-
];
|
|
582
|
-
|
|
583
|
-
const paddings = [
|
|
584
|
-
[/^pa?()-?(-?.+)$/, colors.directionSize("padding"), { autocomplete: ["(m|p)<num>", "(m|p)-<num>"] }],
|
|
585
|
-
[/^p-?xy()()$/, colors.directionSize("padding"), { autocomplete: "(m|p)-(xy)" }],
|
|
586
|
-
[/^p-?([xy])(?:-?(-?.+))?$/, colors.directionSize("padding")],
|
|
587
|
-
[/^p-?([rltbse])(?:-?(-?.+))?$/, colors.directionSize("padding"), { autocomplete: "(m|p)<directions>-<num>" }],
|
|
588
|
-
[/^p-(block|inline)(?:-(-?.+))?$/, colors.directionSize("padding"), { autocomplete: "(m|p)-(block|inline)-<num>" }],
|
|
589
|
-
[/^p-?([bi][se])(?:-?(-?.+))?$/, colors.directionSize("padding"), { autocomplete: "(m|p)-(bs|be|is|ie)-<num>" }]
|
|
590
|
-
];
|
|
591
|
-
const margins = [
|
|
592
|
-
[/^ma?()-?(-?.+)$/, colors.directionSize("margin")],
|
|
593
|
-
[/^m-?xy()()$/, colors.directionSize("margin")],
|
|
594
|
-
[/^m-?([xy])(?:-?(-?.+))?$/, colors.directionSize("margin")],
|
|
595
|
-
[/^m-?([rltbse])(?:-?(-?.+))?$/, colors.directionSize("margin")],
|
|
596
|
-
[/^m-(block|inline)(?:-(-?.+))?$/, colors.directionSize("margin")],
|
|
597
|
-
[/^m-?([bi][se])(?:-?(-?.+))?$/, colors.directionSize("margin")]
|
|
598
|
-
];
|
|
599
|
-
|
|
600
|
-
const variablesAbbrMap = {
|
|
601
|
-
backface: "backface-visibility",
|
|
602
|
-
break: "word-break",
|
|
603
|
-
case: "text-transform",
|
|
604
|
-
content: "align-content",
|
|
605
|
-
fw: "font-weight",
|
|
606
|
-
items: "align-items",
|
|
607
|
-
justify: "justify-content",
|
|
608
|
-
select: "user-select",
|
|
609
|
-
self: "align-self",
|
|
610
|
-
vertical: "vertical-align",
|
|
611
|
-
visible: "visibility",
|
|
612
|
-
whitespace: "white-space",
|
|
613
|
-
ws: "white-space"
|
|
142
|
+
const borderRadius = {
|
|
143
|
+
"DEFAULT": "0.25rem",
|
|
144
|
+
"none": "0rem",
|
|
145
|
+
"sm": "0.125rem",
|
|
146
|
+
"md": "0.375rem",
|
|
147
|
+
"lg": "0.5rem",
|
|
148
|
+
"xl": "0.75rem",
|
|
149
|
+
"2xl": "1rem",
|
|
150
|
+
"3xl": "1.5rem",
|
|
151
|
+
"full": "9999px"
|
|
152
|
+
};
|
|
153
|
+
const boxShadow = {
|
|
154
|
+
"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)"],
|
|
155
|
+
"none": "0 0 rgba(0,0,0,0)",
|
|
156
|
+
"sm": "var(--un-shadow-inset) 0 1px 2px 0 rgba(0,0,0,0.05)",
|
|
157
|
+
"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)"],
|
|
158
|
+
"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)"],
|
|
159
|
+
"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)"],
|
|
160
|
+
"2xl": "var(--un-shadow-inset) 0 25px 50px -12px rgba(0,0,0,0.25)",
|
|
161
|
+
"inner": "inset 0 2px 4px 0 rgba(0,0,0,0.05)"
|
|
162
|
+
};
|
|
163
|
+
const easing = {
|
|
164
|
+
"DEFAULT": "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
165
|
+
"linear": "linear",
|
|
166
|
+
"in": "cubic-bezier(0.4, 0, 1, 1)",
|
|
167
|
+
"out": "cubic-bezier(0, 0, 0.2, 1)",
|
|
168
|
+
"in-out": "cubic-bezier(0.4, 0, 0.2, 1)"
|
|
169
|
+
};
|
|
170
|
+
const ringWidth = {
|
|
171
|
+
DEFAULT: "1px",
|
|
172
|
+
none: "0px"
|
|
614
173
|
};
|
|
615
|
-
const cssVariables = [
|
|
616
|
-
[/^(.+?)-(\$.+)$/, ([, name, varname]) => {
|
|
617
|
-
const prop = variablesAbbrMap[name];
|
|
618
|
-
if (prop)
|
|
619
|
-
return { [prop]: colors.handler.cssvar(varname) };
|
|
620
|
-
}]
|
|
621
|
-
];
|
|
622
|
-
const cssProperty = [
|
|
623
|
-
[/^\[([\w_-]+):([^'"]+)\]$/, ([, prop, value]) => ({ [prop]: colors.handler.bracket(`[${value}]`) })]
|
|
624
|
-
];
|
|
625
174
|
|
|
626
|
-
const
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
175
|
+
const blur = {
|
|
176
|
+
"DEFAULT": "8px",
|
|
177
|
+
"0": "0",
|
|
178
|
+
"sm": "4px",
|
|
179
|
+
"md": "12px",
|
|
180
|
+
"lg": "16px",
|
|
181
|
+
"xl": "24px",
|
|
182
|
+
"2xl": "40px",
|
|
183
|
+
"3xl": "64px"
|
|
184
|
+
};
|
|
185
|
+
const dropShadow = {
|
|
186
|
+
"DEFAULT": ["0 1px 2px rgba(0,0,0,0.1)", "0 1px 1px rgba(0,0,0,0.06)"],
|
|
187
|
+
"sm": "0 1px 1px rgba(0,0,0,0.05)",
|
|
188
|
+
"md": ["0 4px 3px rgba(0,0,0,0.07)", "0 2px 2px rgba(0,0,0,0.06)"],
|
|
189
|
+
"lg": ["0 10px 8px rgba(0,0,0,0.04)", "0 4px 3px rgba(0,0,0,0.1)"],
|
|
190
|
+
"xl": ["0 20px 13px rgba(0,0,0,0.03)", "0 8px 5px rgba(0,0,0,0.08)"],
|
|
191
|
+
"2xl": "0 25px 25px rgba(0,0,0,0.15)",
|
|
192
|
+
"none": "0 0 rgba(0,0,0,0)"
|
|
193
|
+
};
|
|
636
194
|
|
|
637
|
-
const
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
...
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
195
|
+
const baseSize = {
|
|
196
|
+
"xs": "20rem",
|
|
197
|
+
"sm": "24rem",
|
|
198
|
+
"md": "28rem",
|
|
199
|
+
"lg": "32rem",
|
|
200
|
+
"xl": "36rem",
|
|
201
|
+
"2xl": "42rem",
|
|
202
|
+
"3xl": "48rem",
|
|
203
|
+
"4xl": "56rem",
|
|
204
|
+
"5xl": "64rem",
|
|
205
|
+
"6xl": "72rem",
|
|
206
|
+
"7xl": "80rem",
|
|
207
|
+
"prose": "65ch"
|
|
208
|
+
};
|
|
209
|
+
const width = {
|
|
210
|
+
auto: "auto",
|
|
211
|
+
...baseSize,
|
|
212
|
+
screen: "100vw"
|
|
213
|
+
};
|
|
214
|
+
const maxWidth = {
|
|
215
|
+
none: "none",
|
|
216
|
+
...baseSize,
|
|
217
|
+
screen: "100vw"
|
|
218
|
+
};
|
|
219
|
+
const height = {
|
|
220
|
+
auto: "auto",
|
|
221
|
+
...baseSize,
|
|
222
|
+
screen: "100vh"
|
|
223
|
+
};
|
|
224
|
+
const maxHeight = {
|
|
225
|
+
none: "none",
|
|
226
|
+
...baseSize,
|
|
227
|
+
screen: "100vh"
|
|
228
|
+
};
|
|
658
229
|
|
|
659
|
-
const
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
[/^stroke-dash-(.+)$/, ([, s]) => ({ "stroke-dasharray": colors.handler.bracket.cssvar.number(s) }), { autocomplete: "stroke-dash-<num>" }],
|
|
665
|
-
[/^stroke-offset-(.+)$/, ([, s], { theme }) => ({ "stroke-dashoffset": theme.lineWidth?.[s] ?? colors.handler.bracket.cssvar.px.numberWithUnit(s) }), { autocomplete: "stroke-offset-$lineWidth" }],
|
|
666
|
-
[/^stroke-(.+)$/, colors.colorResolver("stroke", "stroke"), { autocomplete: "stroke-$colors" }],
|
|
667
|
-
[/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "stroke-(op|opacity)-<percent>" }],
|
|
668
|
-
["stroke-cap-square", { "stroke-linecap": "square" }],
|
|
669
|
-
["stroke-cap-round", { "stroke-linecap": "round" }],
|
|
670
|
-
["stroke-cap-auto", { "stroke-linecap": "butt" }],
|
|
671
|
-
["stroke-join-arcs", { "stroke-linejoin": "arcs" }],
|
|
672
|
-
["stroke-join-bevel", { "stroke-linejoin": "bevel" }],
|
|
673
|
-
["stroke-join-clip", { "stroke-linejoin": "miter-clip" }],
|
|
674
|
-
["stroke-join-round", { "stroke-linejoin": "round" }],
|
|
675
|
-
["stroke-join-auto", { "stroke-linejoin": "miter" }],
|
|
676
|
-
["stroke-none", { stroke: "none" }]
|
|
677
|
-
];
|
|
230
|
+
const preflightBase = {
|
|
231
|
+
...decoration.transformBase,
|
|
232
|
+
...decoration.boxShadowsBase,
|
|
233
|
+
...decoration.ringBase
|
|
234
|
+
};
|
|
678
235
|
|
|
679
|
-
const
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
verticalAligns,
|
|
715
|
-
transform.userSelects,
|
|
716
|
-
transform.whitespaces,
|
|
717
|
-
transform.breaks,
|
|
718
|
-
overflows,
|
|
719
|
-
outline,
|
|
720
|
-
appearance,
|
|
721
|
-
orders,
|
|
722
|
-
justifies,
|
|
723
|
-
alignments,
|
|
724
|
-
placements,
|
|
725
|
-
insets,
|
|
726
|
-
floats,
|
|
727
|
-
zIndexes,
|
|
728
|
-
boxSizing,
|
|
729
|
-
transitions,
|
|
730
|
-
transform.transforms,
|
|
731
|
-
willChange,
|
|
732
|
-
questionMark
|
|
733
|
-
].flat(1);
|
|
236
|
+
const theme = {
|
|
237
|
+
width,
|
|
238
|
+
height,
|
|
239
|
+
maxWidth,
|
|
240
|
+
maxHeight,
|
|
241
|
+
minWidth: maxWidth,
|
|
242
|
+
minHeight: maxHeight,
|
|
243
|
+
inlineSize: width,
|
|
244
|
+
blockSize: height,
|
|
245
|
+
maxInlineSize: maxWidth,
|
|
246
|
+
maxBlockSize: maxHeight,
|
|
247
|
+
minInlineSize: maxWidth,
|
|
248
|
+
minBlockSize: maxHeight,
|
|
249
|
+
colors: colors.colors,
|
|
250
|
+
fontFamily,
|
|
251
|
+
fontSize,
|
|
252
|
+
breakpoints,
|
|
253
|
+
verticalBreakpoints,
|
|
254
|
+
borderRadius,
|
|
255
|
+
lineHeight,
|
|
256
|
+
letterSpacing,
|
|
257
|
+
wordSpacing,
|
|
258
|
+
boxShadow,
|
|
259
|
+
textIndent,
|
|
260
|
+
textShadow,
|
|
261
|
+
textStrokeWidth,
|
|
262
|
+
blur,
|
|
263
|
+
dropShadow,
|
|
264
|
+
easing,
|
|
265
|
+
lineWidth,
|
|
266
|
+
spacing,
|
|
267
|
+
duration,
|
|
268
|
+
ringWidth,
|
|
269
|
+
preflightBase
|
|
270
|
+
};
|
|
734
271
|
|
|
735
|
-
exports.
|
|
736
|
-
exports.
|
|
737
|
-
exports.
|
|
738
|
-
exports.
|
|
739
|
-
exports.
|
|
740
|
-
exports.
|
|
741
|
-
exports.
|
|
742
|
-
exports.
|
|
743
|
-
exports.
|
|
744
|
-
exports.
|
|
745
|
-
exports.
|
|
746
|
-
exports.
|
|
747
|
-
exports.
|
|
748
|
-
exports.
|
|
749
|
-
exports.
|
|
750
|
-
exports.
|
|
751
|
-
exports.
|
|
752
|
-
exports.
|
|
753
|
-
exports.
|
|
754
|
-
exports.
|
|
755
|
-
exports.
|
|
756
|
-
exports.
|
|
757
|
-
exports.
|
|
758
|
-
exports.
|
|
759
|
-
exports.
|
|
760
|
-
exports.
|
|
761
|
-
exports.rules = rules;
|
|
762
|
-
exports.sizes = sizes;
|
|
763
|
-
exports.svgUtilities = svgUtilities;
|
|
764
|
-
exports.tabSizes = tabSizes;
|
|
765
|
-
exports.textAligns = textAligns;
|
|
766
|
-
exports.textColors = textColors;
|
|
767
|
-
exports.textDecorations = textDecorations;
|
|
768
|
-
exports.textIndents = textIndents;
|
|
769
|
-
exports.textShadows = textShadows;
|
|
770
|
-
exports.textStrokes = textStrokes;
|
|
771
|
-
exports.transitions = transitions;
|
|
772
|
-
exports.verticalAligns = verticalAligns;
|
|
773
|
-
exports.willChange = willChange;
|
|
774
|
-
exports.zIndexes = zIndexes;
|
|
272
|
+
exports.baseSize = baseSize;
|
|
273
|
+
exports.blur = blur;
|
|
274
|
+
exports.borderRadius = borderRadius;
|
|
275
|
+
exports.boxShadow = boxShadow;
|
|
276
|
+
exports.breakpoints = breakpoints;
|
|
277
|
+
exports.dropShadow = dropShadow;
|
|
278
|
+
exports.duration = duration;
|
|
279
|
+
exports.easing = easing;
|
|
280
|
+
exports.fontFamily = fontFamily;
|
|
281
|
+
exports.fontSize = fontSize;
|
|
282
|
+
exports.height = height;
|
|
283
|
+
exports.letterSpacing = letterSpacing;
|
|
284
|
+
exports.lineHeight = lineHeight;
|
|
285
|
+
exports.lineWidth = lineWidth;
|
|
286
|
+
exports.maxHeight = maxHeight;
|
|
287
|
+
exports.maxWidth = maxWidth;
|
|
288
|
+
exports.preflightBase = preflightBase;
|
|
289
|
+
exports.ringWidth = ringWidth;
|
|
290
|
+
exports.spacing = spacing;
|
|
291
|
+
exports.textIndent = textIndent;
|
|
292
|
+
exports.textShadow = textShadow;
|
|
293
|
+
exports.textStrokeWidth = textStrokeWidth;
|
|
294
|
+
exports.theme = theme;
|
|
295
|
+
exports.verticalBreakpoints = verticalBreakpoints;
|
|
296
|
+
exports.width = width;
|
|
297
|
+
exports.wordSpacing = wordSpacing;
|