@unocss/preset-mini 0.44.7 → 0.45.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/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
|
@@ -1,277 +0,0 @@
|
|
|
1
|
-
import { h as handler, m as makeGlobalStaticRules, g as globalKeywords, c as colorResolver, i as colorableShadows, q as positionMap, x as xyzMap } from './colors2.mjs';
|
|
2
|
-
|
|
3
|
-
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"];
|
|
4
|
-
const varEmpty = " ";
|
|
5
|
-
const displays = [
|
|
6
|
-
["inline", { display: "inline" }],
|
|
7
|
-
["block", { display: "block" }],
|
|
8
|
-
["inline-block", { display: "inline-block" }],
|
|
9
|
-
["contents", { display: "contents" }],
|
|
10
|
-
["flow-root", { display: "flow-root" }],
|
|
11
|
-
["list-item", { display: "list-item" }],
|
|
12
|
-
["hidden", { display: "none" }],
|
|
13
|
-
[/^display-(.+)$/, ([, c]) => ({ display: handler.bracket.cssvar.global(c) || c })]
|
|
14
|
-
];
|
|
15
|
-
const appearances = [
|
|
16
|
-
["visible", { visibility: "visible" }],
|
|
17
|
-
["invisible", { visibility: "hidden" }],
|
|
18
|
-
["backface-visible", { "backface-visibility": "visible" }],
|
|
19
|
-
["backface-hidden", { "backface-visibility": "hidden" }],
|
|
20
|
-
...makeGlobalStaticRules("backface", "backface-visibility")
|
|
21
|
-
];
|
|
22
|
-
const cursors = [
|
|
23
|
-
[/^cursor-(.+)$/, ([, c]) => ({ cursor: handler.bracket.cssvar.global(c) })],
|
|
24
|
-
...cursorValues.map((v) => [`cursor-${v}`, { cursor: v }])
|
|
25
|
-
];
|
|
26
|
-
const pointerEvents = [
|
|
27
|
-
["pointer-events-auto", { "pointer-events": "auto" }],
|
|
28
|
-
["pointer-events-none", { "pointer-events": "none" }],
|
|
29
|
-
...makeGlobalStaticRules("pointer-events")
|
|
30
|
-
];
|
|
31
|
-
const resizes = [
|
|
32
|
-
["resize-x", { resize: "horizontal" }],
|
|
33
|
-
["resize-y", { resize: "vertical" }],
|
|
34
|
-
["resize", { resize: "both" }],
|
|
35
|
-
["resize-none", { resize: "none" }],
|
|
36
|
-
...makeGlobalStaticRules("resize")
|
|
37
|
-
];
|
|
38
|
-
const userSelects = [
|
|
39
|
-
["select-auto", { "user-select": "auto" }],
|
|
40
|
-
["select-all", { "user-select": "all" }],
|
|
41
|
-
["select-text", { "user-select": "text" }],
|
|
42
|
-
["select-none", { "user-select": "none" }],
|
|
43
|
-
...makeGlobalStaticRules("select", "user-select")
|
|
44
|
-
];
|
|
45
|
-
const whitespaces = [
|
|
46
|
-
[
|
|
47
|
-
/^(?:whitespace-|ws-)([-\w]+)$/,
|
|
48
|
-
([, v]) => ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces", ...globalKeywords].includes(v) ? { "white-space": v } : void 0,
|
|
49
|
-
{ autocomplete: "(whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap|break-spaces)" }
|
|
50
|
-
]
|
|
51
|
-
];
|
|
52
|
-
const contents = [
|
|
53
|
-
[/^content-\[(.+)\]$/, ([, v]) => ({ content: `"${v}"` })],
|
|
54
|
-
[/^content-(\$.+)]$/, ([, v]) => ({ content: handler.cssvar(v) })],
|
|
55
|
-
["content-empty", { content: '""' }],
|
|
56
|
-
["content-none", { content: '""' }]
|
|
57
|
-
];
|
|
58
|
-
const breaks = [
|
|
59
|
-
["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }],
|
|
60
|
-
["break-words", { "overflow-wrap": "break-word" }],
|
|
61
|
-
["break-all", { "word-break": "break-all" }]
|
|
62
|
-
];
|
|
63
|
-
const textOverflows = [
|
|
64
|
-
["truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
|
|
65
|
-
["text-ellipsis", { "text-overflow": "ellipsis" }],
|
|
66
|
-
["text-clip", { "text-overflow": "clip" }]
|
|
67
|
-
];
|
|
68
|
-
const textTransforms = [
|
|
69
|
-
["case-upper", { "text-transform": "uppercase" }],
|
|
70
|
-
["case-lower", { "text-transform": "lowercase" }],
|
|
71
|
-
["case-capital", { "text-transform": "capitalize" }],
|
|
72
|
-
["case-normal", { "text-transform": "none" }],
|
|
73
|
-
...makeGlobalStaticRules("case", "text-transform")
|
|
74
|
-
];
|
|
75
|
-
const fontStyles = [
|
|
76
|
-
["italic", { "font-style": "italic" }],
|
|
77
|
-
["not-italic", { "font-style": "normal" }],
|
|
78
|
-
["font-italic", { "font-style": "italic" }],
|
|
79
|
-
["font-not-italic", { "font-style": "normal" }],
|
|
80
|
-
["oblique", { "font-style": "oblique" }],
|
|
81
|
-
["not-oblique", { "font-style": "normal" }],
|
|
82
|
-
["font-oblique", { "font-style": "oblique" }],
|
|
83
|
-
["font-not-oblique", { "font-style": "normal" }]
|
|
84
|
-
];
|
|
85
|
-
const fontSmoothings = [
|
|
86
|
-
["antialiased", {
|
|
87
|
-
"-webkit-font-smoothing": "antialiased",
|
|
88
|
-
"-moz-osx-font-smoothing": "grayscale",
|
|
89
|
-
"font-smoothing": "grayscale"
|
|
90
|
-
}],
|
|
91
|
-
["subpixel-antialiased", {
|
|
92
|
-
"-webkit-font-smoothing": "auto",
|
|
93
|
-
"-moz-osx-font-smoothing": "auto",
|
|
94
|
-
"font-smoothing": "auto"
|
|
95
|
-
}]
|
|
96
|
-
];
|
|
97
|
-
|
|
98
|
-
const ringBase = {
|
|
99
|
-
"--un-ring-inset": varEmpty,
|
|
100
|
-
"--un-ring-offset-width": "0px",
|
|
101
|
-
"--un-ring-offset-color": "#fff",
|
|
102
|
-
"--un-ring-width": "0px",
|
|
103
|
-
"--un-ring-color": "rgba(147,197,253,0.5)",
|
|
104
|
-
"--un-shadow": "0 0 rgba(0,0,0,0)"
|
|
105
|
-
};
|
|
106
|
-
const rings = [
|
|
107
|
-
[/^ring(?:-(.+))?$/, ([, d], { theme }) => {
|
|
108
|
-
const value = theme.ringWidth?.[d || "DEFAULT"] ?? handler.px(d || "1");
|
|
109
|
-
if (value) {
|
|
110
|
-
return {
|
|
111
|
-
"--un-ring-width": value,
|
|
112
|
-
"--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)",
|
|
113
|
-
"--un-ring-shadow": "var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color)",
|
|
114
|
-
"box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)"
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
}, { autocomplete: "ring-$ringWidth" }],
|
|
118
|
-
[/^ring-(?:width-|size-)(.+)$/, ([, d], { theme }) => ({ "--un-ring-width": theme.lineWidth?.[d] ?? handler.bracket.cssvar.px(d) }), { autocomplete: "ring-(width|size)-$lineWidth" }],
|
|
119
|
-
["ring-offset", { "--un-ring-offset-width": "1px" }],
|
|
120
|
-
[/^ring-offset-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "--un-ring-offset-width": theme.lineWidth?.[d] ?? handler.bracket.cssvar.px(d) }), { autocomplete: "ring-offset-(width|size)-$lineWidth" }],
|
|
121
|
-
[/^ring-(.+)$/, colorResolver("--un-ring-color", "ring"), { autocomplete: "ring-$colors" }],
|
|
122
|
-
[/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": handler.bracket.percent(opacity) }), { autocomplete: "ring-(op|opacity)-<percent>" }],
|
|
123
|
-
[/^ring-offset-(.+)$/, colorResolver("--un-ring-offset-color", "ring-offset"), { autocomplete: "ring-offset-$colors" }],
|
|
124
|
-
[/^ring-offset-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-offset-opacity": handler.bracket.percent(opacity) }), { autocomplete: "ring-offset-(op|opacity)-<percent>" }],
|
|
125
|
-
["ring-inset", { "--un-ring-inset": "inset" }]
|
|
126
|
-
];
|
|
127
|
-
|
|
128
|
-
const boxShadowsBase = {
|
|
129
|
-
"--un-ring-offset-shadow": "0 0 rgba(0,0,0,0)",
|
|
130
|
-
"--un-ring-shadow": "0 0 rgba(0,0,0,0)",
|
|
131
|
-
"--un-shadow-inset": varEmpty,
|
|
132
|
-
"--un-shadow": "0 0 rgba(0,0,0,0)"
|
|
133
|
-
};
|
|
134
|
-
const boxShadows = [
|
|
135
|
-
[/^shadow(?:-(.+))?$/, ([, d], { theme }) => {
|
|
136
|
-
const v = theme.boxShadow?.[d || "DEFAULT"];
|
|
137
|
-
if (v) {
|
|
138
|
-
return {
|
|
139
|
-
"--un-shadow": colorableShadows(v, "--un-shadow-color").join(","),
|
|
140
|
-
"box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)"
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
}, { autocomplete: "shadow-$boxShadow" }],
|
|
144
|
-
[/^shadow-(.+)$/, colorResolver("--un-shadow-color", "shadow"), { autocomplete: "shadow-$colors" }],
|
|
145
|
-
[/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": handler.bracket.percent(opacity) }), { autocomplete: "shadow-(op|opacity)-<percent>" }],
|
|
146
|
-
["shadow-inset", { "--un-shadow-inset": "inset" }]
|
|
147
|
-
];
|
|
148
|
-
|
|
149
|
-
const transformValues = [
|
|
150
|
-
"translate",
|
|
151
|
-
"rotate",
|
|
152
|
-
"scale"
|
|
153
|
-
];
|
|
154
|
-
const transformCpu = [
|
|
155
|
-
"translateX(var(--un-translate-x))",
|
|
156
|
-
"translateY(var(--un-translate-y))",
|
|
157
|
-
"translateZ(var(--un-translate-z))",
|
|
158
|
-
"rotate(var(--un-rotate))",
|
|
159
|
-
"rotateX(var(--un-rotate-x))",
|
|
160
|
-
"rotateY(var(--un-rotate-y))",
|
|
161
|
-
"rotateZ(var(--un-rotate-z))",
|
|
162
|
-
"skewX(var(--un-skew-x))",
|
|
163
|
-
"skewY(var(--un-skew-y))",
|
|
164
|
-
"scaleX(var(--un-scale-x))",
|
|
165
|
-
"scaleY(var(--un-scale-y))",
|
|
166
|
-
"scaleZ(var(--un-scale-z))"
|
|
167
|
-
].join(" ");
|
|
168
|
-
const transformGpu = [
|
|
169
|
-
"translate3d(var(--un-translate-x), var(--un-translate-y), var(--un-translate-z))",
|
|
170
|
-
"rotate(var(--un-rotate))",
|
|
171
|
-
"rotateX(var(--un-rotate-x))",
|
|
172
|
-
"rotateY(var(--un-rotate-y))",
|
|
173
|
-
"rotateZ(var(--un-rotate-z))",
|
|
174
|
-
"skewX(var(--un-skew-x))",
|
|
175
|
-
"skewY(var(--un-skew-y))",
|
|
176
|
-
"scaleX(var(--un-scale-x))",
|
|
177
|
-
"scaleY(var(--un-scale-y))",
|
|
178
|
-
"scaleZ(var(--un-scale-z))"
|
|
179
|
-
].join(" ");
|
|
180
|
-
const transformBase = {
|
|
181
|
-
"--un-rotate": 0,
|
|
182
|
-
"--un-rotate-x": 0,
|
|
183
|
-
"--un-rotate-y": 0,
|
|
184
|
-
"--un-rotate-z": 0,
|
|
185
|
-
"--un-scale-x": 1,
|
|
186
|
-
"--un-scale-y": 1,
|
|
187
|
-
"--un-scale-z": 1,
|
|
188
|
-
"--un-skew-x": 0,
|
|
189
|
-
"--un-skew-y": 0,
|
|
190
|
-
"--un-translate-x": 0,
|
|
191
|
-
"--un-translate-y": 0,
|
|
192
|
-
"--un-translate-z": 0
|
|
193
|
-
};
|
|
194
|
-
const transforms = [
|
|
195
|
-
[/^(?:transform-)?origin-(.+)$/, ([, s]) => ({ "transform-origin": positionMap[s] ?? handler.bracket.cssvar(s) }), { autocomplete: [`transform-origin-(${Object.keys(positionMap).join("|")})`, `origin-(${Object.keys(positionMap).join("|")})`] }],
|
|
196
|
-
[/^(?:transform-)?perspect(?:ive)?-(.+)$/, ([, s]) => {
|
|
197
|
-
const v = handler.bracket.cssvar.px.numberWithUnit(s);
|
|
198
|
-
if (v != null) {
|
|
199
|
-
return {
|
|
200
|
-
"-webkit-perspective": v,
|
|
201
|
-
"perspective": v
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
}],
|
|
205
|
-
[/^(?:transform-)?perspect(?:ive)?-origin-(.+)$/, ([, s]) => {
|
|
206
|
-
const v = handler.bracket.cssvar(s) ?? (s.length >= 3 ? positionMap[s] : void 0);
|
|
207
|
-
if (v != null) {
|
|
208
|
-
return {
|
|
209
|
-
"-webkit-perspective-origin": v,
|
|
210
|
-
"perspective-origin": v
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
}],
|
|
214
|
-
[/^(?:transform-)?translate-()(.+)$/, handleTranslate],
|
|
215
|
-
[/^(?:transform-)?translate-([xyz])-(.+)$/, handleTranslate],
|
|
216
|
-
[/^(?:transform-)?rotate-()(.+)$/, handleRotate],
|
|
217
|
-
[/^(?:transform-)?rotate-([xyz])-(.+)$/, handleRotate],
|
|
218
|
-
[/^(?:transform-)?skew-([xy])-(.+)$/, handleSkew, { autocomplete: ["transform-skew-(x|y)-<percent>"] }],
|
|
219
|
-
[/^(?:transform-)?scale-()(.+)$/, handleScale],
|
|
220
|
-
[/^(?:transform-)?scale-([xyz])-(.+)$/, handleScale, { autocomplete: [`transform-(${transformValues.join("|")})-<percent>`, `transform-(${transformValues.join("|")})-(x|y|z)-<percent>`] }],
|
|
221
|
-
[/^(?:transform-)?preserve-3d$/, () => ({ "transform-style": "preserve-3d" })],
|
|
222
|
-
[/^(?:transform-)?preserve-flat$/, () => ({ "transform-style": "flat" })],
|
|
223
|
-
["transform", { transform: transformCpu }],
|
|
224
|
-
["transform-cpu", { transform: transformCpu }],
|
|
225
|
-
["transform-gpu", { transform: transformGpu }],
|
|
226
|
-
["transform-none", { transform: "none" }],
|
|
227
|
-
...makeGlobalStaticRules("transform")
|
|
228
|
-
];
|
|
229
|
-
function handleTranslate([, d, b], { theme }) {
|
|
230
|
-
const v = theme.spacing?.[b] ?? handler.bracket.cssvar.fraction.rem(b);
|
|
231
|
-
if (v != null) {
|
|
232
|
-
return [
|
|
233
|
-
...xyzMap[d].map((i) => [`--un-translate${i}`, v]),
|
|
234
|
-
["transform", transformCpu]
|
|
235
|
-
];
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
function handleScale([, d, b]) {
|
|
239
|
-
const v = handler.bracket.cssvar.fraction.percent(b);
|
|
240
|
-
if (v != null) {
|
|
241
|
-
return [
|
|
242
|
-
...xyzMap[d].map((i) => [`--un-scale${i}`, v]),
|
|
243
|
-
["transform", transformCpu]
|
|
244
|
-
];
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
function handleRotate([, d = "", b]) {
|
|
248
|
-
const v = handler.bracket.cssvar.degree(b);
|
|
249
|
-
if (v != null) {
|
|
250
|
-
if (d) {
|
|
251
|
-
return {
|
|
252
|
-
"--un-rotate": 0,
|
|
253
|
-
[`--un-rotate-${d}`]: v,
|
|
254
|
-
"transform": transformCpu
|
|
255
|
-
};
|
|
256
|
-
} else {
|
|
257
|
-
return {
|
|
258
|
-
"--un-rotate-x": 0,
|
|
259
|
-
"--un-rotate-y": 0,
|
|
260
|
-
"--un-rotate-z": 0,
|
|
261
|
-
"--un-rotate": v,
|
|
262
|
-
"transform": transformCpu
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
function handleSkew([, d, b]) {
|
|
268
|
-
const v = handler.bracket.cssvar.degree(b);
|
|
269
|
-
if (v != null) {
|
|
270
|
-
return {
|
|
271
|
-
[`--un-skew-${d}`]: v,
|
|
272
|
-
transform: transformCpu
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
export { textOverflows as a, boxShadowsBase as b, contents as c, displays as d, textTransforms as e, fontStyles as f, fontSmoothings as g, boxShadows as h, rings as i, cursors as j, appearances as k, resizes as l, breaks as m, transforms as n, pointerEvents as p, ringBase as r, transformBase as t, userSelects as u, varEmpty as v, whitespaces as w };
|