@unocss/preset-mini 0.35.3 → 0.37.0
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/README.md +64 -0
- package/dist/chunks/default.cjs +10 -1
- package/dist/chunks/default.mjs +10 -2
- package/dist/chunks/default2.cjs +17 -320
- package/dist/chunks/default2.mjs +4 -290
- package/dist/chunks/default3.cjs +17 -3
- package/dist/chunks/default3.mjs +16 -3
- package/dist/chunks/transform.cjs +284 -0
- package/dist/chunks/transform.mjs +263 -0
- package/dist/{colors-ce2fecb8.d.ts → colors-5590b862.d.ts} +1 -1
- package/dist/colors.d.ts +2 -2
- package/dist/{default-e6d1b2e8.d.ts → default-ee82f36d.d.ts} +1 -1
- package/dist/index.cjs +15 -2
- package/dist/index.d.ts +9 -7
- package/dist/index.mjs +15 -3
- package/dist/rules.cjs +21 -17
- package/dist/rules.d.ts +31 -2
- package/dist/rules.mjs +2 -1
- package/dist/theme.cjs +4 -0
- package/dist/theme.d.ts +30 -5
- package/dist/theme.mjs +4 -1
- package/dist/{types-f7b2c653.d.ts → types-0f7ef446.d.ts} +2 -0
- package/dist/{utilities-e7a7f845.d.ts → utilities-a77178bb.d.ts} +1 -1
- package/dist/utils.d.ts +4 -4
- package/dist/variants.cjs +2 -1
- package/dist/variants.d.ts +7 -6
- package/dist/variants.mjs +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const utilities = require('./utilities.cjs');
|
|
4
|
+
|
|
5
|
+
const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
|
|
6
|
+
const displays = [
|
|
7
|
+
["inline", { display: "inline" }],
|
|
8
|
+
["block", { display: "block" }],
|
|
9
|
+
["inline-block", { display: "inline-block" }],
|
|
10
|
+
["contents", { display: "contents" }],
|
|
11
|
+
["flow-root", { display: "flow-root" }],
|
|
12
|
+
["list-item", { display: "list-item" }],
|
|
13
|
+
["hidden", { display: "none" }],
|
|
14
|
+
[/^display-(.+)$/, ([, c]) => ({ display: utilities.handler.bracket.cssvar(c) || c })]
|
|
15
|
+
];
|
|
16
|
+
const appearances = [
|
|
17
|
+
["visible", { visibility: "visible" }],
|
|
18
|
+
["invisible", { visibility: "hidden" }],
|
|
19
|
+
["backface-visible", { "backface-visibility": "visible" }],
|
|
20
|
+
["backface-hidden", { "backface-visibility": "hidden" }]
|
|
21
|
+
];
|
|
22
|
+
const cursors = [
|
|
23
|
+
[/^cursor-(.+)$/, ([, c]) => ({ cursor: utilities.handler.bracket.cssvar(c) || c })]
|
|
24
|
+
];
|
|
25
|
+
const pointerEvents = [
|
|
26
|
+
["pointer-events-auto", { "pointer-events": "auto" }],
|
|
27
|
+
["pointer-events-none", { "pointer-events": "none" }]
|
|
28
|
+
];
|
|
29
|
+
const resizes = [
|
|
30
|
+
["resize-x", { resize: "horizontal" }],
|
|
31
|
+
["resize-y", { resize: "vertical" }],
|
|
32
|
+
["resize", { resize: "both" }],
|
|
33
|
+
["resize-none", { resize: "none" }]
|
|
34
|
+
];
|
|
35
|
+
const userSelects = [
|
|
36
|
+
["select-auto", { "user-select": "auto" }],
|
|
37
|
+
["select-all", { "user-select": "all" }],
|
|
38
|
+
["select-text", { "user-select": "text" }],
|
|
39
|
+
["select-none", { "user-select": "none" }]
|
|
40
|
+
];
|
|
41
|
+
const whitespaces = [
|
|
42
|
+
[/^(?:whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap|break-spaces)$/, ([, v]) => ({ "white-space": v }), { autocomplete: "(whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap|break-spaces)" }]
|
|
43
|
+
];
|
|
44
|
+
const contents = [
|
|
45
|
+
[/^content-(.+)$/, ([, v]) => {
|
|
46
|
+
const c = utilities.handler.bracket.cssvar(v);
|
|
47
|
+
return { content: c == null ? `"${v}"` : c };
|
|
48
|
+
}],
|
|
49
|
+
["content-empty", { content: '""' }],
|
|
50
|
+
["content-none", { content: '""' }]
|
|
51
|
+
];
|
|
52
|
+
const breaks = [
|
|
53
|
+
["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }],
|
|
54
|
+
["break-words", { "overflow-wrap": "break-word" }],
|
|
55
|
+
["break-all", { "word-break": "break-all" }]
|
|
56
|
+
];
|
|
57
|
+
const textOverflows = [
|
|
58
|
+
["truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
|
|
59
|
+
["text-ellipsis", { "text-overflow": "ellipsis" }],
|
|
60
|
+
["text-clip", { "text-overflow": "clip" }]
|
|
61
|
+
];
|
|
62
|
+
const textTransforms = [
|
|
63
|
+
["case-upper", { "text-transform": "uppercase" }],
|
|
64
|
+
["case-lower", { "text-transform": "lowercase" }],
|
|
65
|
+
["case-capital", { "text-transform": "capitalize" }],
|
|
66
|
+
["case-normal", { "text-transform": "none" }]
|
|
67
|
+
];
|
|
68
|
+
const fontStyles = [
|
|
69
|
+
["italic", { "font-style": "italic" }],
|
|
70
|
+
["not-italic", { "font-style": "normal" }],
|
|
71
|
+
["font-italic", { "font-style": "italic" }],
|
|
72
|
+
["font-not-italic", { "font-style": "normal" }],
|
|
73
|
+
["oblique", { "font-style": "oblique" }],
|
|
74
|
+
["not-oblique", { "font-style": "normal" }],
|
|
75
|
+
["font-oblique", { "font-style": "oblique" }],
|
|
76
|
+
["font-not-oblique", { "font-style": "normal" }]
|
|
77
|
+
];
|
|
78
|
+
const fontSmoothings = [
|
|
79
|
+
["antialiased", {
|
|
80
|
+
"-webkit-font-smoothing": "antialiased",
|
|
81
|
+
"-moz-osx-font-smoothing": "grayscale",
|
|
82
|
+
"font-smoothing": "grayscale"
|
|
83
|
+
}],
|
|
84
|
+
["subpixel-antialiased", {
|
|
85
|
+
"-webkit-font-smoothing": "auto",
|
|
86
|
+
"-moz-osx-font-smoothing": "auto",
|
|
87
|
+
"font-smoothing": "auto"
|
|
88
|
+
}]
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
const ringBase = {
|
|
92
|
+
"--un-ring-inset": varEmpty,
|
|
93
|
+
"--un-ring-offset-width": "0px",
|
|
94
|
+
"--un-ring-offset-color": "#fff",
|
|
95
|
+
"--un-ring-width": "0px",
|
|
96
|
+
"--un-ring-color": "rgba(147,197,253,0.5)",
|
|
97
|
+
"--un-shadow": "0 0 #0000"
|
|
98
|
+
};
|
|
99
|
+
const rings = [
|
|
100
|
+
[/^ring(?:-(.+))?$/, ([, d], { theme }) => {
|
|
101
|
+
const value = theme.ringWidth?.[d || "DEFAULT"] ?? utilities.handler.px(d || "1");
|
|
102
|
+
if (value) {
|
|
103
|
+
return {
|
|
104
|
+
"--un-ring-width": value,
|
|
105
|
+
"--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)",
|
|
106
|
+
"--un-ring-shadow": "var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color)",
|
|
107
|
+
"box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow, 0 0 #0000)"
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}, { autocomplete: "ring-$ringWidth" }],
|
|
111
|
+
[/^ring-(?:width-|size-)(.+)$/, ([, d], { theme }) => ({ "--un-ring-width": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) }), { autocomplete: "ring-(width|size)-$lineWidth" }],
|
|
112
|
+
["ring-offset", { "--un-ring-offset-width": "1px" }],
|
|
113
|
+
[/^ring-offset-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "--un-ring-offset-width": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) }), { autocomplete: "ring-offset-(width|size)-$lineWidth" }],
|
|
114
|
+
[/^ring-(.+)$/, utilities.colorResolver("--un-ring-color", "ring"), { autocomplete: "ring-$colors" }],
|
|
115
|
+
[/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "ring-(op|opacity)-<percent>" }],
|
|
116
|
+
[/^ring-offset-(.+)$/, utilities.colorResolver("--un-ring-offset-color", "ring-offset"), { autocomplete: "ring-offset-$colors" }],
|
|
117
|
+
[/^ring-offset-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-offset-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "ring-offset-(op|opacity)-<percent>" }],
|
|
118
|
+
["ring-inset", { "--un-ring-inset": "inset" }]
|
|
119
|
+
];
|
|
120
|
+
|
|
121
|
+
const boxShadowsBase = {
|
|
122
|
+
"--un-ring-offset-shadow": "0 0 #0000",
|
|
123
|
+
"--un-ring-shadow": "0 0 #0000",
|
|
124
|
+
"--un-shadow-inset": varEmpty,
|
|
125
|
+
"--un-shadow": "0 0 #0000"
|
|
126
|
+
};
|
|
127
|
+
const boxShadows = [
|
|
128
|
+
[/^shadow(?:-(.+))?$/, ([, d], { theme }) => {
|
|
129
|
+
const v = theme.boxShadow?.[d || "DEFAULT"];
|
|
130
|
+
if (v) {
|
|
131
|
+
return {
|
|
132
|
+
"--un-shadow": utilities.colorableShadows(v, "--un-shadow-color").join(","),
|
|
133
|
+
"box-shadow": "var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow)"
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
}, { autocomplete: "shadow-$boxShadow" }],
|
|
137
|
+
[/^shadow-(.+)$/, utilities.colorResolver("--un-shadow-color", "shadow"), { autocomplete: "shadow-$colors" }],
|
|
138
|
+
[/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "shadow-(op|opacity)-<percent>" }],
|
|
139
|
+
["shadow-inset", { "--un-shadow-inset": "inset" }]
|
|
140
|
+
];
|
|
141
|
+
|
|
142
|
+
const transformCpu = [
|
|
143
|
+
"translateX(var(--un-translate-x))",
|
|
144
|
+
"translateY(var(--un-translate-y))",
|
|
145
|
+
"translateZ(var(--un-translate-z))",
|
|
146
|
+
"rotate(var(--un-rotate))",
|
|
147
|
+
"rotateX(var(--un-rotate-x))",
|
|
148
|
+
"rotateY(var(--un-rotate-y))",
|
|
149
|
+
"rotateZ(var(--un-rotate-z))",
|
|
150
|
+
"skewX(var(--un-skew-x))",
|
|
151
|
+
"skewY(var(--un-skew-y))",
|
|
152
|
+
"scaleX(var(--un-scale-x))",
|
|
153
|
+
"scaleY(var(--un-scale-y))",
|
|
154
|
+
"scaleZ(var(--un-scale-z))"
|
|
155
|
+
].join(" ");
|
|
156
|
+
const transformGpu = [
|
|
157
|
+
"translate3d(var(--un-translate-x), var(--un-translate-y), 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 transformBase = {
|
|
169
|
+
"--un-rotate": 0,
|
|
170
|
+
"--un-rotate-x": 0,
|
|
171
|
+
"--un-rotate-y": 0,
|
|
172
|
+
"--un-rotate-z": 0,
|
|
173
|
+
"--un-scale-x": 1,
|
|
174
|
+
"--un-scale-y": 1,
|
|
175
|
+
"--un-scale-z": 1,
|
|
176
|
+
"--un-skew-x": 0,
|
|
177
|
+
"--un-skew-y": 0,
|
|
178
|
+
"--un-translate-x": 0,
|
|
179
|
+
"--un-translate-y": 0,
|
|
180
|
+
"--un-translate-z": 0,
|
|
181
|
+
"--un-transform": transformCpu
|
|
182
|
+
};
|
|
183
|
+
const transforms = [
|
|
184
|
+
[/^(?:transform-)?origin-(.+)$/, ([, s]) => ({ "transform-origin": utilities.positionMap[s] ?? utilities.handler.bracket.cssvar(s) }), { autocomplete: [`transform-origin-(${Object.keys(utilities.positionMap).join("|")})`, `origin-(${Object.keys(utilities.positionMap).join("|")})`] }],
|
|
185
|
+
[/^(?:transform-)?perspect(?:ive)?-(.+)$/, ([, s]) => {
|
|
186
|
+
const v = utilities.handler.bracket.cssvar.px.numberWithUnit(s);
|
|
187
|
+
if (v != null) {
|
|
188
|
+
return {
|
|
189
|
+
"-webkit-perspective": v,
|
|
190
|
+
"perspective": v
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
}],
|
|
194
|
+
[/^(?:transform-)?perspect(?:ive)?-origin-(.+)$/, ([, s]) => {
|
|
195
|
+
const v = utilities.handler.bracket.cssvar(s) ?? (s.length >= 3 ? utilities.positionMap[s] : void 0);
|
|
196
|
+
if (v != null) {
|
|
197
|
+
return {
|
|
198
|
+
"-webkit-perspective-origin": v,
|
|
199
|
+
"perspective-origin": v
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
}],
|
|
203
|
+
[/^(?:transform-)?translate-()(.+)$/, handleTranslate],
|
|
204
|
+
[/^(?:transform-)?translate-([xyz])-(.+)$/, handleTranslate],
|
|
205
|
+
[/^(?:transform-)?rotate-()(.+)$/, handleRotate],
|
|
206
|
+
[/^(?:transform-)?rotate-([xyz])-(.+)$/, handleRotate],
|
|
207
|
+
[/^(?:transform-)?skew-([xy])-(.+)$/, handleSkew],
|
|
208
|
+
[/^(?:transform-)?scale-()(.+)$/, handleScale],
|
|
209
|
+
[/^(?:transform-)?scale-([xyz])-(.+)$/, handleScale],
|
|
210
|
+
[/^(?:transform-)?preserve-3d$/, () => ({ "transform-style": "preserve-3d" })],
|
|
211
|
+
[/^(?:transform-)?preserve-flat$/, () => ({ "transform-style": "flat" })],
|
|
212
|
+
["transform", { transform: "var(--un-transform)" }],
|
|
213
|
+
["transform-cpu", { transform: "var(--un-transform)" }],
|
|
214
|
+
["transform-gpu", { transform: transformGpu }],
|
|
215
|
+
["transform-none", { transform: "none" }]
|
|
216
|
+
];
|
|
217
|
+
function handleTranslate([, d, b], { theme }) {
|
|
218
|
+
const v = theme.spacing?.[b] ?? utilities.handler.bracket.cssvar.fraction.rem(b);
|
|
219
|
+
if (v != null) {
|
|
220
|
+
return [
|
|
221
|
+
...utilities.xyzMap[d].map((i) => [`--un-translate${i}`, v]),
|
|
222
|
+
["transform", "var(--un-transform)"]
|
|
223
|
+
];
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
function handleScale([, d, b]) {
|
|
227
|
+
const v = utilities.handler.bracket.cssvar.fraction.percent(b);
|
|
228
|
+
if (v != null) {
|
|
229
|
+
return [
|
|
230
|
+
...utilities.xyzMap[d].map((i) => [`--un-scale${i}`, v]),
|
|
231
|
+
["transform", "var(--un-transform)"]
|
|
232
|
+
];
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
function handleRotate([, d = "", b]) {
|
|
236
|
+
const v = utilities.handler.bracket.cssvar.degree(b);
|
|
237
|
+
if (v != null) {
|
|
238
|
+
if (d) {
|
|
239
|
+
return {
|
|
240
|
+
"--un-rotate": 0,
|
|
241
|
+
[`--un-rotate-${d}`]: v,
|
|
242
|
+
"transform": "var(--un-transform)"
|
|
243
|
+
};
|
|
244
|
+
} else {
|
|
245
|
+
return {
|
|
246
|
+
"--un-rotate-x": 0,
|
|
247
|
+
"--un-rotate-y": 0,
|
|
248
|
+
"--un-rotate-z": 0,
|
|
249
|
+
"--un-rotate": v,
|
|
250
|
+
"transform": "var(--un-transform)"
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
function handleSkew([, d, b]) {
|
|
256
|
+
const v = utilities.handler.bracket.cssvar.degree(b);
|
|
257
|
+
if (v != null) {
|
|
258
|
+
return {
|
|
259
|
+
[`--un-skew-${d}`]: v,
|
|
260
|
+
transform: "var(--un-transform)"
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
exports.appearances = appearances;
|
|
266
|
+
exports.boxShadows = boxShadows;
|
|
267
|
+
exports.boxShadowsBase = boxShadowsBase;
|
|
268
|
+
exports.breaks = breaks;
|
|
269
|
+
exports.contents = contents;
|
|
270
|
+
exports.cursors = cursors;
|
|
271
|
+
exports.displays = displays;
|
|
272
|
+
exports.fontSmoothings = fontSmoothings;
|
|
273
|
+
exports.fontStyles = fontStyles;
|
|
274
|
+
exports.pointerEvents = pointerEvents;
|
|
275
|
+
exports.resizes = resizes;
|
|
276
|
+
exports.ringBase = ringBase;
|
|
277
|
+
exports.rings = rings;
|
|
278
|
+
exports.textOverflows = textOverflows;
|
|
279
|
+
exports.textTransforms = textTransforms;
|
|
280
|
+
exports.transformBase = transformBase;
|
|
281
|
+
exports.transforms = transforms;
|
|
282
|
+
exports.userSelects = userSelects;
|
|
283
|
+
exports.varEmpty = varEmpty;
|
|
284
|
+
exports.whitespaces = whitespaces;
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { h as handler, c as colorResolver, f as colorableShadows, l as positionMap, x as xyzMap } from './utilities.mjs';
|
|
2
|
+
|
|
3
|
+
const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
|
|
4
|
+
const displays = [
|
|
5
|
+
["inline", { display: "inline" }],
|
|
6
|
+
["block", { display: "block" }],
|
|
7
|
+
["inline-block", { display: "inline-block" }],
|
|
8
|
+
["contents", { display: "contents" }],
|
|
9
|
+
["flow-root", { display: "flow-root" }],
|
|
10
|
+
["list-item", { display: "list-item" }],
|
|
11
|
+
["hidden", { display: "none" }],
|
|
12
|
+
[/^display-(.+)$/, ([, c]) => ({ display: handler.bracket.cssvar(c) || c })]
|
|
13
|
+
];
|
|
14
|
+
const appearances = [
|
|
15
|
+
["visible", { visibility: "visible" }],
|
|
16
|
+
["invisible", { visibility: "hidden" }],
|
|
17
|
+
["backface-visible", { "backface-visibility": "visible" }],
|
|
18
|
+
["backface-hidden", { "backface-visibility": "hidden" }]
|
|
19
|
+
];
|
|
20
|
+
const cursors = [
|
|
21
|
+
[/^cursor-(.+)$/, ([, c]) => ({ cursor: handler.bracket.cssvar(c) || c })]
|
|
22
|
+
];
|
|
23
|
+
const pointerEvents = [
|
|
24
|
+
["pointer-events-auto", { "pointer-events": "auto" }],
|
|
25
|
+
["pointer-events-none", { "pointer-events": "none" }]
|
|
26
|
+
];
|
|
27
|
+
const resizes = [
|
|
28
|
+
["resize-x", { resize: "horizontal" }],
|
|
29
|
+
["resize-y", { resize: "vertical" }],
|
|
30
|
+
["resize", { resize: "both" }],
|
|
31
|
+
["resize-none", { resize: "none" }]
|
|
32
|
+
];
|
|
33
|
+
const userSelects = [
|
|
34
|
+
["select-auto", { "user-select": "auto" }],
|
|
35
|
+
["select-all", { "user-select": "all" }],
|
|
36
|
+
["select-text", { "user-select": "text" }],
|
|
37
|
+
["select-none", { "user-select": "none" }]
|
|
38
|
+
];
|
|
39
|
+
const whitespaces = [
|
|
40
|
+
[/^(?:whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap|break-spaces)$/, ([, v]) => ({ "white-space": v }), { autocomplete: "(whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap|break-spaces)" }]
|
|
41
|
+
];
|
|
42
|
+
const contents = [
|
|
43
|
+
[/^content-(.+)$/, ([, v]) => {
|
|
44
|
+
const c = handler.bracket.cssvar(v);
|
|
45
|
+
return { content: c == null ? `"${v}"` : c };
|
|
46
|
+
}],
|
|
47
|
+
["content-empty", { content: '""' }],
|
|
48
|
+
["content-none", { content: '""' }]
|
|
49
|
+
];
|
|
50
|
+
const breaks = [
|
|
51
|
+
["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }],
|
|
52
|
+
["break-words", { "overflow-wrap": "break-word" }],
|
|
53
|
+
["break-all", { "word-break": "break-all" }]
|
|
54
|
+
];
|
|
55
|
+
const textOverflows = [
|
|
56
|
+
["truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
|
|
57
|
+
["text-ellipsis", { "text-overflow": "ellipsis" }],
|
|
58
|
+
["text-clip", { "text-overflow": "clip" }]
|
|
59
|
+
];
|
|
60
|
+
const textTransforms = [
|
|
61
|
+
["case-upper", { "text-transform": "uppercase" }],
|
|
62
|
+
["case-lower", { "text-transform": "lowercase" }],
|
|
63
|
+
["case-capital", { "text-transform": "capitalize" }],
|
|
64
|
+
["case-normal", { "text-transform": "none" }]
|
|
65
|
+
];
|
|
66
|
+
const fontStyles = [
|
|
67
|
+
["italic", { "font-style": "italic" }],
|
|
68
|
+
["not-italic", { "font-style": "normal" }],
|
|
69
|
+
["font-italic", { "font-style": "italic" }],
|
|
70
|
+
["font-not-italic", { "font-style": "normal" }],
|
|
71
|
+
["oblique", { "font-style": "oblique" }],
|
|
72
|
+
["not-oblique", { "font-style": "normal" }],
|
|
73
|
+
["font-oblique", { "font-style": "oblique" }],
|
|
74
|
+
["font-not-oblique", { "font-style": "normal" }]
|
|
75
|
+
];
|
|
76
|
+
const fontSmoothings = [
|
|
77
|
+
["antialiased", {
|
|
78
|
+
"-webkit-font-smoothing": "antialiased",
|
|
79
|
+
"-moz-osx-font-smoothing": "grayscale",
|
|
80
|
+
"font-smoothing": "grayscale"
|
|
81
|
+
}],
|
|
82
|
+
["subpixel-antialiased", {
|
|
83
|
+
"-webkit-font-smoothing": "auto",
|
|
84
|
+
"-moz-osx-font-smoothing": "auto",
|
|
85
|
+
"font-smoothing": "auto"
|
|
86
|
+
}]
|
|
87
|
+
];
|
|
88
|
+
|
|
89
|
+
const ringBase = {
|
|
90
|
+
"--un-ring-inset": varEmpty,
|
|
91
|
+
"--un-ring-offset-width": "0px",
|
|
92
|
+
"--un-ring-offset-color": "#fff",
|
|
93
|
+
"--un-ring-width": "0px",
|
|
94
|
+
"--un-ring-color": "rgba(147,197,253,0.5)",
|
|
95
|
+
"--un-shadow": "0 0 #0000"
|
|
96
|
+
};
|
|
97
|
+
const rings = [
|
|
98
|
+
[/^ring(?:-(.+))?$/, ([, d], { theme }) => {
|
|
99
|
+
const value = theme.ringWidth?.[d || "DEFAULT"] ?? handler.px(d || "1");
|
|
100
|
+
if (value) {
|
|
101
|
+
return {
|
|
102
|
+
"--un-ring-width": value,
|
|
103
|
+
"--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)",
|
|
104
|
+
"--un-ring-shadow": "var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color)",
|
|
105
|
+
"box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow, 0 0 #0000)"
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
}, { autocomplete: "ring-$ringWidth" }],
|
|
109
|
+
[/^ring-(?:width-|size-)(.+)$/, ([, d], { theme }) => ({ "--un-ring-width": theme.lineWidth?.[d] ?? handler.bracket.cssvar.px(d) }), { autocomplete: "ring-(width|size)-$lineWidth" }],
|
|
110
|
+
["ring-offset", { "--un-ring-offset-width": "1px" }],
|
|
111
|
+
[/^ring-offset-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "--un-ring-offset-width": theme.lineWidth?.[d] ?? handler.bracket.cssvar.px(d) }), { autocomplete: "ring-offset-(width|size)-$lineWidth" }],
|
|
112
|
+
[/^ring-(.+)$/, colorResolver("--un-ring-color", "ring"), { autocomplete: "ring-$colors" }],
|
|
113
|
+
[/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": handler.bracket.percent(opacity) }), { autocomplete: "ring-(op|opacity)-<percent>" }],
|
|
114
|
+
[/^ring-offset-(.+)$/, colorResolver("--un-ring-offset-color", "ring-offset"), { autocomplete: "ring-offset-$colors" }],
|
|
115
|
+
[/^ring-offset-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-offset-opacity": handler.bracket.percent(opacity) }), { autocomplete: "ring-offset-(op|opacity)-<percent>" }],
|
|
116
|
+
["ring-inset", { "--un-ring-inset": "inset" }]
|
|
117
|
+
];
|
|
118
|
+
|
|
119
|
+
const boxShadowsBase = {
|
|
120
|
+
"--un-ring-offset-shadow": "0 0 #0000",
|
|
121
|
+
"--un-ring-shadow": "0 0 #0000",
|
|
122
|
+
"--un-shadow-inset": varEmpty,
|
|
123
|
+
"--un-shadow": "0 0 #0000"
|
|
124
|
+
};
|
|
125
|
+
const boxShadows = [
|
|
126
|
+
[/^shadow(?:-(.+))?$/, ([, d], { theme }) => {
|
|
127
|
+
const v = theme.boxShadow?.[d || "DEFAULT"];
|
|
128
|
+
if (v) {
|
|
129
|
+
return {
|
|
130
|
+
"--un-shadow": colorableShadows(v, "--un-shadow-color").join(","),
|
|
131
|
+
"box-shadow": "var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow)"
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}, { autocomplete: "shadow-$boxShadow" }],
|
|
135
|
+
[/^shadow-(.+)$/, colorResolver("--un-shadow-color", "shadow"), { autocomplete: "shadow-$colors" }],
|
|
136
|
+
[/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": handler.bracket.percent(opacity) }), { autocomplete: "shadow-(op|opacity)-<percent>" }],
|
|
137
|
+
["shadow-inset", { "--un-shadow-inset": "inset" }]
|
|
138
|
+
];
|
|
139
|
+
|
|
140
|
+
const transformCpu = [
|
|
141
|
+
"translateX(var(--un-translate-x))",
|
|
142
|
+
"translateY(var(--un-translate-y))",
|
|
143
|
+
"translateZ(var(--un-translate-z))",
|
|
144
|
+
"rotate(var(--un-rotate))",
|
|
145
|
+
"rotateX(var(--un-rotate-x))",
|
|
146
|
+
"rotateY(var(--un-rotate-y))",
|
|
147
|
+
"rotateZ(var(--un-rotate-z))",
|
|
148
|
+
"skewX(var(--un-skew-x))",
|
|
149
|
+
"skewY(var(--un-skew-y))",
|
|
150
|
+
"scaleX(var(--un-scale-x))",
|
|
151
|
+
"scaleY(var(--un-scale-y))",
|
|
152
|
+
"scaleZ(var(--un-scale-z))"
|
|
153
|
+
].join(" ");
|
|
154
|
+
const transformGpu = [
|
|
155
|
+
"translate3d(var(--un-translate-x), var(--un-translate-y), var(--un-translate-z))",
|
|
156
|
+
"rotate(var(--un-rotate))",
|
|
157
|
+
"rotateX(var(--un-rotate-x))",
|
|
158
|
+
"rotateY(var(--un-rotate-y))",
|
|
159
|
+
"rotateZ(var(--un-rotate-z))",
|
|
160
|
+
"skewX(var(--un-skew-x))",
|
|
161
|
+
"skewY(var(--un-skew-y))",
|
|
162
|
+
"scaleX(var(--un-scale-x))",
|
|
163
|
+
"scaleY(var(--un-scale-y))",
|
|
164
|
+
"scaleZ(var(--un-scale-z))"
|
|
165
|
+
].join(" ");
|
|
166
|
+
const transformBase = {
|
|
167
|
+
"--un-rotate": 0,
|
|
168
|
+
"--un-rotate-x": 0,
|
|
169
|
+
"--un-rotate-y": 0,
|
|
170
|
+
"--un-rotate-z": 0,
|
|
171
|
+
"--un-scale-x": 1,
|
|
172
|
+
"--un-scale-y": 1,
|
|
173
|
+
"--un-scale-z": 1,
|
|
174
|
+
"--un-skew-x": 0,
|
|
175
|
+
"--un-skew-y": 0,
|
|
176
|
+
"--un-translate-x": 0,
|
|
177
|
+
"--un-translate-y": 0,
|
|
178
|
+
"--un-translate-z": 0,
|
|
179
|
+
"--un-transform": transformCpu
|
|
180
|
+
};
|
|
181
|
+
const transforms = [
|
|
182
|
+
[/^(?:transform-)?origin-(.+)$/, ([, s]) => ({ "transform-origin": positionMap[s] ?? handler.bracket.cssvar(s) }), { autocomplete: [`transform-origin-(${Object.keys(positionMap).join("|")})`, `origin-(${Object.keys(positionMap).join("|")})`] }],
|
|
183
|
+
[/^(?:transform-)?perspect(?:ive)?-(.+)$/, ([, s]) => {
|
|
184
|
+
const v = handler.bracket.cssvar.px.numberWithUnit(s);
|
|
185
|
+
if (v != null) {
|
|
186
|
+
return {
|
|
187
|
+
"-webkit-perspective": v,
|
|
188
|
+
"perspective": v
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
}],
|
|
192
|
+
[/^(?:transform-)?perspect(?:ive)?-origin-(.+)$/, ([, s]) => {
|
|
193
|
+
const v = handler.bracket.cssvar(s) ?? (s.length >= 3 ? positionMap[s] : void 0);
|
|
194
|
+
if (v != null) {
|
|
195
|
+
return {
|
|
196
|
+
"-webkit-perspective-origin": v,
|
|
197
|
+
"perspective-origin": v
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
}],
|
|
201
|
+
[/^(?:transform-)?translate-()(.+)$/, handleTranslate],
|
|
202
|
+
[/^(?:transform-)?translate-([xyz])-(.+)$/, handleTranslate],
|
|
203
|
+
[/^(?:transform-)?rotate-()(.+)$/, handleRotate],
|
|
204
|
+
[/^(?:transform-)?rotate-([xyz])-(.+)$/, handleRotate],
|
|
205
|
+
[/^(?:transform-)?skew-([xy])-(.+)$/, handleSkew],
|
|
206
|
+
[/^(?:transform-)?scale-()(.+)$/, handleScale],
|
|
207
|
+
[/^(?:transform-)?scale-([xyz])-(.+)$/, handleScale],
|
|
208
|
+
[/^(?:transform-)?preserve-3d$/, () => ({ "transform-style": "preserve-3d" })],
|
|
209
|
+
[/^(?:transform-)?preserve-flat$/, () => ({ "transform-style": "flat" })],
|
|
210
|
+
["transform", { transform: "var(--un-transform)" }],
|
|
211
|
+
["transform-cpu", { transform: "var(--un-transform)" }],
|
|
212
|
+
["transform-gpu", { transform: transformGpu }],
|
|
213
|
+
["transform-none", { transform: "none" }]
|
|
214
|
+
];
|
|
215
|
+
function handleTranslate([, d, b], { theme }) {
|
|
216
|
+
const v = theme.spacing?.[b] ?? handler.bracket.cssvar.fraction.rem(b);
|
|
217
|
+
if (v != null) {
|
|
218
|
+
return [
|
|
219
|
+
...xyzMap[d].map((i) => [`--un-translate${i}`, v]),
|
|
220
|
+
["transform", "var(--un-transform)"]
|
|
221
|
+
];
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
function handleScale([, d, b]) {
|
|
225
|
+
const v = handler.bracket.cssvar.fraction.percent(b);
|
|
226
|
+
if (v != null) {
|
|
227
|
+
return [
|
|
228
|
+
...xyzMap[d].map((i) => [`--un-scale${i}`, v]),
|
|
229
|
+
["transform", "var(--un-transform)"]
|
|
230
|
+
];
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
function handleRotate([, d = "", b]) {
|
|
234
|
+
const v = handler.bracket.cssvar.degree(b);
|
|
235
|
+
if (v != null) {
|
|
236
|
+
if (d) {
|
|
237
|
+
return {
|
|
238
|
+
"--un-rotate": 0,
|
|
239
|
+
[`--un-rotate-${d}`]: v,
|
|
240
|
+
"transform": "var(--un-transform)"
|
|
241
|
+
};
|
|
242
|
+
} else {
|
|
243
|
+
return {
|
|
244
|
+
"--un-rotate-x": 0,
|
|
245
|
+
"--un-rotate-y": 0,
|
|
246
|
+
"--un-rotate-z": 0,
|
|
247
|
+
"--un-rotate": v,
|
|
248
|
+
"transform": "var(--un-transform)"
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
function handleSkew([, d, b]) {
|
|
254
|
+
const v = handler.bracket.cssvar.degree(b);
|
|
255
|
+
if (v != null) {
|
|
256
|
+
return {
|
|
257
|
+
[`--un-skew-${d}`]: v,
|
|
258
|
+
transform: "var(--un-transform)"
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
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 };
|
package/dist/colors.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { c as colors } from './colors-
|
|
2
|
-
import './types-
|
|
1
|
+
export { c as colors } from './colors-5590b862.js';
|
|
2
|
+
import './types-0f7ef446.js';
|
package/dist/index.cjs
CHANGED
|
@@ -2,14 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
const core = require('@unocss/core');
|
|
5
6
|
const _default = require('./chunks/default.cjs');
|
|
6
7
|
const _default$1 = require('./chunks/default2.cjs');
|
|
7
8
|
const _default$2 = require('./chunks/default3.cjs');
|
|
8
9
|
const colors = require('./chunks/colors.cjs');
|
|
9
10
|
const utilities = require('./chunks/utilities.cjs');
|
|
10
|
-
require('
|
|
11
|
+
require('./chunks/transform.cjs');
|
|
11
12
|
require('./chunks/variants.cjs');
|
|
12
13
|
|
|
14
|
+
const preflights = [
|
|
15
|
+
{
|
|
16
|
+
layer: "preflights",
|
|
17
|
+
getCSS(ctx) {
|
|
18
|
+
if (ctx.theme.preflightBase)
|
|
19
|
+
return `*,::before,::after{${core.entriesToCss(Object.entries(ctx.theme.preflightBase))}}`;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
];
|
|
23
|
+
|
|
13
24
|
const presetMini = (options = {}) => {
|
|
14
25
|
options.dark = options.dark ?? "class";
|
|
15
26
|
options.attributifyPseudo = options.attributifyPseudo ?? false;
|
|
@@ -19,7 +30,8 @@ const presetMini = (options = {}) => {
|
|
|
19
30
|
rules: _default$1.rules,
|
|
20
31
|
variants: _default$2.variants(options),
|
|
21
32
|
options,
|
|
22
|
-
postprocess: options.variablePrefix && options.variablePrefix !== "un-" ? VarPrefixPostprocessor(options.variablePrefix) : void 0
|
|
33
|
+
postprocess: options.variablePrefix && options.variablePrefix !== "un-" ? VarPrefixPostprocessor(options.variablePrefix) : void 0,
|
|
34
|
+
preflights
|
|
23
35
|
};
|
|
24
36
|
};
|
|
25
37
|
function VarPrefixPostprocessor(prefix) {
|
|
@@ -36,4 +48,5 @@ exports.theme = _default.theme;
|
|
|
36
48
|
exports.colors = colors.colors;
|
|
37
49
|
exports.parseColor = utilities.parseColor;
|
|
38
50
|
exports["default"] = presetMini;
|
|
51
|
+
exports.preflights = preflights;
|
|
39
52
|
exports.presetMini = presetMini;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { PresetOptions, Preset } from '@unocss/core';
|
|
2
|
-
import { T as Theme } from './types-
|
|
3
|
-
export { T as Theme, a as ThemeAnimation } from './types-
|
|
4
|
-
export { t as theme } from './default-
|
|
5
|
-
export { c as colors } from './colors-
|
|
6
|
-
export { p as parseColor } from './utilities-
|
|
1
|
+
import { Preflight, PresetOptions, Preset } from '@unocss/core';
|
|
2
|
+
import { T as Theme } from './types-0f7ef446.js';
|
|
3
|
+
export { T as Theme, a as ThemeAnimation } from './types-0f7ef446.js';
|
|
4
|
+
export { t as theme } from './default-ee82f36d.js';
|
|
5
|
+
export { c as colors } from './colors-5590b862.js';
|
|
6
|
+
export { p as parseColor } from './utilities-a77178bb.js';
|
|
7
|
+
|
|
8
|
+
declare const preflights: Preflight[];
|
|
7
9
|
|
|
8
10
|
interface PresetMiniOptions extends PresetOptions {
|
|
9
11
|
/**
|
|
@@ -21,4 +23,4 @@ interface PresetMiniOptions extends PresetOptions {
|
|
|
21
23
|
}
|
|
22
24
|
declare const presetMini: (options?: PresetMiniOptions) => Preset<Theme>;
|
|
23
25
|
|
|
24
|
-
export { PresetMiniOptions, presetMini as default, presetMini };
|
|
26
|
+
export { PresetMiniOptions, presetMini as default, preflights, presetMini };
|
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,23 @@
|
|
|
1
|
+
import { entriesToCss } from '@unocss/core';
|
|
1
2
|
import { t as theme } from './chunks/default.mjs';
|
|
2
3
|
export { t as theme } from './chunks/default.mjs';
|
|
3
4
|
import { r as rules } from './chunks/default2.mjs';
|
|
4
5
|
import { v as variants } from './chunks/default3.mjs';
|
|
5
6
|
export { c as colors } from './chunks/colors.mjs';
|
|
6
7
|
export { p as parseColor } from './chunks/utilities.mjs';
|
|
7
|
-
import '
|
|
8
|
+
import './chunks/transform.mjs';
|
|
8
9
|
import './chunks/variants.mjs';
|
|
9
10
|
|
|
11
|
+
const preflights = [
|
|
12
|
+
{
|
|
13
|
+
layer: "preflights",
|
|
14
|
+
getCSS(ctx) {
|
|
15
|
+
if (ctx.theme.preflightBase)
|
|
16
|
+
return `*,::before,::after{${entriesToCss(Object.entries(ctx.theme.preflightBase))}}`;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
];
|
|
20
|
+
|
|
10
21
|
const presetMini = (options = {}) => {
|
|
11
22
|
options.dark = options.dark ?? "class";
|
|
12
23
|
options.attributifyPseudo = options.attributifyPseudo ?? false;
|
|
@@ -16,7 +27,8 @@ const presetMini = (options = {}) => {
|
|
|
16
27
|
rules,
|
|
17
28
|
variants: variants(options),
|
|
18
29
|
options,
|
|
19
|
-
postprocess: options.variablePrefix && options.variablePrefix !== "un-" ? VarPrefixPostprocessor(options.variablePrefix) : void 0
|
|
30
|
+
postprocess: options.variablePrefix && options.variablePrefix !== "un-" ? VarPrefixPostprocessor(options.variablePrefix) : void 0,
|
|
31
|
+
preflights
|
|
20
32
|
};
|
|
21
33
|
};
|
|
22
34
|
function VarPrefixPostprocessor(prefix) {
|
|
@@ -29,4 +41,4 @@ function VarPrefixPostprocessor(prefix) {
|
|
|
29
41
|
};
|
|
30
42
|
}
|
|
31
43
|
|
|
32
|
-
export { presetMini as default, presetMini };
|
|
44
|
+
export { presetMini as default, preflights, presetMini };
|