@unocss/preset-uno 0.1.0-beta.2 → 0.1.3
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 +1 -1
- package/dist/chunk-5VZAX2M2.js +23 -0
- package/dist/chunk-7JQ3YQ3R.js +181 -0
- package/dist/chunk-C52N6GD5.mjs +23 -0
- package/dist/chunk-DFXBYGDQ.js +742 -0
- package/dist/chunk-DZNLHHE7.js +408 -0
- package/dist/chunk-GZCILHEZ.mjs +181 -0
- package/dist/chunk-S5DFLDKC.mjs +408 -0
- package/dist/chunk-S7XMIAO4.mjs +742 -0
- package/dist/index.js +16 -1
- package/dist/index.mjs +16 -1
- package/dist/rules.js +9 -1
- package/dist/rules.mjs +9 -1
- package/dist/theme.js +13 -1
- package/dist/theme.mjs +13 -1
- package/dist/variants.d.ts +18 -0
- package/dist/variants.js +27 -1
- package/dist/variants.mjs +27 -1
- package/package.json +2 -2
- package/dist/chunk-23VNEA2F.mjs +0 -1
- package/dist/chunk-2GX2NBYT.mjs +0 -1
- package/dist/chunk-4OCNSGZJ.mjs +0 -1
- package/dist/chunk-IRVOVJSX.js +0 -1
- package/dist/chunk-UZPC3RPP.js +0 -1
- package/dist/chunk-VIBF67CT.mjs +0 -1
- package/dist/chunk-WB7VET2U.js +0 -1
- package/dist/chunk-ZZFFLETS.js +0 -1
|
@@ -0,0 +1,742 @@
|
|
|
1
|
+
import {
|
|
2
|
+
theme
|
|
3
|
+
} from "./chunk-S5DFLDKC.mjs";
|
|
4
|
+
import {
|
|
5
|
+
variants
|
|
6
|
+
} from "./chunk-GZCILHEZ.mjs";
|
|
7
|
+
import {
|
|
8
|
+
__export,
|
|
9
|
+
__reExport
|
|
10
|
+
} from "./chunk-C52N6GD5.mjs";
|
|
11
|
+
|
|
12
|
+
// src/rules/animations.ts
|
|
13
|
+
var transitionProps = ["background-color", "border-color", "color", "fill", "stroke", "opacity", "box-shadow", "transform", "filter", "backdrop-filter"];
|
|
14
|
+
var transitionPropsStr = transitionProps.join(", ");
|
|
15
|
+
var transitions = [
|
|
16
|
+
[/^transition(?:-([a-z-]+))?(?:-(\d+))?$/, ([, prop, duration = "150"]) => {
|
|
17
|
+
if (prop && !transitionProps.includes(prop))
|
|
18
|
+
return;
|
|
19
|
+
return {
|
|
20
|
+
"transition-property": prop || transitionPropsStr,
|
|
21
|
+
"transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
22
|
+
"transition-duration": `${duration}ms`
|
|
23
|
+
};
|
|
24
|
+
}],
|
|
25
|
+
[/^duration-(\d+)$/, ([, duration = "150"]) => {
|
|
26
|
+
return {
|
|
27
|
+
"transition-duration": `${duration}ms`
|
|
28
|
+
};
|
|
29
|
+
}],
|
|
30
|
+
["ease", { "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)" }],
|
|
31
|
+
["ease-in", { "transition-timing-function": "cubic-bezier(0.4, 0, 1, 1)" }],
|
|
32
|
+
["ease-out", { "transition-timing-function": "cubic-bezier(0, 0, 0.2, 1)" }],
|
|
33
|
+
["ease-in-out", { "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)" }]
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
// src/rules/border.ts
|
|
37
|
+
import { handler as h } from "@unocss/core";
|
|
38
|
+
|
|
39
|
+
// src/utils/mappings.ts
|
|
40
|
+
var directionMap = {
|
|
41
|
+
"l": ["-left"],
|
|
42
|
+
"r": ["-right"],
|
|
43
|
+
"t": ["-top"],
|
|
44
|
+
"b": ["-bottom"],
|
|
45
|
+
"s": ["-inline-start"],
|
|
46
|
+
"e": ["-inline-end"],
|
|
47
|
+
"x": ["-left", "-right"],
|
|
48
|
+
"y": ["-top", "-bottom"],
|
|
49
|
+
"": [""],
|
|
50
|
+
"a": [""]
|
|
51
|
+
};
|
|
52
|
+
var cornerMap = {
|
|
53
|
+
"t": ["-top-left", "-top-right"],
|
|
54
|
+
"r": ["-top-right", "-bottom-right"],
|
|
55
|
+
"b": ["-bottom-left", "-bottom-right"],
|
|
56
|
+
"l": ["-bottom-left", "-top-left"],
|
|
57
|
+
"tl": ["-top-left"],
|
|
58
|
+
"lt": ["-top-left"],
|
|
59
|
+
"tr": ["-top-right"],
|
|
60
|
+
"rt": ["-top-right"],
|
|
61
|
+
"bl": ["-bottom-left"],
|
|
62
|
+
"lb": ["-bottom-left"],
|
|
63
|
+
"br": ["-bottom-right"],
|
|
64
|
+
"rb": ["-bottom-right"],
|
|
65
|
+
"": [""]
|
|
66
|
+
};
|
|
67
|
+
var xyzMap = {
|
|
68
|
+
"x": ["-x"],
|
|
69
|
+
"y": ["-y"],
|
|
70
|
+
"z": ["-z"],
|
|
71
|
+
"": ["-x", "-y"]
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// src/rules/border.ts
|
|
75
|
+
var borders = [
|
|
76
|
+
[/^border$/, handlerBorder],
|
|
77
|
+
[/^border(?:-([^-]+))?$/, handlerBorder],
|
|
78
|
+
[/^border(?:-([^-]+))?(?:-([^-]+))?$/, handlerBorder]
|
|
79
|
+
];
|
|
80
|
+
var borderRadius = [
|
|
81
|
+
[/^(?:border-)?(?:rounded|rd)$/, handlerRounded],
|
|
82
|
+
[/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?$/, handlerRounded],
|
|
83
|
+
[/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?(?:-([^-]+))?$/, handlerRounded]
|
|
84
|
+
];
|
|
85
|
+
var borderStyles = [
|
|
86
|
+
["border-solid", { "border-style": "solid" }],
|
|
87
|
+
["border-dashed", { "border-style": "dashed" }],
|
|
88
|
+
["border-dotted", { "border-style": "dotted" }],
|
|
89
|
+
["border-double", { "border-style": "double" }],
|
|
90
|
+
["border-none", { "border-style": "none" }]
|
|
91
|
+
];
|
|
92
|
+
function handlerBorder([, a, b]) {
|
|
93
|
+
const [d, s = "1"] = directionMap[a] ? [a, b] : ["", a];
|
|
94
|
+
const v = h.bracket.border(s);
|
|
95
|
+
if (v != null) {
|
|
96
|
+
return [
|
|
97
|
+
...directionMap[d].map((i) => [`border${i}-width`, v]),
|
|
98
|
+
["border-style", "solid"]
|
|
99
|
+
];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function handlerRounded([, a, b], theme2) {
|
|
103
|
+
var _a;
|
|
104
|
+
const [d, s = "DEFAULT"] = cornerMap[a] ? [a, b] : ["", a];
|
|
105
|
+
const v = ((_a = theme2.borderRadius) == null ? void 0 : _a[s]) || h.bracket.fraction.size(s);
|
|
106
|
+
if (v != null)
|
|
107
|
+
return cornerMap[d].map((i) => [`border${i}-radius`, v]);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// src/rules/colors.ts
|
|
111
|
+
import { handler as h2, hex2rgba } from "@unocss/core";
|
|
112
|
+
var colorResolver = (attribute, varName) => ([, body], theme2) => {
|
|
113
|
+
var _a;
|
|
114
|
+
const [main, opacity2] = body.split("/");
|
|
115
|
+
const [name, no = "DEFAULT"] = main.replace(/([a-z])([0-9])/g, "$1-$2").split(/-/g);
|
|
116
|
+
if (!name)
|
|
117
|
+
return;
|
|
118
|
+
let color;
|
|
119
|
+
const bracket = h2.bracket(main) || main;
|
|
120
|
+
if (bracket.startsWith("#"))
|
|
121
|
+
color = bracket.slice(1);
|
|
122
|
+
if (bracket.startsWith("hex-"))
|
|
123
|
+
color = bracket.slice(4);
|
|
124
|
+
if (!color) {
|
|
125
|
+
if (name === "transparent") {
|
|
126
|
+
return {
|
|
127
|
+
[attribute]: "transparent"
|
|
128
|
+
};
|
|
129
|
+
} else if (name === "inherit") {
|
|
130
|
+
return {
|
|
131
|
+
[attribute]: "inherit"
|
|
132
|
+
};
|
|
133
|
+
} else if (name === "current") {
|
|
134
|
+
return {
|
|
135
|
+
[attribute]: "currentColor"
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
color = (_a = theme2.colors) == null ? void 0 : _a[name];
|
|
139
|
+
if (no && color && typeof color !== "string")
|
|
140
|
+
color = color[no];
|
|
141
|
+
}
|
|
142
|
+
if (typeof color !== "string")
|
|
143
|
+
return;
|
|
144
|
+
const rgba = hex2rgba(color);
|
|
145
|
+
if (rgba) {
|
|
146
|
+
const a = opacity2 ? parseFloat(opacity2) / 100 : rgba[3];
|
|
147
|
+
if (a != null && !Number.isNaN(a)) {
|
|
148
|
+
rgba[3] = a;
|
|
149
|
+
return {
|
|
150
|
+
[attribute]: `rgba(${rgba.join(",")})`
|
|
151
|
+
};
|
|
152
|
+
} else {
|
|
153
|
+
return {
|
|
154
|
+
[`--un-${varName}-opacity`]: 1,
|
|
155
|
+
[attribute]: `rgba(${rgba.slice(0, 3).join(",")},var(--un-${varName}-opacity))`
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
var opacity = [
|
|
161
|
+
[/^op(?:acity)?-?(\d+)$/, ([, d]) => ({ opacity: h2.percent(d) })]
|
|
162
|
+
];
|
|
163
|
+
var textColors = [
|
|
164
|
+
[/^(?:text|color|c)-(.+)$/, colorResolver("color", "text")],
|
|
165
|
+
[/^(?:text|color|c)-op(?:acity)?-?(\d+)$/m, ([, opacity2]) => ({ "--un-text-opacity": h2.percent(opacity2) })]
|
|
166
|
+
];
|
|
167
|
+
var bgColors = [
|
|
168
|
+
[/^bg-(.+)$/, colorResolver("background-color", "bg")],
|
|
169
|
+
[/^bg-op(?:acity)?-?(\d+)$/m, ([, opacity2]) => ({ "--un-bg-opacity": h2.percent(opacity2) })]
|
|
170
|
+
];
|
|
171
|
+
var borderColors = [
|
|
172
|
+
[/^border-(.+)$/, colorResolver("border-color", "border")],
|
|
173
|
+
[/^border-op(?:acity)?-?(\d+)$/m, ([, opacity2]) => ({ "--un-border-opacity": h2.percent(opacity2) })]
|
|
174
|
+
];
|
|
175
|
+
|
|
176
|
+
// src/rules/filters.ts
|
|
177
|
+
var filterContnet = "var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia) var(--un-drop-shadow)";
|
|
178
|
+
var init = {
|
|
179
|
+
"--un-blur": "var(--un-empty,/*!*/ /*!*/)",
|
|
180
|
+
"--un-brightness": "var(--un-empty,/*!*/ /*!*/)",
|
|
181
|
+
"--un-contrast": "var(--un-empty,/*!*/ /*!*/)",
|
|
182
|
+
"--un-grayscale": "var(--un-empty,/*!*/ /*!*/)",
|
|
183
|
+
"--un-hue-rotate": "var(--un-empty,/*!*/ /*!*/)",
|
|
184
|
+
"--un-invert": "var(--un-empty,/*!*/ /*!*/)",
|
|
185
|
+
"--un-saturate": "var(--un-empty,/*!*/ /*!*/)",
|
|
186
|
+
"--un-sepia": "var(--un-empty,/*!*/ /*!*/)",
|
|
187
|
+
"--un-drop-shadow": "var(--un-empty,/*!*/ /*!*/)",
|
|
188
|
+
"filter": filterContnet
|
|
189
|
+
};
|
|
190
|
+
var filters = [
|
|
191
|
+
["filter", init],
|
|
192
|
+
["filter-none", { filter: "none" }],
|
|
193
|
+
[/^blur(?:-(\d+))?$/, ([, d]) => ({ "--un-blur": `blur(${d}px)`, "filter": filterContnet })],
|
|
194
|
+
["invert", { "--un-invert": "invert(100%)" }]
|
|
195
|
+
];
|
|
196
|
+
|
|
197
|
+
// src/rules/flex.ts
|
|
198
|
+
var flex = [
|
|
199
|
+
["flex-col", { "flex-direction": "column" }],
|
|
200
|
+
["flex-col-reverse", { "flex-direction": "column-reverse" }],
|
|
201
|
+
["flex-row", { "flex-direction": "row" }],
|
|
202
|
+
["flex-row-reverse", { "flex-direction": "row-reverse" }],
|
|
203
|
+
["flex-wrap", { "flex-wrap": "wrap" }],
|
|
204
|
+
["flex-wrap-reverse", { "flex-wrap": "wrap-reverse" }],
|
|
205
|
+
["flex-nowrap", { "flex-wrap": "nowrap" }],
|
|
206
|
+
["flex-1", { flex: "1 1 0%" }],
|
|
207
|
+
["flex-auto", { flex: "1 1 auto" }],
|
|
208
|
+
["flex-initial", { flex: "0 1 auto" }],
|
|
209
|
+
["flex-none", { flex: "none" }],
|
|
210
|
+
[/^flex-\[(.+)\]$/, ([, d]) => ({ flex: d })],
|
|
211
|
+
["flex-grow", { "flex-grow": 1 }],
|
|
212
|
+
["flex-grow-0", { "flex-grow": 0 }],
|
|
213
|
+
["flex-shrink", { "flex-shrink": 1 }],
|
|
214
|
+
["flex-shrink-0", { "flex-shrink": 0 }],
|
|
215
|
+
["flex", { display: "flex" }],
|
|
216
|
+
["inline-flex", { display: "inline-flex" }]
|
|
217
|
+
];
|
|
218
|
+
|
|
219
|
+
// src/rules/font.ts
|
|
220
|
+
import { handler as h3, toArray } from "@unocss/core";
|
|
221
|
+
var fonts = [
|
|
222
|
+
[/^font-(\w+)$/, ([, d], theme2) => {
|
|
223
|
+
var _a;
|
|
224
|
+
const font = (_a = theme2.fontFamily) == null ? void 0 : _a[d];
|
|
225
|
+
if (font) {
|
|
226
|
+
return {
|
|
227
|
+
"font-family": font
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
}]
|
|
231
|
+
];
|
|
232
|
+
var weightMap = {
|
|
233
|
+
thin: "100",
|
|
234
|
+
extralight: "200",
|
|
235
|
+
light: "300",
|
|
236
|
+
normal: "400",
|
|
237
|
+
medium: "500",
|
|
238
|
+
semibold: "600",
|
|
239
|
+
bold: "700",
|
|
240
|
+
extrabold: "800",
|
|
241
|
+
black: "900"
|
|
242
|
+
};
|
|
243
|
+
var fontSizes = [
|
|
244
|
+
[/^text-([^-]+)$/, ([, s = "base"], theme2) => {
|
|
245
|
+
var _a;
|
|
246
|
+
const result = toArray(((_a = theme2.fontSize) == null ? void 0 : _a[s]) || h3.bracket.size(s));
|
|
247
|
+
if (result == null ? void 0 : result[0]) {
|
|
248
|
+
const [size, height = "1"] = result;
|
|
249
|
+
return {
|
|
250
|
+
"font-size": size,
|
|
251
|
+
"line-height": height
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
}]
|
|
255
|
+
];
|
|
256
|
+
var fontWeights = [
|
|
257
|
+
[/^(?:font|fw)-?([^-]+)$/, ([, s]) => {
|
|
258
|
+
const v = weightMap[s] || h3.number(s);
|
|
259
|
+
if (v)
|
|
260
|
+
return { "font-weight": v };
|
|
261
|
+
}]
|
|
262
|
+
];
|
|
263
|
+
var leadings = [
|
|
264
|
+
[/^(?:leading|lh)-([^-]+)$/, ([, s], theme2) => {
|
|
265
|
+
var _a;
|
|
266
|
+
const v = ((_a = theme2.lineHeight) == null ? void 0 : _a[s]) || h3.bracket.size(s);
|
|
267
|
+
if (v !== null)
|
|
268
|
+
return { "line-height": v };
|
|
269
|
+
}]
|
|
270
|
+
];
|
|
271
|
+
var trackings = [
|
|
272
|
+
[/^tracking-([^-]+)$/, ([, s], theme2) => {
|
|
273
|
+
var _a;
|
|
274
|
+
const v = ((_a = theme2.letterSpacing) == null ? void 0 : _a[s]) || h3.bracket.size(s);
|
|
275
|
+
if (v !== null)
|
|
276
|
+
return { "letter-spacing": v };
|
|
277
|
+
}]
|
|
278
|
+
];
|
|
279
|
+
|
|
280
|
+
// src/rules/gap.ts
|
|
281
|
+
import { handler as h4 } from "@unocss/core";
|
|
282
|
+
var gaps = [
|
|
283
|
+
[/^(?:flex-|grid-)?gap-([^-]+)$/, ([, s]) => {
|
|
284
|
+
const v = h4.bracket.size(s);
|
|
285
|
+
if (v != null) {
|
|
286
|
+
return {
|
|
287
|
+
"grid-gap": v,
|
|
288
|
+
"gap": v
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
}],
|
|
292
|
+
[/^(?:flex-|grid-)?gap-x-([^-]+)$/, ([, s]) => {
|
|
293
|
+
const v = h4.bracket.size(s);
|
|
294
|
+
if (v != null) {
|
|
295
|
+
return {
|
|
296
|
+
"grid-column-gap": v,
|
|
297
|
+
"column-gap": v
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
}],
|
|
301
|
+
[/^(?:flex-|grid-)?gap-y-([^-]+)$/, ([, s]) => {
|
|
302
|
+
const v = h4.bracket.size(s);
|
|
303
|
+
if (v != null) {
|
|
304
|
+
return {
|
|
305
|
+
"grid-row-gap": v,
|
|
306
|
+
"row-gap": v
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
}]
|
|
310
|
+
];
|
|
311
|
+
|
|
312
|
+
// src/rules/grid.ts
|
|
313
|
+
var grids = [
|
|
314
|
+
["grid", { display: "grid" }],
|
|
315
|
+
["inline-grid", { display: "inline-grid" }],
|
|
316
|
+
[/^grid-cols-(\d+)$/, ([, d]) => ({ "grid-template-columns": `repeat(${d}, minmax(0, 1fr))` })],
|
|
317
|
+
[/^grid-rows-(\d+)$/, ([, d]) => ({ "grid-template-rows": `repeat(${d}, minmax(0, 1fr))` })],
|
|
318
|
+
[/^grid-cols-\[(.+)\]$/, ([, v]) => ({ "grid-template-columns": v.replace(/,/g, " ") })],
|
|
319
|
+
[/^grid-rows-\[(.+)\]$/, ([, v]) => ({ "grid-template-rows": v.replace(/,/g, " ") })]
|
|
320
|
+
];
|
|
321
|
+
|
|
322
|
+
// src/rules/layouts.ts
|
|
323
|
+
var overflowValues = [
|
|
324
|
+
"auto",
|
|
325
|
+
"hidden",
|
|
326
|
+
"visible",
|
|
327
|
+
"scroll"
|
|
328
|
+
];
|
|
329
|
+
var overflows = [
|
|
330
|
+
[/^overflow-(.+)$/, ([, v]) => overflowValues.includes(v) ? { overflow: v } : void 0],
|
|
331
|
+
[/^overflow-([xy])-(.+)$/, ([, d, v]) => overflowValues.includes(v) ? { [`overflow-${d}`]: v } : void 0]
|
|
332
|
+
];
|
|
333
|
+
|
|
334
|
+
// src/rules/positions.ts
|
|
335
|
+
import { handler as h5 } from "@unocss/core";
|
|
336
|
+
var positions = [
|
|
337
|
+
["relative", { position: "relative" }],
|
|
338
|
+
["absolute", { position: "absolute" }],
|
|
339
|
+
["fixed", { position: "fixed" }]
|
|
340
|
+
];
|
|
341
|
+
var justifies = [
|
|
342
|
+
["justify-start", { "justify-content": "flex-start" }],
|
|
343
|
+
["justify-end", { "justify-content": "flex-end" }],
|
|
344
|
+
["justify-center", { "justify-content": "center" }],
|
|
345
|
+
["justify-between", { "justify-content": "space-between" }],
|
|
346
|
+
["justify-around", { "justify-content": "space-around" }],
|
|
347
|
+
["justify-evenly", { "justify-content": "space-evenly" }]
|
|
348
|
+
];
|
|
349
|
+
var orders = [
|
|
350
|
+
[/^order-(.+)$/, ([, v]) => ({ order: { first: "-9999", last: "9999", none: "0" }[v] || h5.bracket.number(v) })]
|
|
351
|
+
];
|
|
352
|
+
var basicSet = ["auto", "start", "end", "center", "stretch"];
|
|
353
|
+
var justifyItems = basicSet.map((i) => [`justify-items-${i}`, { "justify-items": i }]);
|
|
354
|
+
var justifySelfs = basicSet.map((i) => [`justify-self-${i}`, { "justify-self": i }]);
|
|
355
|
+
var alignContents = [
|
|
356
|
+
["content-start", { "align-content": "flex-start" }],
|
|
357
|
+
["content-end", { "align-content": "flex-end" }],
|
|
358
|
+
["content-center", { "align-content": "center" }],
|
|
359
|
+
["content-between", { "align-content": "space-between" }],
|
|
360
|
+
["content-around", { "align-content": "space-around" }],
|
|
361
|
+
["content-evenly", { "align-content": "space-evenly" }]
|
|
362
|
+
];
|
|
363
|
+
var alignItems = [
|
|
364
|
+
["items-start", { "align-items": "flex-start" }],
|
|
365
|
+
["items-end", { "align-items": "flex-end" }],
|
|
366
|
+
["items-center", { "align-items": "center" }],
|
|
367
|
+
["items-baseline", { "align-items": "baseline" }],
|
|
368
|
+
["items-stretch", { "align-items": "stretch" }]
|
|
369
|
+
];
|
|
370
|
+
var alignSelfs = [
|
|
371
|
+
["self-auto", { "align-self": "auto" }],
|
|
372
|
+
["self-start", { "align-self": "flex-start" }],
|
|
373
|
+
["self-end", { "align-self": "flex-end" }],
|
|
374
|
+
["self-center", { "align-self": "center" }],
|
|
375
|
+
["self-stretch", { "align-items": "stretch" }]
|
|
376
|
+
];
|
|
377
|
+
var placeContents = [
|
|
378
|
+
["place-content-start", { "place-content": "start" }],
|
|
379
|
+
["place-content-end", { "place-content": "end" }],
|
|
380
|
+
["place-content-center", { "place-content": "center" }],
|
|
381
|
+
["place-content-between", { "place-content": "space-between" }],
|
|
382
|
+
["place-content-around", { "place-content": "space-around" }],
|
|
383
|
+
["place-content-evenly", { "place-content": "space-evenly" }],
|
|
384
|
+
["place-content-stretch", { "place-content": "stretch" }]
|
|
385
|
+
];
|
|
386
|
+
var placeItems = basicSet.map((i) => [`place-items-${i}`, { "place-items": i }]);
|
|
387
|
+
var placeSelfs = basicSet.map((i) => [`place-self-${i}`, { "place-self": i }]);
|
|
388
|
+
function handleInsetValue(v) {
|
|
389
|
+
var _a;
|
|
390
|
+
return (_a = { auto: "auto", full: "100%" }[v]) != null ? _a : h5.bracket.fraction.size(v);
|
|
391
|
+
}
|
|
392
|
+
var insets = [
|
|
393
|
+
[/^inset-(x|y)-(.+)$/, ([, d, v]) => {
|
|
394
|
+
const r = handleInsetValue(v);
|
|
395
|
+
if (r != null)
|
|
396
|
+
return directionMap[d].map((i) => [i.slice(1), r]);
|
|
397
|
+
}],
|
|
398
|
+
[/^(top|left|right|bottom|inset)-(.+)$/, ([, d, v]) => ({ [d]: handleInsetValue(v) })]
|
|
399
|
+
];
|
|
400
|
+
var floats = [
|
|
401
|
+
[/^float-(left|right|none)$/, ([, value]) => ({ float: value })],
|
|
402
|
+
[/^clear-(left|right|both|none)$/, ([, value]) => ({ clear: value })]
|
|
403
|
+
];
|
|
404
|
+
var zIndexes = [
|
|
405
|
+
["z-auto", { "z-index": "auto" }],
|
|
406
|
+
[/^z-([^-]+)$/, ([, v]) => ({ "z-index": h5.number(v) })]
|
|
407
|
+
];
|
|
408
|
+
var objectPositions = [
|
|
409
|
+
["object-cover", { "object-fit": "cover" }],
|
|
410
|
+
["object-contain", { "object-fit": "contain" }],
|
|
411
|
+
["object-fill", { "object-fit": "fill" }],
|
|
412
|
+
["object-scale-down", { "object-fit": "scale-down" }],
|
|
413
|
+
["object-none", { "object-fit": "none" }],
|
|
414
|
+
["object-bottom", { "object-position": "bottom" }],
|
|
415
|
+
["object-top", { "object-position": "top" }],
|
|
416
|
+
["object-right", { "object-position": "right" }],
|
|
417
|
+
["object-left", { "object-position": "left" }],
|
|
418
|
+
["object-lb", { "object-position": "left bottom" }],
|
|
419
|
+
["object-lt", { "object-position": "left top" }],
|
|
420
|
+
["object-rb", { "object-position": "right bottom" }],
|
|
421
|
+
["object-rt", { "object-position": "right top" }]
|
|
422
|
+
];
|
|
423
|
+
|
|
424
|
+
// src/rules/size.ts
|
|
425
|
+
import { handler as h6 } from "@unocss/core";
|
|
426
|
+
var sizes = [
|
|
427
|
+
["w-full", { width: "100%" }],
|
|
428
|
+
["h-full", { height: "100%" }],
|
|
429
|
+
["w-screen", { width: "100vw" }],
|
|
430
|
+
["h-screen", { height: "100vh" }],
|
|
431
|
+
[/^w-([^-]+)$/, ([, s]) => ({ width: h6.bracket.fraction.size(s) })],
|
|
432
|
+
[/^h-([^-]+)$/, ([, s]) => ({ height: h6.bracket.fraction.size(s) })],
|
|
433
|
+
[/^max-w-([^-]+)$/, ([, s]) => ({ "max-width": h6.bracket.fraction.size(s) })],
|
|
434
|
+
[/^max-h-([^-]+)$/, ([, s]) => ({ "max-height": h6.bracket.fraction.size(s) })]
|
|
435
|
+
];
|
|
436
|
+
|
|
437
|
+
// src/rules/spacing.ts
|
|
438
|
+
import { handler as h7 } from "@unocss/core";
|
|
439
|
+
var directionSize = (prefix) => ([_, direction, size]) => {
|
|
440
|
+
const v = h7.bracket.size.fraction(size);
|
|
441
|
+
if (v)
|
|
442
|
+
return directionMap[direction].map((i) => [prefix + i, v]);
|
|
443
|
+
};
|
|
444
|
+
var paddings = [
|
|
445
|
+
[/^pa?()-?(-?[^-]+)$/, directionSize("padding")],
|
|
446
|
+
[/^p-?([xy])-?(-?[^-]+)$/, directionSize("padding")],
|
|
447
|
+
[/^p-?([rltbse])-?(-?[^-]+)$/, directionSize("padding")]
|
|
448
|
+
];
|
|
449
|
+
var margins = [
|
|
450
|
+
[/^ma?()-?(-?[^-]+)$/, directionSize("margin")],
|
|
451
|
+
[/^m-?([xy])-?(-?[^-]+)$/, directionSize("margin")],
|
|
452
|
+
[/^m-?([rltbse])-?(-?[^-]+)$/, directionSize("margin")]
|
|
453
|
+
];
|
|
454
|
+
|
|
455
|
+
// src/rules/static.ts
|
|
456
|
+
var displays = [
|
|
457
|
+
["inline", { display: "inline" }],
|
|
458
|
+
["block", { display: "block" }],
|
|
459
|
+
["inline-block", { display: "inline-block" }],
|
|
460
|
+
["table", { display: "table" }],
|
|
461
|
+
["contents", { display: "contents" }],
|
|
462
|
+
["flow-root", { display: "flow-root" }],
|
|
463
|
+
["list-item", { display: "list-item" }],
|
|
464
|
+
["hidden", { display: "none" }]
|
|
465
|
+
];
|
|
466
|
+
var appearances = [
|
|
467
|
+
["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }],
|
|
468
|
+
["appearance-none", { appearance: "none" }],
|
|
469
|
+
["visible", { visibility: "visible" }],
|
|
470
|
+
["invisible", { visibility: "hidden" }],
|
|
471
|
+
["backface-visible", { "backface-visibility": "visible" }],
|
|
472
|
+
["backface-hidden", { "backface-visibility": "hidden" }]
|
|
473
|
+
];
|
|
474
|
+
var cursors = [
|
|
475
|
+
[/^cursor-(.+)$/, ([, c]) => ({ cursor: c })]
|
|
476
|
+
];
|
|
477
|
+
var pointerEvents = [
|
|
478
|
+
["pointer-events-none", { "pointer-events": "none" }],
|
|
479
|
+
["pointer-events-auto", { "pointer-events": "auto" }]
|
|
480
|
+
];
|
|
481
|
+
var resizes = [
|
|
482
|
+
["resize-none", { resize: "none" }],
|
|
483
|
+
["resize-x", { resize: "horizontal" }],
|
|
484
|
+
["resize-y", { resize: "vertical" }],
|
|
485
|
+
["resize", { resize: "both" }]
|
|
486
|
+
];
|
|
487
|
+
var userSelects = [
|
|
488
|
+
["select-none", { "user-select": "none" }],
|
|
489
|
+
["select-text", { "user-select": "text" }],
|
|
490
|
+
["select-all", { "user-select": "all" }],
|
|
491
|
+
["select-auto", { "user-select": "auto" }]
|
|
492
|
+
];
|
|
493
|
+
var verticalAligns = [
|
|
494
|
+
["vertical-baseline", { "vertical-align": "baseline" }],
|
|
495
|
+
["vertical-top", { "vertical-align": "top" }],
|
|
496
|
+
["vertical-middle", { "vertical-align": "middle" }],
|
|
497
|
+
["vertical-text-top", { "vertical-align": "text-top" }],
|
|
498
|
+
["vertical-text-bottom", { "vertical-align": "text-bottom" }]
|
|
499
|
+
];
|
|
500
|
+
var whitespaces = [
|
|
501
|
+
["whitespace-normal", { "white-space": "normal" }],
|
|
502
|
+
["whitespace-nowrap", { "white-space": "nowrap" }],
|
|
503
|
+
["whitespace-pre", { "white-space": "pre" }],
|
|
504
|
+
["whitespace-pre-line", { "white-space": "pre-line" }],
|
|
505
|
+
["whitespace-pre-wrap", { "white-space": "pre-wrap" }]
|
|
506
|
+
];
|
|
507
|
+
var breaks = [
|
|
508
|
+
["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }],
|
|
509
|
+
["break-works", { "overflow-wrap": "break-word" }],
|
|
510
|
+
["break-all", { "word-break": "break-all" }]
|
|
511
|
+
];
|
|
512
|
+
var textOverflows = [
|
|
513
|
+
["truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
|
|
514
|
+
["text-ellipsis", { "text-overflow": "ellipsis" }],
|
|
515
|
+
["text-clip", { "text-overflow": "clip" }]
|
|
516
|
+
];
|
|
517
|
+
var textTransforms = [
|
|
518
|
+
["case-upper", { "text-transform": "uppercase" }],
|
|
519
|
+
["case-lower", { "text-transform": "lowercase" }],
|
|
520
|
+
["case-capital", { "text-transform": "capitalize" }],
|
|
521
|
+
["case-normal", { "text-transform": "none" }]
|
|
522
|
+
];
|
|
523
|
+
var textDecorations = [
|
|
524
|
+
["underline", { "text-decoration": "underline" }],
|
|
525
|
+
["line-through", { "text-decoration": "line-through" }],
|
|
526
|
+
["no-underline", { "text-decoration": "none" }]
|
|
527
|
+
];
|
|
528
|
+
var textAligns = [
|
|
529
|
+
["text-center", { "text-align": "center" }],
|
|
530
|
+
["text-left", { "text-align": "left" }],
|
|
531
|
+
["text-right", { "text-align": "right" }],
|
|
532
|
+
["text-justify", { "text-align": "justify" }]
|
|
533
|
+
];
|
|
534
|
+
|
|
535
|
+
// ../unocss/src/index.ts
|
|
536
|
+
var src_exports = {};
|
|
537
|
+
__export(src_exports, {
|
|
538
|
+
presetAttributify: () => src_default2,
|
|
539
|
+
presetUno: () => src_default
|
|
540
|
+
});
|
|
541
|
+
__reExport(src_exports, core_star);
|
|
542
|
+
import * as core_star from "@unocss/core";
|
|
543
|
+
|
|
544
|
+
// src/index.ts
|
|
545
|
+
var preset = () => ({
|
|
546
|
+
theme,
|
|
547
|
+
rules,
|
|
548
|
+
variants
|
|
549
|
+
});
|
|
550
|
+
var src_default = preset;
|
|
551
|
+
|
|
552
|
+
// ../preset-attributify/src/index.ts
|
|
553
|
+
import { extractorSplit } from "@unocss/core";
|
|
554
|
+
|
|
555
|
+
// ../preset-attributify/src/extractor.ts
|
|
556
|
+
import { isValidSelector } from "@unocss/core";
|
|
557
|
+
var strippedPrefixes = [
|
|
558
|
+
"v-bind:",
|
|
559
|
+
":"
|
|
560
|
+
];
|
|
561
|
+
var splitterRE = /[\s'"`;]+/g;
|
|
562
|
+
var elementRE = /<[\w:\.$-]+\s((?:'[\s\S]*?'|"[\s\S]*?"|`[\s\S]*?`|\{[\s\S]*?\}|[\s\S]*?)*?)>/g;
|
|
563
|
+
var valuedAttributeRE = /([\w:-]+)(?:=(["'])([^\2]+?)\2)?/g;
|
|
564
|
+
var extractorAttributify = (options) => (code) => {
|
|
565
|
+
const result = Array.from(code.matchAll(elementRE)).flatMap((match) => Array.from((match[1] || "").matchAll(valuedAttributeRE))).flatMap(([, name, _, content]) => {
|
|
566
|
+
for (const prefix of strippedPrefixes) {
|
|
567
|
+
if (name.startsWith(prefix)) {
|
|
568
|
+
name = name.slice(prefix.length);
|
|
569
|
+
break;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
if (!content) {
|
|
573
|
+
if (isValidSelector(name) && (options == null ? void 0 : options.nonValuedAttribute) !== false)
|
|
574
|
+
return [`[${name}=""]`];
|
|
575
|
+
return [];
|
|
576
|
+
}
|
|
577
|
+
if (["class", "className"].includes(name)) {
|
|
578
|
+
return content.split(splitterRE).filter(isValidSelector);
|
|
579
|
+
} else {
|
|
580
|
+
return content.split(splitterRE).filter(Boolean).map((v) => `[${name}~="${v}"]`);
|
|
581
|
+
}
|
|
582
|
+
});
|
|
583
|
+
return new Set(result);
|
|
584
|
+
};
|
|
585
|
+
|
|
586
|
+
// ../preset-attributify/src/variant.ts
|
|
587
|
+
import { isAttributifySelector } from "@unocss/core";
|
|
588
|
+
var variantsRE = /^(.+\:\!?)?(.*?)$/;
|
|
589
|
+
var variantAttributify = (options = {}) => {
|
|
590
|
+
var _a;
|
|
591
|
+
const prefix = (_a = options.prefix) != null ? _a : "un-";
|
|
592
|
+
return {
|
|
593
|
+
match(input) {
|
|
594
|
+
const match = isAttributifySelector(input);
|
|
595
|
+
if (!match)
|
|
596
|
+
return;
|
|
597
|
+
let name = match[1];
|
|
598
|
+
if (name.startsWith(prefix))
|
|
599
|
+
name = name.slice(prefix.length);
|
|
600
|
+
else if (options.prefixedOnly)
|
|
601
|
+
return;
|
|
602
|
+
const content = match[2];
|
|
603
|
+
const [, variants2 = "", body = content] = content.match(variantsRE) || [];
|
|
604
|
+
if (body === "~" || !body)
|
|
605
|
+
return `${variants2}${name}`;
|
|
606
|
+
else
|
|
607
|
+
return `${variants2}${name}-${body}`;
|
|
608
|
+
}
|
|
609
|
+
};
|
|
610
|
+
};
|
|
611
|
+
|
|
612
|
+
// ../preset-attributify/src/index.ts
|
|
613
|
+
var preset2 = (options) => {
|
|
614
|
+
const variants2 = [
|
|
615
|
+
variantAttributify(options)
|
|
616
|
+
];
|
|
617
|
+
const extractors = [
|
|
618
|
+
extractorAttributify(options)
|
|
619
|
+
];
|
|
620
|
+
if (!(options == null ? void 0 : options.strict))
|
|
621
|
+
extractors.unshift(extractorSplit);
|
|
622
|
+
return {
|
|
623
|
+
variants: variants2,
|
|
624
|
+
extractors
|
|
625
|
+
};
|
|
626
|
+
};
|
|
627
|
+
var src_default2 = preset2;
|
|
628
|
+
|
|
629
|
+
// src/rules/transform.ts
|
|
630
|
+
var transforms = [
|
|
631
|
+
[
|
|
632
|
+
"transform",
|
|
633
|
+
{
|
|
634
|
+
"--un-rotate": 0,
|
|
635
|
+
"--un-scale-x": 1,
|
|
636
|
+
"--un-scale-y": 1,
|
|
637
|
+
"--un-scale-z": 1,
|
|
638
|
+
"--un-skew-x": 0,
|
|
639
|
+
"--un-skew-y": 0,
|
|
640
|
+
"--un-translate-x": 0,
|
|
641
|
+
"--un-translate-y": 0,
|
|
642
|
+
"--un-translate-z": 0,
|
|
643
|
+
"transform": "rotate(var(--un-rotate)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z))"
|
|
644
|
+
}
|
|
645
|
+
],
|
|
646
|
+
[/^translate()-([^-]+)$/, handleTranslate],
|
|
647
|
+
[/^translate-([xyz])-([^-]+)$/, handleTranslate],
|
|
648
|
+
[/^scale()-([^-]+)$/, handleScale],
|
|
649
|
+
[/^scale-([xyz])-([^-]+)$/, handleScale],
|
|
650
|
+
[/^rotate-([^-]+)(?:deg)?$/, handleRotate],
|
|
651
|
+
["origin-center", { "transform-origin": "center" }],
|
|
652
|
+
["origin-top", { "transform-origin": "top" }],
|
|
653
|
+
["origin-top-right", { "transform-origin": "top right" }],
|
|
654
|
+
["origin-right", { "transform-origin": "right" }],
|
|
655
|
+
["origin-bottom-right", { "transform-origin": "bottom right" }],
|
|
656
|
+
["origin-bottom", { "transform-origin": "bottom" }],
|
|
657
|
+
["origin-bottom-left", { "transform-origin": "bottom left" }],
|
|
658
|
+
["origin-left", { "transform-origin": "left" }],
|
|
659
|
+
["origin-top-left", { "transform-origin": "top left" }]
|
|
660
|
+
];
|
|
661
|
+
function handleTranslate([, d, b]) {
|
|
662
|
+
const v = src_exports.handler.bracket.size(b);
|
|
663
|
+
if (v != null) {
|
|
664
|
+
return [
|
|
665
|
+
...xyzMap[d].map((i) => [`--un-translate${i}`, v])
|
|
666
|
+
];
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
function handleScale([, d, b]) {
|
|
670
|
+
const v = src_exports.handler.bracket.fraction.percent(b);
|
|
671
|
+
if (v != null) {
|
|
672
|
+
return [
|
|
673
|
+
...xyzMap[d].map((i) => [`--un-scale${i}`, v])
|
|
674
|
+
];
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
function handleRotate([, b]) {
|
|
678
|
+
const v = src_exports.handler.bracket.number(b);
|
|
679
|
+
if (v != null)
|
|
680
|
+
return { "--un-rotate": `${v}deg` };
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
// src/rules/index.ts
|
|
684
|
+
var rules = [
|
|
685
|
+
paddings,
|
|
686
|
+
margins,
|
|
687
|
+
displays,
|
|
688
|
+
opacity,
|
|
689
|
+
bgColors,
|
|
690
|
+
borders,
|
|
691
|
+
borderColors,
|
|
692
|
+
borderStyles,
|
|
693
|
+
borderRadius,
|
|
694
|
+
fonts,
|
|
695
|
+
fontSizes,
|
|
696
|
+
fontWeights,
|
|
697
|
+
textOverflows,
|
|
698
|
+
textDecorations,
|
|
699
|
+
textTransforms,
|
|
700
|
+
textAligns,
|
|
701
|
+
textColors,
|
|
702
|
+
flex,
|
|
703
|
+
grids,
|
|
704
|
+
gaps,
|
|
705
|
+
positions,
|
|
706
|
+
sizes,
|
|
707
|
+
cursors,
|
|
708
|
+
appearances,
|
|
709
|
+
pointerEvents,
|
|
710
|
+
resizes,
|
|
711
|
+
verticalAligns,
|
|
712
|
+
userSelects,
|
|
713
|
+
whitespaces,
|
|
714
|
+
breaks,
|
|
715
|
+
trackings,
|
|
716
|
+
leadings,
|
|
717
|
+
overflows,
|
|
718
|
+
positions,
|
|
719
|
+
orders,
|
|
720
|
+
justifies,
|
|
721
|
+
justifyItems,
|
|
722
|
+
justifySelfs,
|
|
723
|
+
alignContents,
|
|
724
|
+
alignItems,
|
|
725
|
+
alignSelfs,
|
|
726
|
+
placeContents,
|
|
727
|
+
placeItems,
|
|
728
|
+
placeSelfs,
|
|
729
|
+
insets,
|
|
730
|
+
floats,
|
|
731
|
+
zIndexes,
|
|
732
|
+
objectPositions,
|
|
733
|
+
transitions,
|
|
734
|
+
filters,
|
|
735
|
+
transforms
|
|
736
|
+
].flat(1);
|
|
737
|
+
|
|
738
|
+
export {
|
|
739
|
+
rules,
|
|
740
|
+
preset,
|
|
741
|
+
src_default
|
|
742
|
+
};
|