@unocss/preset-mini 0.55.0 → 0.55.2
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/colors.cjs +360 -6
- package/dist/{colors-dabdd21f.d.ts → colors.d.cts} +3 -2
- package/dist/colors.d.mts +354 -0
- package/dist/colors.d.ts +353 -2
- package/dist/colors.mjs +361 -1
- package/dist/index.cjs +12 -12
- package/dist/index.d.cts +69 -0
- package/dist/index.d.mts +69 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +9 -10
- package/dist/rules.cjs +928 -48
- package/dist/rules.d.cts +133 -0
- package/dist/rules.d.mts +133 -0
- package/dist/rules.d.ts +1 -1
- package/dist/rules.mjs +891 -4
- package/dist/{default-1f25a0ae.d.ts → shared/preset-mini.024bdcea.d.ts} +1 -1
- package/dist/shared/preset-mini.0a9763df.d.mts +721 -0
- package/dist/shared/preset-mini.0fac4963.mjs +320 -0
- package/dist/shared/preset-mini.5bfee53b.cjs +344 -0
- package/dist/shared/preset-mini.5f54784f.d.mts +71 -0
- package/dist/shared/preset-mini.5f54784f.d.ts +71 -0
- package/dist/shared/preset-mini.aa3a264b.d.cts +67 -0
- package/dist/shared/{preset-mini.a21c5071.cjs → preset-mini.b4ad509c.cjs} +12 -8
- package/dist/shared/preset-mini.d69a12a5.d.cts +721 -0
- package/dist/{utilities-d496540e.d.ts → shared/preset-mini.e93c20db.d.ts} +1 -1
- package/dist/shared/{preset-mini.6c1c8016.mjs → preset-mini.f1fe435e.mjs} +13 -9
- package/dist/shared/preset-mini.fc26b619.d.mts +67 -0
- package/dist/theme.cjs +308 -34
- package/dist/theme.d.cts +264 -0
- package/dist/theme.d.mts +264 -0
- package/dist/theme.d.ts +5 -5
- package/dist/theme.mjs +284 -4
- package/dist/utils.cjs +81 -10
- package/dist/utils.d.cts +83 -0
- package/dist/utils.d.mts +83 -0
- package/dist/utils.d.ts +18 -18
- package/dist/utils.mjs +81 -3
- package/dist/variants.cjs +737 -33
- package/dist/variants.d.cts +46 -0
- package/dist/variants.d.mts +46 -0
- package/dist/variants.d.ts +4 -4
- package/dist/variants.mjs +714 -4
- package/package.json +3 -3
- package/dist/shared/preset-mini.0131b915.mjs +0 -704
- package/dist/shared/preset-mini.1c66bf79.mjs +0 -361
- package/dist/shared/preset-mini.74f9d55e.mjs +0 -80
- package/dist/shared/preset-mini.811eb23d.mjs +0 -681
- package/dist/shared/preset-mini.8dd73081.mjs +0 -452
- package/dist/shared/preset-mini.9d93761b.cjs +0 -729
- package/dist/shared/preset-mini.b8d9397e.cjs +0 -471
- package/dist/shared/preset-mini.ce5169f2.cjs +0 -730
- package/dist/shared/preset-mini.d778b487.cjs +0 -85
- package/dist/shared/preset-mini.de3bd9f7.mjs +0 -284
- package/dist/shared/preset-mini.e078d7da.cjs +0 -313
- package/dist/shared/preset-mini.f3fc54d2.cjs +0 -363
- /package/dist/{types-d991ba46.d.ts → shared/preset-mini.5f54784f.d.cts} +0 -0
|
@@ -1,681 +0,0 @@
|
|
|
1
|
-
import { g as globalKeywords, h, c as colorResolver, d as directionMap, a as hasParseableColor, b as cornerMap, p as parseColor, e as colorToString, f as colorOpacityToString, n as numberWithUnitRE, m as makeGlobalStaticRules, i as insetMap, j as colorableShadows, k as positionMap, x as xyzMap } from './preset-mini.6c1c8016.mjs';
|
|
2
|
-
import '@unocss/core';
|
|
3
|
-
|
|
4
|
-
const verticalAlignAlias = {
|
|
5
|
-
"mid": "middle",
|
|
6
|
-
"base": "baseline",
|
|
7
|
-
"btm": "bottom",
|
|
8
|
-
"baseline": "baseline",
|
|
9
|
-
"top": "top",
|
|
10
|
-
"start": "top",
|
|
11
|
-
"middle": "middle",
|
|
12
|
-
"bottom": "bottom",
|
|
13
|
-
"end": "bottom",
|
|
14
|
-
"text-top": "text-top",
|
|
15
|
-
"text-bottom": "text-bottom",
|
|
16
|
-
"sub": "sub",
|
|
17
|
-
"super": "super",
|
|
18
|
-
...Object.fromEntries(globalKeywords.map((x) => [x, x]))
|
|
19
|
-
};
|
|
20
|
-
const verticalAligns = [
|
|
21
|
-
[/^(?:vertical|align|v)-([-\w]+)$/, ([, v]) => ({ "vertical-align": verticalAlignAlias[v] }), { autocomplete: `(vertical|align|v)-(${Object.keys(verticalAlignAlias).join("|")})` }]
|
|
22
|
-
];
|
|
23
|
-
const textAligns = ["center", "left", "right", "justify", "start", "end"].map((v) => [`text-${v}`, { "text-align": v }]);
|
|
24
|
-
|
|
25
|
-
const outline = [
|
|
26
|
-
[/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ?? h.bracket.cssvar.global.px(d) }), { autocomplete: "outline-(width|size)-<num>" }],
|
|
27
|
-
[/^outline-(?:color-)?(.+)$/, colorResolver("outline-color", "outline-color"), { autocomplete: "outline-$colors" }],
|
|
28
|
-
[/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ?? h.bracket.cssvar.global.px(d) }), { autocomplete: "outline-(offset)-<num>" }],
|
|
29
|
-
["outline", { "outline-style": "solid" }],
|
|
30
|
-
...["auto", "dashed", "dotted", "double", "hidden", "solid", "groove", "ridge", "inset", "outset", ...globalKeywords].map((v) => [`outline-${v}`, { "outline-style": v }]),
|
|
31
|
-
["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }]
|
|
32
|
-
];
|
|
33
|
-
const appearance = [
|
|
34
|
-
["appearance-none", {
|
|
35
|
-
"-webkit-appearance": "none",
|
|
36
|
-
"appearance": "none"
|
|
37
|
-
}]
|
|
38
|
-
];
|
|
39
|
-
function willChangeProperty(prop) {
|
|
40
|
-
return h.properties.auto.global(prop) ?? {
|
|
41
|
-
contents: "contents",
|
|
42
|
-
scroll: "scroll-position"
|
|
43
|
-
}[prop];
|
|
44
|
-
}
|
|
45
|
-
const willChange = [
|
|
46
|
-
[/^will-change-(.+)/, ([, p]) => ({ "will-change": willChangeProperty(p) })]
|
|
47
|
-
];
|
|
48
|
-
|
|
49
|
-
const borderStyles = ["solid", "dashed", "dotted", "double", "hidden", "none", "groove", "ridge", "inset", "outset", ...globalKeywords];
|
|
50
|
-
const borders = [
|
|
51
|
-
[/^(?:border|b)()(?:-(.+))?$/, handlerBorder, { autocomplete: "(border|b)-<directions>" }],
|
|
52
|
-
[/^(?:border|b)-([xy])(?:-(.+))?$/, handlerBorder],
|
|
53
|
-
[/^(?:border|b)-([rltbse])(?:-(.+))?$/, handlerBorder],
|
|
54
|
-
[/^(?:border|b)-(block|inline)(?:-(.+))?$/, handlerBorder],
|
|
55
|
-
[/^(?:border|b)-([bi][se])(?:-(.+))?$/, handlerBorder],
|
|
56
|
-
[/^(?:border|b)-()(?:width|size)-(.+)$/, handlerBorderSize, { autocomplete: ["(border|b)-<num>", "(border|b)-<directions>-<num>"] }],
|
|
57
|
-
[/^(?:border|b)-([xy])-(?:width|size)-(.+)$/, handlerBorderSize],
|
|
58
|
-
[/^(?:border|b)-([rltbse])-(?:width|size)-(.+)$/, handlerBorderSize],
|
|
59
|
-
[/^(?:border|b)-(block|inline)-(?:width|size)-(.+)$/, handlerBorderSize],
|
|
60
|
-
[/^(?:border|b)-([bi][se])-(?:width|size)-(.+)$/, handlerBorderSize],
|
|
61
|
-
[/^(?:border|b)-()(?:color-)?(.+)$/, handlerBorderColor, { autocomplete: ["(border|b)-$colors", "(border|b)-<directions>-$colors"] }],
|
|
62
|
-
[/^(?:border|b)-([xy])-(?:color-)?(.+)$/, handlerBorderColor],
|
|
63
|
-
[/^(?:border|b)-([rltbse])-(?:color-)?(.+)$/, handlerBorderColor],
|
|
64
|
-
[/^(?:border|b)-(block|inline)-(?:color-)?(.+)$/, handlerBorderColor],
|
|
65
|
-
[/^(?:border|b)-([bi][se])-(?:color-)?(.+)$/, handlerBorderColor],
|
|
66
|
-
[/^(?:border|b)-()op(?:acity)?-?(.+)$/, handlerBorderOpacity, { autocomplete: "(border|b)-(op|opacity)-<percent>" }],
|
|
67
|
-
[/^(?:border|b)-([xy])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
68
|
-
[/^(?:border|b)-([rltbse])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
69
|
-
[/^(?:border|b)-(block|inline)-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
70
|
-
[/^(?:border|b)-([bi][se])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
71
|
-
[/^(?:border-|b-)?(?:rounded|rd)()(?:-(.+))?$/, handlerRounded, { autocomplete: ["(border|b)-(rounded|rd)", "(border|b)-(rounded|rd)-<num>", "(rounded|rd)", "(rounded|rd)-<num>"] }],
|
|
72
|
-
[/^(?:border-|b-)?(?:rounded|rd)-([rltbse])(?:-(.+))?$/, handlerRounded],
|
|
73
|
-
[/^(?:border-|b-)?(?:rounded|rd)-([rltb]{2})(?:-(.+))?$/, handlerRounded],
|
|
74
|
-
[/^(?:border-|b-)?(?:rounded|rd)-([bise][se])(?:-(.+))?$/, handlerRounded],
|
|
75
|
-
[/^(?:border-|b-)?(?:rounded|rd)-([bi][se]-[bi][se])(?:-(.+))?$/, handlerRounded],
|
|
76
|
-
[/^(?: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("|")})`] }],
|
|
77
|
-
[/^(?:border|b)-([xy])-(?:style-)?(.+)$/, handlerBorderStyle],
|
|
78
|
-
[/^(?:border|b)-([rltbse])-(?:style-)?(.+)$/, handlerBorderStyle],
|
|
79
|
-
[/^(?:border|b)-(block|inline)-(?:style-)?(.+)$/, handlerBorderStyle],
|
|
80
|
-
[/^(?:border|b)-([bi][se])-(?:style-)?(.+)$/, handlerBorderStyle]
|
|
81
|
-
];
|
|
82
|
-
function borderColorResolver(direction) {
|
|
83
|
-
return ([, body], theme) => {
|
|
84
|
-
const data = 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`]: colorToString(cssColor, alpha)
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
if (direction === "") {
|
|
95
|
-
return {
|
|
96
|
-
"--un-border-opacity": colorOpacityToString(cssColor),
|
|
97
|
-
"border-color": colorToString(cssColor, "var(--un-border-opacity)")
|
|
98
|
-
};
|
|
99
|
-
} else {
|
|
100
|
-
return {
|
|
101
|
-
"--un-border-opacity": colorOpacityToString(cssColor),
|
|
102
|
-
[`--un-border${direction}-opacity`]: "var(--un-border-opacity)",
|
|
103
|
-
[`border${direction}-color`]: colorToString(cssColor, `var(--un-border${direction}-opacity)`)
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
} else if (color) {
|
|
107
|
-
return {
|
|
108
|
-
[`border${direction}-color`]: colorToString(color, alpha)
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
function handlerBorder(m, ctx) {
|
|
114
|
-
return handlerBorderSize(m, ctx);
|
|
115
|
-
}
|
|
116
|
-
function handlerBorderSize([, a = "", b], { theme }) {
|
|
117
|
-
const v = theme.lineWidth?.[b || "DEFAULT"] ?? h.bracket.cssvar.global.px(b || "1");
|
|
118
|
-
if (a in directionMap && v != null)
|
|
119
|
-
return directionMap[a].map((i) => [`border${i}-width`, v]);
|
|
120
|
-
}
|
|
121
|
-
function handlerBorderColor([, a = "", c], { theme }) {
|
|
122
|
-
if (a in directionMap && hasParseableColor(c, theme)) {
|
|
123
|
-
return Object.assign(
|
|
124
|
-
{},
|
|
125
|
-
...directionMap[a].map((i) => borderColorResolver(i)(["", c], theme))
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
function handlerBorderOpacity([, a = "", opacity]) {
|
|
130
|
-
const v = h.bracket.percent.cssvar(opacity);
|
|
131
|
-
if (a in directionMap && v != null)
|
|
132
|
-
return directionMap[a].map((i) => [`--un-border${i}-opacity`, v]);
|
|
133
|
-
}
|
|
134
|
-
function handlerRounded([, a = "", s], { theme }) {
|
|
135
|
-
const v = theme.borderRadius?.[s || "DEFAULT"] || h.bracket.cssvar.global.fraction.rem(s || "1");
|
|
136
|
-
if (a in cornerMap && v != null)
|
|
137
|
-
return cornerMap[a].map((i) => [`border${i}-radius`, v]);
|
|
138
|
-
}
|
|
139
|
-
function handlerBorderStyle([, a = "", s]) {
|
|
140
|
-
if (borderStyles.includes(s) && a in directionMap)
|
|
141
|
-
return directionMap[a].map((i) => [`border${i}-style`, s]);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
const opacity = [
|
|
145
|
-
[/^op(?:acity)?-?(.+)$/, ([, d]) => ({ opacity: h.bracket.percent.cssvar(d) })]
|
|
146
|
-
];
|
|
147
|
-
const textColors = [
|
|
148
|
-
[/^(?:color|c)-(.+)$/, colorResolver("color", "text"), { autocomplete: "(color|c)-$colors" }],
|
|
149
|
-
[/^text-(.+)$/, colorResolver("color", "text", (css) => !css.color?.toString().match(numberWithUnitRE)), { autocomplete: "text-$colors" }],
|
|
150
|
-
[/^(?:text|color|c)-(.+)$/, ([, v]) => globalKeywords.includes(v) ? { color: v } : void 0, { autocomplete: `(text|color|c)-(${globalKeywords.join("|")})` }],
|
|
151
|
-
[/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-text-opacity": h.bracket.percent.cssvar(opacity2) }), { autocomplete: "(text|color|c)-(op|opacity)-<percent>" }]
|
|
152
|
-
];
|
|
153
|
-
const bgColors = [
|
|
154
|
-
[/^bg-(.+)$/, colorResolver("background-color", "bg"), { autocomplete: "bg-$colors" }],
|
|
155
|
-
[/^bg-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-bg-opacity": h.bracket.percent.cssvar(opacity2) }), { autocomplete: "bg-(op|opacity)-<percent>" }]
|
|
156
|
-
];
|
|
157
|
-
const colorScheme = [
|
|
158
|
-
[/^color-scheme-(\w+)$/, ([, v]) => ({ "color-scheme": v })]
|
|
159
|
-
];
|
|
160
|
-
|
|
161
|
-
const decorationStyles = ["solid", "double", "dotted", "dashed", "wavy", ...globalKeywords];
|
|
162
|
-
const textDecorations = [
|
|
163
|
-
[/^(?:decoration-)?(underline|overline|line-through)$/, ([, s]) => ({ "text-decoration-line": s }), { autocomplete: "decoration-(underline|overline|line-through)" }],
|
|
164
|
-
[/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? h.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
|
|
165
|
-
[/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s }), { autocomplete: "(underline|decoration)-(auto|from-font)" }],
|
|
166
|
-
[/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
|
|
167
|
-
const result = colorResolver("text-decoration-color", "line")(match, ctx);
|
|
168
|
-
if (result) {
|
|
169
|
-
return {
|
|
170
|
-
"-webkit-text-decoration-color": result["text-decoration-color"],
|
|
171
|
-
...result
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
}, { autocomplete: "(underline|decoration)-$colors" }],
|
|
175
|
-
[/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "(underline|decoration)-(op|opacity)-<percent>" }],
|
|
176
|
-
[/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? h.auto.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
|
|
177
|
-
...decorationStyles.map((v) => [`underline-${v}`, { "text-decoration-style": v }]),
|
|
178
|
-
...decorationStyles.map((v) => [`decoration-${v}`, { "text-decoration-style": v }]),
|
|
179
|
-
["no-underline", { "text-decoration": "none" }],
|
|
180
|
-
["decoration-none", { "text-decoration": "none" }]
|
|
181
|
-
];
|
|
182
|
-
|
|
183
|
-
const transitionPropertyGroup = {
|
|
184
|
-
all: "all",
|
|
185
|
-
colors: ["color", "background-color", "border-color", "outline-color", "text-decoration-color", "fill", "stroke"].join(","),
|
|
186
|
-
none: "none",
|
|
187
|
-
opacity: "opacity",
|
|
188
|
-
shadow: "box-shadow",
|
|
189
|
-
transform: "transform"
|
|
190
|
-
};
|
|
191
|
-
function transitionProperty(prop) {
|
|
192
|
-
return h.properties(prop) ?? transitionPropertyGroup[prop];
|
|
193
|
-
}
|
|
194
|
-
const transitions = [
|
|
195
|
-
[/^transition(?:-([a-z-]+(?:,[a-z-]+)*))?(?:-(\d+))?$/, ([, prop, d], { theme }) => {
|
|
196
|
-
const p = prop != null ? transitionProperty(prop) : [transitionPropertyGroup.colors, "opacity", "box-shadow", "transform", "filter", "backdrop-filter"].join(",");
|
|
197
|
-
if (p) {
|
|
198
|
-
const duration = theme.duration?.[d || "DEFAULT"] ?? h.time(d || "150");
|
|
199
|
-
return {
|
|
200
|
-
"transition-property": p,
|
|
201
|
-
"transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
202
|
-
"transition-duration": duration
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
}, { autocomplete: `transition-(${Object.keys(transitionPropertyGroup).join("|")})` }],
|
|
206
|
-
[
|
|
207
|
-
/^(?:transition-)?duration-(.+)$/,
|
|
208
|
-
([, d], { theme }) => ({ "transition-duration": theme.duration?.[d || "DEFAULT"] ?? h.bracket.cssvar.time(d) }),
|
|
209
|
-
{ autocomplete: ["transition-duration-$duration", "duration-$duration"] }
|
|
210
|
-
],
|
|
211
|
-
[
|
|
212
|
-
/^(?:transition-)?delay-(.+)$/,
|
|
213
|
-
([, d], { theme }) => ({ "transition-delay": theme.duration?.[d || "DEFAULT"] ?? h.bracket.cssvar.time(d) }),
|
|
214
|
-
{ autocomplete: ["transition-delay-$duration", "delay-$duration"] }
|
|
215
|
-
],
|
|
216
|
-
[
|
|
217
|
-
/^(?:transition-)?ease(?:-(.+))?$/,
|
|
218
|
-
([, d], { theme }) => ({ "transition-timing-function": theme.easing?.[d || "DEFAULT"] ?? h.bracket.cssvar(d) }),
|
|
219
|
-
{ autocomplete: ["transition-ease-(linear|in|out|in-out|DEFAULT)", "ease-(linear|in|out|in-out|DEFAULT)"] }
|
|
220
|
-
],
|
|
221
|
-
[
|
|
222
|
-
/^(?:transition-)?property-(.+)$/,
|
|
223
|
-
([, v]) => ({ "transition-property": h.bracket.global(v) || transitionProperty(v) }),
|
|
224
|
-
{ autocomplete: [`transition-property-(${[...globalKeywords, ...Object.keys(transitionPropertyGroup)].join("|")})`] }
|
|
225
|
-
],
|
|
226
|
-
["transition-none", { transition: "none" }],
|
|
227
|
-
...makeGlobalStaticRules("transition")
|
|
228
|
-
];
|
|
229
|
-
|
|
230
|
-
const overflowValues = [
|
|
231
|
-
"auto",
|
|
232
|
-
"hidden",
|
|
233
|
-
"clip",
|
|
234
|
-
"visible",
|
|
235
|
-
"scroll",
|
|
236
|
-
"overlay",
|
|
237
|
-
...globalKeywords
|
|
238
|
-
];
|
|
239
|
-
const overflows = [
|
|
240
|
-
[/^(?:overflow|of)-(.+)$/, ([, v]) => overflowValues.includes(v) ? { overflow: v } : void 0, { autocomplete: [`(overflow|of)-(${overflowValues.join("|")})`, `(overflow|of)-(x|y)-(${overflowValues.join("|")})`] }],
|
|
241
|
-
[/^(?:overflow|of)-([xy])-(.+)$/, ([, d, v]) => overflowValues.includes(v) ? { [`overflow-${d}`]: v } : void 0]
|
|
242
|
-
];
|
|
243
|
-
|
|
244
|
-
const positions = [
|
|
245
|
-
[/^(?:position-|pos-)?(relative|absolute|fixed|sticky)$/, ([, v]) => ({ position: v }), {
|
|
246
|
-
autocomplete: [
|
|
247
|
-
"(position|pos)-<position>",
|
|
248
|
-
"(position|pos)-<globalKeyword>",
|
|
249
|
-
"<position>"
|
|
250
|
-
]
|
|
251
|
-
}],
|
|
252
|
-
[/^(?:position-|pos-)([-\w]+)$/, ([, v]) => globalKeywords.includes(v) ? { position: v } : void 0],
|
|
253
|
-
[/^(?:position-|pos-)?(static)$/, ([, v]) => ({ position: v })]
|
|
254
|
-
];
|
|
255
|
-
const justifies = [
|
|
256
|
-
["justify-start", { "justify-content": "flex-start" }],
|
|
257
|
-
["justify-end", { "justify-content": "flex-end" }],
|
|
258
|
-
["justify-center", { "justify-content": "center" }],
|
|
259
|
-
["justify-between", { "justify-content": "space-between" }],
|
|
260
|
-
["justify-around", { "justify-content": "space-around" }],
|
|
261
|
-
["justify-evenly", { "justify-content": "space-evenly" }],
|
|
262
|
-
["justify-stretch", { "justify-content": "stretch" }],
|
|
263
|
-
...makeGlobalStaticRules("justify", "justify-content"),
|
|
264
|
-
["justify-items-start", { "justify-items": "start" }],
|
|
265
|
-
["justify-items-end", { "justify-items": "end" }],
|
|
266
|
-
["justify-items-center", { "justify-items": "center" }],
|
|
267
|
-
["justify-items-stretch", { "justify-items": "stretch" }],
|
|
268
|
-
...makeGlobalStaticRules("justify-items"),
|
|
269
|
-
["justify-self-auto", { "justify-self": "auto" }],
|
|
270
|
-
["justify-self-start", { "justify-self": "start" }],
|
|
271
|
-
["justify-self-end", { "justify-self": "end" }],
|
|
272
|
-
["justify-self-center", { "justify-self": "center" }],
|
|
273
|
-
["justify-self-stretch", { "justify-self": "stretch" }],
|
|
274
|
-
...makeGlobalStaticRules("justify-self")
|
|
275
|
-
];
|
|
276
|
-
const orders = [
|
|
277
|
-
[/^order-(.+)$/, ([, v]) => ({ order: h.bracket.cssvar.number(v) })],
|
|
278
|
-
["order-first", { order: "-9999" }],
|
|
279
|
-
["order-last", { order: "9999" }],
|
|
280
|
-
["order-none", { order: "0" }]
|
|
281
|
-
];
|
|
282
|
-
const alignments = [
|
|
283
|
-
["content-center", { "align-content": "center" }],
|
|
284
|
-
["content-start", { "align-content": "flex-start" }],
|
|
285
|
-
["content-end", { "align-content": "flex-end" }],
|
|
286
|
-
["content-between", { "align-content": "space-between" }],
|
|
287
|
-
["content-around", { "align-content": "space-around" }],
|
|
288
|
-
["content-evenly", { "align-content": "space-evenly" }],
|
|
289
|
-
...makeGlobalStaticRules("content", "align-content"),
|
|
290
|
-
["items-start", { "align-items": "flex-start" }],
|
|
291
|
-
["items-end", { "align-items": "flex-end" }],
|
|
292
|
-
["items-center", { "align-items": "center" }],
|
|
293
|
-
["items-baseline", { "align-items": "baseline" }],
|
|
294
|
-
["items-stretch", { "align-items": "stretch" }],
|
|
295
|
-
...makeGlobalStaticRules("items", "align-items"),
|
|
296
|
-
["self-auto", { "align-self": "auto" }],
|
|
297
|
-
["self-start", { "align-self": "flex-start" }],
|
|
298
|
-
["self-end", { "align-self": "flex-end" }],
|
|
299
|
-
["self-center", { "align-self": "center" }],
|
|
300
|
-
["self-stretch", { "align-self": "stretch" }],
|
|
301
|
-
["self-baseline", { "align-self": "baseline" }],
|
|
302
|
-
...makeGlobalStaticRules("self", "align-self")
|
|
303
|
-
];
|
|
304
|
-
const placements = [
|
|
305
|
-
["place-content-center", { "place-content": "center" }],
|
|
306
|
-
["place-content-start", { "place-content": "start" }],
|
|
307
|
-
["place-content-end", { "place-content": "end" }],
|
|
308
|
-
["place-content-between", { "place-content": "space-between" }],
|
|
309
|
-
["place-content-around", { "place-content": "space-around" }],
|
|
310
|
-
["place-content-evenly", { "place-content": "space-evenly" }],
|
|
311
|
-
["place-content-stretch", { "place-content": "stretch" }],
|
|
312
|
-
...makeGlobalStaticRules("place-content"),
|
|
313
|
-
["place-items-start", { "place-items": "start" }],
|
|
314
|
-
["place-items-end", { "place-items": "end" }],
|
|
315
|
-
["place-items-center", { "place-items": "center" }],
|
|
316
|
-
["place-items-stretch", { "place-items": "stretch" }],
|
|
317
|
-
...makeGlobalStaticRules("place-items"),
|
|
318
|
-
["place-self-auto", { "place-self": "auto" }],
|
|
319
|
-
["place-self-start", { "place-self": "start" }],
|
|
320
|
-
["place-self-end", { "place-self": "end" }],
|
|
321
|
-
["place-self-center", { "place-self": "center" }],
|
|
322
|
-
["place-self-stretch", { "place-self": "stretch" }],
|
|
323
|
-
...makeGlobalStaticRules("place-self")
|
|
324
|
-
];
|
|
325
|
-
const flexGridJustifiesAlignments = [...justifies, ...alignments].flatMap(([k, v]) => [
|
|
326
|
-
[`flex-${k}`, v],
|
|
327
|
-
[`grid-${k}`, v]
|
|
328
|
-
]);
|
|
329
|
-
function handleInsetValue(v, { theme }) {
|
|
330
|
-
return theme.spacing?.[v] ?? h.bracket.cssvar.global.auto.fraction.rem(v);
|
|
331
|
-
}
|
|
332
|
-
function handleInsetValues([, d, v], ctx) {
|
|
333
|
-
const r = handleInsetValue(v, ctx);
|
|
334
|
-
if (r != null && d in insetMap)
|
|
335
|
-
return insetMap[d].map((i) => [i.slice(1), r]);
|
|
336
|
-
}
|
|
337
|
-
const insets = [
|
|
338
|
-
[
|
|
339
|
-
/^(?:position-|pos-)?inset-(.+)$/,
|
|
340
|
-
([, v], ctx) => ({ inset: handleInsetValue(v, ctx) }),
|
|
341
|
-
{
|
|
342
|
-
autocomplete: [
|
|
343
|
-
"(position|pos)-inset-<directions>-$spacing",
|
|
344
|
-
"(position|pos)-inset-(block|inline)-$spacing",
|
|
345
|
-
"(position|pos)-inset-(bs|be|is|ie)-$spacing",
|
|
346
|
-
"(position|pos)-(top|left|right|bottom)-$spacing"
|
|
347
|
-
]
|
|
348
|
-
}
|
|
349
|
-
],
|
|
350
|
-
[/^(?:position-|pos-)?(start|end)-(.+)$/, handleInsetValues],
|
|
351
|
-
[/^(?:position-|pos-)?inset-([xy])-(.+)$/, handleInsetValues],
|
|
352
|
-
[/^(?:position-|pos-)?inset-([rltbse])-(.+)$/, handleInsetValues],
|
|
353
|
-
[/^(?:position-|pos-)?inset-(block|inline)-(.+)$/, handleInsetValues],
|
|
354
|
-
[/^(?:position-|pos-)?inset-([bi][se])-(.+)$/, handleInsetValues],
|
|
355
|
-
[/^(?:position-|pos-)?(top|left|right|bottom)-(.+)$/, ([, d, v], ctx) => ({ [d]: handleInsetValue(v, ctx) })]
|
|
356
|
-
];
|
|
357
|
-
const floats = [
|
|
358
|
-
["float-left", { float: "left" }],
|
|
359
|
-
["float-right", { float: "right" }],
|
|
360
|
-
["float-none", { float: "none" }],
|
|
361
|
-
...makeGlobalStaticRules("float"),
|
|
362
|
-
["clear-left", { clear: "left" }],
|
|
363
|
-
["clear-right", { clear: "right" }],
|
|
364
|
-
["clear-both", { clear: "both" }],
|
|
365
|
-
["clear-none", { clear: "none" }],
|
|
366
|
-
...makeGlobalStaticRules("clear")
|
|
367
|
-
];
|
|
368
|
-
const zIndexes = [
|
|
369
|
-
[/^(?:position-|pos-)?z([\d.]+)$/, ([, v]) => ({ "z-index": h.number(v) })],
|
|
370
|
-
[/^(?:position-|pos-)?z-(.+)$/, ([, v]) => ({ "z-index": h.bracket.cssvar.global.auto.number(v) }), { autocomplete: "z-<num>" }]
|
|
371
|
-
];
|
|
372
|
-
const boxSizing = [
|
|
373
|
-
["box-border", { "box-sizing": "border-box" }],
|
|
374
|
-
["box-content", { "box-sizing": "content-box" }],
|
|
375
|
-
...makeGlobalStaticRules("box", "box-sizing")
|
|
376
|
-
];
|
|
377
|
-
|
|
378
|
-
const cursorValues = ["auto", "default", "none", "context-menu", "help", "pointer", "progress", "wait", "cell", "crosshair", "text", "vertical-text", "alias", "copy", "move", "no-drop", "not-allowed", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out"];
|
|
379
|
-
const containValues = ["none", "strict", "content", "size", "inline-size", "layout", "style", "paint"];
|
|
380
|
-
const varEmpty = " ";
|
|
381
|
-
const displays = [
|
|
382
|
-
["inline", { display: "inline" }],
|
|
383
|
-
["block", { display: "block" }],
|
|
384
|
-
["inline-block", { display: "inline-block" }],
|
|
385
|
-
["contents", { display: "contents" }],
|
|
386
|
-
["flow-root", { display: "flow-root" }],
|
|
387
|
-
["list-item", { display: "list-item" }],
|
|
388
|
-
["hidden", { display: "none" }],
|
|
389
|
-
[/^display-(.+)$/, ([, c]) => ({ display: h.bracket.cssvar.global(c) || c })]
|
|
390
|
-
];
|
|
391
|
-
const appearances = [
|
|
392
|
-
["visible", { visibility: "visible" }],
|
|
393
|
-
["invisible", { visibility: "hidden" }],
|
|
394
|
-
["backface-visible", { "backface-visibility": "visible" }],
|
|
395
|
-
["backface-hidden", { "backface-visibility": "hidden" }],
|
|
396
|
-
...makeGlobalStaticRules("backface", "backface-visibility")
|
|
397
|
-
];
|
|
398
|
-
const cursors = [
|
|
399
|
-
[/^cursor-(.+)$/, ([, c]) => ({ cursor: h.bracket.cssvar.global(c) })],
|
|
400
|
-
...cursorValues.map((v) => [`cursor-${v}`, { cursor: v }])
|
|
401
|
-
];
|
|
402
|
-
const contains = [
|
|
403
|
-
[/^contain-(.*)$/, ([, d]) => {
|
|
404
|
-
if (h.bracket(d) != null) {
|
|
405
|
-
return {
|
|
406
|
-
contain: h.bracket(d).split(" ").map((e) => h.cssvar.fraction(e) ?? e).join(" ")
|
|
407
|
-
};
|
|
408
|
-
}
|
|
409
|
-
return containValues.includes(d) ? { contain: d } : void 0;
|
|
410
|
-
}]
|
|
411
|
-
];
|
|
412
|
-
const pointerEvents = [
|
|
413
|
-
["pointer-events-auto", { "pointer-events": "auto" }],
|
|
414
|
-
["pointer-events-none", { "pointer-events": "none" }],
|
|
415
|
-
...makeGlobalStaticRules("pointer-events")
|
|
416
|
-
];
|
|
417
|
-
const resizes = [
|
|
418
|
-
["resize-x", { resize: "horizontal" }],
|
|
419
|
-
["resize-y", { resize: "vertical" }],
|
|
420
|
-
["resize", { resize: "both" }],
|
|
421
|
-
["resize-none", { resize: "none" }],
|
|
422
|
-
...makeGlobalStaticRules("resize")
|
|
423
|
-
];
|
|
424
|
-
const userSelects = [
|
|
425
|
-
["select-auto", { "-webkit-user-select": "auto", "user-select": "auto" }],
|
|
426
|
-
["select-all", { "-webkit-user-select": "all", "user-select": "all" }],
|
|
427
|
-
["select-text", { "-webkit-user-select": "text", "user-select": "text" }],
|
|
428
|
-
["select-none", { "-webkit-user-select": "none", "user-select": "none" }],
|
|
429
|
-
...makeGlobalStaticRules("select", "user-select")
|
|
430
|
-
];
|
|
431
|
-
const whitespaces = [
|
|
432
|
-
[
|
|
433
|
-
/^(?:whitespace-|ws-)([-\w]+)$/,
|
|
434
|
-
([, v]) => ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces", ...globalKeywords].includes(v) ? { "white-space": v } : void 0,
|
|
435
|
-
{ autocomplete: "(whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap|break-spaces)" }
|
|
436
|
-
]
|
|
437
|
-
];
|
|
438
|
-
const contentVisibility = [
|
|
439
|
-
[/^intrinsic-size-(.+)$/, ([, d]) => ({ "contain-intrinsic-size": h.bracket.cssvar.global.fraction.rem(d) }), { autocomplete: "intrinsic-size-<num>" }],
|
|
440
|
-
["content-visibility-visible", { "content-visibility": "visible" }],
|
|
441
|
-
["content-visibility-hidden", { "content-visibility": "hidden" }],
|
|
442
|
-
["content-visibility-auto", { "content-visibility": "auto" }],
|
|
443
|
-
...makeGlobalStaticRules("content-visibility")
|
|
444
|
-
];
|
|
445
|
-
const contents = [
|
|
446
|
-
[/^content-(.+)$/, ([, v]) => ({ content: h.bracket.cssvar(v) })],
|
|
447
|
-
["content-empty", { content: '""' }],
|
|
448
|
-
["content-none", { content: "none" }]
|
|
449
|
-
];
|
|
450
|
-
const breaks = [
|
|
451
|
-
["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }],
|
|
452
|
-
["break-words", { "overflow-wrap": "break-word" }],
|
|
453
|
-
["break-all", { "word-break": "break-all" }],
|
|
454
|
-
["break-keep", { "word-break": "keep-all" }],
|
|
455
|
-
["break-anywhere", { "overflow-wrap": "anywhere" }]
|
|
456
|
-
];
|
|
457
|
-
const textWraps = [
|
|
458
|
-
["text-wrap", { "text-wrap": "wrap" }],
|
|
459
|
-
["text-nowrap", { "text-wrap": "nowrap" }],
|
|
460
|
-
["text-balance", { "text-wrap": "balance" }]
|
|
461
|
-
];
|
|
462
|
-
const textOverflows = [
|
|
463
|
-
["truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
|
|
464
|
-
["text-truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
|
|
465
|
-
["text-ellipsis", { "text-overflow": "ellipsis" }],
|
|
466
|
-
["text-clip", { "text-overflow": "clip" }]
|
|
467
|
-
];
|
|
468
|
-
const textTransforms = [
|
|
469
|
-
["case-upper", { "text-transform": "uppercase" }],
|
|
470
|
-
["case-lower", { "text-transform": "lowercase" }],
|
|
471
|
-
["case-capital", { "text-transform": "capitalize" }],
|
|
472
|
-
["case-normal", { "text-transform": "none" }],
|
|
473
|
-
...makeGlobalStaticRules("case", "text-transform")
|
|
474
|
-
];
|
|
475
|
-
const fontStyles = [
|
|
476
|
-
["italic", { "font-style": "italic" }],
|
|
477
|
-
["not-italic", { "font-style": "normal" }],
|
|
478
|
-
["font-italic", { "font-style": "italic" }],
|
|
479
|
-
["font-not-italic", { "font-style": "normal" }],
|
|
480
|
-
["oblique", { "font-style": "oblique" }],
|
|
481
|
-
["not-oblique", { "font-style": "normal" }],
|
|
482
|
-
["font-oblique", { "font-style": "oblique" }],
|
|
483
|
-
["font-not-oblique", { "font-style": "normal" }]
|
|
484
|
-
];
|
|
485
|
-
const fontSmoothings = [
|
|
486
|
-
["antialiased", {
|
|
487
|
-
"-webkit-font-smoothing": "antialiased",
|
|
488
|
-
"-moz-osx-font-smoothing": "grayscale",
|
|
489
|
-
"font-smoothing": "grayscale"
|
|
490
|
-
}],
|
|
491
|
-
["subpixel-antialiased", {
|
|
492
|
-
"-webkit-font-smoothing": "auto",
|
|
493
|
-
"-moz-osx-font-smoothing": "auto",
|
|
494
|
-
"font-smoothing": "auto"
|
|
495
|
-
}]
|
|
496
|
-
];
|
|
497
|
-
|
|
498
|
-
const ringBase = {
|
|
499
|
-
"--un-ring-inset": varEmpty,
|
|
500
|
-
"--un-ring-offset-width": "0px",
|
|
501
|
-
"--un-ring-offset-color": "#fff",
|
|
502
|
-
"--un-ring-width": "0px",
|
|
503
|
-
"--un-ring-color": "rgba(147,197,253,0.5)",
|
|
504
|
-
"--un-shadow": "0 0 rgba(0,0,0,0)"
|
|
505
|
-
};
|
|
506
|
-
const rings = [
|
|
507
|
-
[/^ring(?:-(.+))?$/, ([, d], { theme }) => {
|
|
508
|
-
const value = theme.ringWidth?.[d || "DEFAULT"] ?? h.px(d || "1");
|
|
509
|
-
if (value) {
|
|
510
|
-
return {
|
|
511
|
-
"--un-ring-width": value,
|
|
512
|
-
"--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)",
|
|
513
|
-
"--un-ring-shadow": "var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color)",
|
|
514
|
-
"box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)"
|
|
515
|
-
};
|
|
516
|
-
}
|
|
517
|
-
}, { autocomplete: "ring-$ringWidth" }],
|
|
518
|
-
[/^ring-(?:width-|size-)(.+)$/, ([, d], { theme }) => ({ "--un-ring-width": theme.lineWidth?.[d] ?? h.bracket.cssvar.px(d) }), { autocomplete: "ring-(width|size)-$lineWidth" }],
|
|
519
|
-
["ring-offset", { "--un-ring-offset-width": "1px" }],
|
|
520
|
-
[/^ring-offset-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "--un-ring-offset-width": theme.lineWidth?.[d] ?? h.bracket.cssvar.px(d) }), { autocomplete: "ring-offset-(width|size)-$lineWidth" }],
|
|
521
|
-
[/^ring-(.+)$/, colorResolver("--un-ring-color", "ring"), { autocomplete: "ring-$colors" }],
|
|
522
|
-
[/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "ring-(op|opacity)-<percent>" }],
|
|
523
|
-
[/^ring-offset-(.+)$/, colorResolver("--un-ring-offset-color", "ring-offset"), { autocomplete: "ring-offset-$colors" }],
|
|
524
|
-
[/^ring-offset-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-offset-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "ring-offset-(op|opacity)-<percent>" }],
|
|
525
|
-
["ring-inset", { "--un-ring-inset": "inset" }]
|
|
526
|
-
];
|
|
527
|
-
|
|
528
|
-
const boxShadowsBase = {
|
|
529
|
-
"--un-ring-offset-shadow": "0 0 rgba(0,0,0,0)",
|
|
530
|
-
"--un-ring-shadow": "0 0 rgba(0,0,0,0)",
|
|
531
|
-
"--un-shadow-inset": varEmpty,
|
|
532
|
-
"--un-shadow": "0 0 rgba(0,0,0,0)"
|
|
533
|
-
};
|
|
534
|
-
const boxShadows = [
|
|
535
|
-
[/^shadow(?:-(.+))?$/, (match, context) => {
|
|
536
|
-
const [, d] = match;
|
|
537
|
-
const { theme } = context;
|
|
538
|
-
const v = theme.boxShadow?.[d || "DEFAULT"];
|
|
539
|
-
const c = d ? h.bracket.cssvar(d) : void 0;
|
|
540
|
-
if ((v != null || c != null) && !hasParseableColor(c, theme)) {
|
|
541
|
-
return {
|
|
542
|
-
"--un-shadow": colorableShadows(v || c, "--un-shadow-color").join(","),
|
|
543
|
-
"box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)"
|
|
544
|
-
};
|
|
545
|
-
}
|
|
546
|
-
return colorResolver("--un-shadow-color", "shadow")(match, context);
|
|
547
|
-
}, { autocomplete: ["shadow-$colors", "shadow-$boxShadow"] }],
|
|
548
|
-
[/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "shadow-(op|opacity)-<percent>" }],
|
|
549
|
-
["shadow-inset", { "--un-shadow-inset": "inset" }]
|
|
550
|
-
];
|
|
551
|
-
|
|
552
|
-
const transformValues = [
|
|
553
|
-
"translate",
|
|
554
|
-
"rotate",
|
|
555
|
-
"scale"
|
|
556
|
-
];
|
|
557
|
-
const transformCpu = [
|
|
558
|
-
"translateX(var(--un-translate-x))",
|
|
559
|
-
"translateY(var(--un-translate-y))",
|
|
560
|
-
"translateZ(var(--un-translate-z))",
|
|
561
|
-
"rotate(var(--un-rotate))",
|
|
562
|
-
"rotateX(var(--un-rotate-x))",
|
|
563
|
-
"rotateY(var(--un-rotate-y))",
|
|
564
|
-
"rotateZ(var(--un-rotate-z))",
|
|
565
|
-
"skewX(var(--un-skew-x))",
|
|
566
|
-
"skewY(var(--un-skew-y))",
|
|
567
|
-
"scaleX(var(--un-scale-x))",
|
|
568
|
-
"scaleY(var(--un-scale-y))",
|
|
569
|
-
"scaleZ(var(--un-scale-z))"
|
|
570
|
-
].join(" ");
|
|
571
|
-
const transformGpu = [
|
|
572
|
-
"translate3d(var(--un-translate-x), var(--un-translate-y), var(--un-translate-z))",
|
|
573
|
-
"rotate(var(--un-rotate))",
|
|
574
|
-
"rotateX(var(--un-rotate-x))",
|
|
575
|
-
"rotateY(var(--un-rotate-y))",
|
|
576
|
-
"rotateZ(var(--un-rotate-z))",
|
|
577
|
-
"skewX(var(--un-skew-x))",
|
|
578
|
-
"skewY(var(--un-skew-y))",
|
|
579
|
-
"scaleX(var(--un-scale-x))",
|
|
580
|
-
"scaleY(var(--un-scale-y))",
|
|
581
|
-
"scaleZ(var(--un-scale-z))"
|
|
582
|
-
].join(" ");
|
|
583
|
-
const transformBase = {
|
|
584
|
-
"--un-rotate": 0,
|
|
585
|
-
"--un-rotate-x": 0,
|
|
586
|
-
"--un-rotate-y": 0,
|
|
587
|
-
"--un-rotate-z": 0,
|
|
588
|
-
"--un-scale-x": 1,
|
|
589
|
-
"--un-scale-y": 1,
|
|
590
|
-
"--un-scale-z": 1,
|
|
591
|
-
"--un-skew-x": 0,
|
|
592
|
-
"--un-skew-y": 0,
|
|
593
|
-
"--un-translate-x": 0,
|
|
594
|
-
"--un-translate-y": 0,
|
|
595
|
-
"--un-translate-z": 0
|
|
596
|
-
};
|
|
597
|
-
const transforms = [
|
|
598
|
-
[/^(?:transform-)?origin-(.+)$/, ([, s]) => ({ "transform-origin": positionMap[s] ?? h.bracket.cssvar(s) }), { autocomplete: [`transform-origin-(${Object.keys(positionMap).join("|")})`, `origin-(${Object.keys(positionMap).join("|")})`] }],
|
|
599
|
-
[/^(?:transform-)?perspect(?:ive)?-(.+)$/, ([, s]) => {
|
|
600
|
-
const v = h.bracket.cssvar.px.numberWithUnit(s);
|
|
601
|
-
if (v != null) {
|
|
602
|
-
return {
|
|
603
|
-
"-webkit-perspective": v,
|
|
604
|
-
"perspective": v
|
|
605
|
-
};
|
|
606
|
-
}
|
|
607
|
-
}],
|
|
608
|
-
[/^(?:transform-)?perspect(?:ive)?-origin-(.+)$/, ([, s]) => {
|
|
609
|
-
const v = h.bracket.cssvar(s) ?? (s.length >= 3 ? positionMap[s] : void 0);
|
|
610
|
-
if (v != null) {
|
|
611
|
-
return {
|
|
612
|
-
"-webkit-perspective-origin": v,
|
|
613
|
-
"perspective-origin": v
|
|
614
|
-
};
|
|
615
|
-
}
|
|
616
|
-
}],
|
|
617
|
-
[/^(?:transform-)?translate-()(.+)$/, handleTranslate],
|
|
618
|
-
[/^(?:transform-)?translate-([xyz])-(.+)$/, handleTranslate],
|
|
619
|
-
[/^(?:transform-)?rotate-()(.+)$/, handleRotate],
|
|
620
|
-
[/^(?:transform-)?rotate-([xyz])-(.+)$/, handleRotate],
|
|
621
|
-
[/^(?:transform-)?skew-()(.+)$/, handleSkew],
|
|
622
|
-
[/^(?:transform-)?skew-([xy])-(.+)$/, handleSkew, { autocomplete: ["transform-skew-(x|y)-<percent>"] }],
|
|
623
|
-
[/^(?:transform-)?scale-()(.+)$/, handleScale],
|
|
624
|
-
[/^(?:transform-)?scale-([xyz])-(.+)$/, handleScale, { autocomplete: [`transform-(${transformValues.join("|")})-<percent>`, `transform-(${transformValues.join("|")})-(x|y|z)-<percent>`] }],
|
|
625
|
-
[/^(?:transform-)?preserve-3d$/, () => ({ "transform-style": "preserve-3d" })],
|
|
626
|
-
[/^(?:transform-)?preserve-flat$/, () => ({ "transform-style": "flat" })],
|
|
627
|
-
["transform", { transform: transformCpu }],
|
|
628
|
-
["transform-cpu", { transform: transformCpu }],
|
|
629
|
-
["transform-gpu", { transform: transformGpu }],
|
|
630
|
-
["transform-none", { transform: "none" }],
|
|
631
|
-
...makeGlobalStaticRules("transform")
|
|
632
|
-
];
|
|
633
|
-
function handleTranslate([, d, b], { theme }) {
|
|
634
|
-
const v = theme.spacing?.[b] ?? h.bracket.cssvar.fraction.rem(b);
|
|
635
|
-
if (v != null) {
|
|
636
|
-
return [
|
|
637
|
-
...xyzMap[d].map((i) => [`--un-translate${i}`, v]),
|
|
638
|
-
["transform", transformCpu]
|
|
639
|
-
];
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
function handleScale([, d, b]) {
|
|
643
|
-
const v = h.bracket.cssvar.fraction.percent(b);
|
|
644
|
-
if (v != null) {
|
|
645
|
-
return [
|
|
646
|
-
...xyzMap[d].map((i) => [`--un-scale${i}`, v]),
|
|
647
|
-
["transform", transformCpu]
|
|
648
|
-
];
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
function handleRotate([, d = "", b]) {
|
|
652
|
-
const v = h.bracket.cssvar.degree(b);
|
|
653
|
-
if (v != null) {
|
|
654
|
-
if (d) {
|
|
655
|
-
return {
|
|
656
|
-
"--un-rotate": 0,
|
|
657
|
-
[`--un-rotate-${d}`]: v,
|
|
658
|
-
"transform": transformCpu
|
|
659
|
-
};
|
|
660
|
-
} else {
|
|
661
|
-
return {
|
|
662
|
-
"--un-rotate-x": 0,
|
|
663
|
-
"--un-rotate-y": 0,
|
|
664
|
-
"--un-rotate-z": 0,
|
|
665
|
-
"--un-rotate": v,
|
|
666
|
-
"transform": transformCpu
|
|
667
|
-
};
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
function handleSkew([, d, b]) {
|
|
672
|
-
const v = h.bracket.cssvar.degree(b);
|
|
673
|
-
if (v != null) {
|
|
674
|
-
return [
|
|
675
|
-
...xyzMap[d].map((i) => [`--un-skew${i}`, v]),
|
|
676
|
-
["transform", transformCpu]
|
|
677
|
-
];
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
export { outline as A, appearance as B, orders as C, justifies as D, alignments as E, placements as F, flexGridJustifiesAlignments as G, insets as H, floats as I, zIndexes as J, boxSizing as K, transitions as L, transforms as M, willChange as N, contains as O, textWraps as P, transformBase as Q, boxShadowsBase as R, ringBase as S, borderStyles as T, handlerBorderStyle as U, varEmpty as V, borders as a, bgColors as b, colorScheme as c, displays as d, contentVisibility as e, contents as f, textDecorations as g, textTransforms as h, textAligns as i, textColors as j, fontStyles as k, fontSmoothings as l, boxShadows as m, cursors as n, opacity as o, positions as p, appearances as q, rings as r, pointerEvents as s, textOverflows as t, resizes as u, verticalAligns as v, userSelects as w, whitespaces as x, breaks as y, overflows as z };
|