@unocss/preset-mini 0.20.2 → 0.21.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/chunks/default.cjs +8 -10
- package/dist/chunks/default.mjs +8 -10
- package/dist/chunks/default2.cjs +172 -163
- package/dist/chunks/default2.mjs +173 -164
- package/dist/chunks/default3.cjs +14 -32
- package/dist/chunks/default3.mjs +15 -32
- package/dist/chunks/pseudo.cjs +21 -16
- package/dist/chunks/pseudo.mjs +21 -16
- package/dist/chunks/utilities.cjs +67 -34
- package/dist/chunks/utilities.mjs +67 -35
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/theme.d.ts +0 -10
- package/dist/utils.cjs +1 -0
- package/dist/utils.d.ts +8 -4
- package/dist/utils.mjs +1 -1
- package/dist/variants.cjs +0 -1
- package/dist/variants.d.ts +7 -5
- package/dist/variants.mjs +1 -1
- package/package.json +2 -2
package/dist/chunks/default2.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as handler, c as colorResolver, d as directionMap, p as parseColor, a as cornerMap, b as capitalize, e as directionSize, x as xyzMap } from './utilities.mjs';
|
|
1
|
+
import { h as handler, c as colorResolver, d as directionMap, p as parseColor, a as cornerMap, b as capitalize, e as directionSize, f as positionMap, x as xyzMap } from './utilities.mjs';
|
|
2
2
|
import { toArray } from '@unocss/core';
|
|
3
3
|
import { C as CONTROL_BYPASS_PSEUDO_CLASS } from './pseudo.mjs';
|
|
4
4
|
|
|
@@ -8,7 +8,7 @@ const verticalAlignAlias = {
|
|
|
8
8
|
btm: "bottom"
|
|
9
9
|
};
|
|
10
10
|
const verticalAligns = [
|
|
11
|
-
[/^(?:vertical|align|v)-(baseline|top|bottom|
|
|
11
|
+
[/^(?:vertical|align|v)-(baseline|top|middle|bottom|text-top|text-bottom|sub|super|mid|base|btm)$/, ([, v]) => ({ "vertical-align": verticalAlignAlias[v] || v })]
|
|
12
12
|
];
|
|
13
13
|
const textAligns = [
|
|
14
14
|
["text-center", { "text-align": "center" }],
|
|
@@ -22,7 +22,7 @@ const outline = [
|
|
|
22
22
|
[/^outline-(?:color-)?(.+)$/, colorResolver("outline-color", "outline-color")],
|
|
23
23
|
[/^outline-offset-(.+)$/, ([, d]) => ({ "outline-offset": handler.bracket.fraction.auto.rem(d) })],
|
|
24
24
|
["outline", { "outline-style": "solid" }],
|
|
25
|
-
[/^outline-(auto|dotted|
|
|
25
|
+
[/^outline-(auto|dashed|dotted|double|hidden|solid|groove|ridge|inset|outset|inherit|initial|revert|unset)$/, ([, c]) => ({ "outline-style": c })],
|
|
26
26
|
["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }]
|
|
27
27
|
];
|
|
28
28
|
const appearance = [
|
|
@@ -32,31 +32,31 @@ const appearance = [
|
|
|
32
32
|
}]
|
|
33
33
|
];
|
|
34
34
|
const willChange = [
|
|
35
|
-
[/^will-change-(.+)/, ([, p]) => ({ "will-change": handler.properties.global(p) })]
|
|
35
|
+
[/^will-change-(.+)/, ([, p]) => ({ "will-change": handler.properties.auto.global(p) })]
|
|
36
36
|
];
|
|
37
37
|
|
|
38
38
|
const borders = [
|
|
39
|
-
[/^border
|
|
40
|
-
[/^(?:border|b)()
|
|
41
|
-
[/^(?:border|b)-([
|
|
42
|
-
[/^(?:border|b)()
|
|
43
|
-
[/^(?:border|b)-([
|
|
44
|
-
[/^(?:border|b)()-(.+)$/,
|
|
45
|
-
[/^(?:border|b)-(
|
|
46
|
-
[/^(?:border|b)-
|
|
47
|
-
[/^(?:border|b)-([
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
[/^(?:border-)?(?:rounded|rd)
|
|
54
|
-
[/^(?:border-)?(?:rounded|rd)(?:-(.+))?$/, handlerRounded],
|
|
55
|
-
[/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?(?:-(.+))?$/, handlerRounded],
|
|
39
|
+
[/^(?:border|b)()(?:-(.+))?$/, handlerBorder],
|
|
40
|
+
[/^(?:border|b)-([xy])(?:-(.+))?$/, handlerBorder],
|
|
41
|
+
[/^(?:border|b)-([rltbse])(?:-(.+))?$/, handlerBorder],
|
|
42
|
+
[/^(?:border|b)-()size-(.+)$/, handlerBorderSize],
|
|
43
|
+
[/^(?:border|b)-([xy])-size-(.+)$/, handlerBorderSize],
|
|
44
|
+
[/^(?:border|b)-([rltbse])-size-(.+)$/, handlerBorderSize],
|
|
45
|
+
[/^(?:border|b)-()(?:color-)?(.+)$/, handlerBorderColor],
|
|
46
|
+
[/^(?:border|b)-([xy])-(?:color-)?(.+)$/, handlerBorderColor],
|
|
47
|
+
[/^(?:border|b)-([rltbse])-(?:color-)?(.+)$/, handlerBorderColor],
|
|
48
|
+
[/^(?:border|b)-()op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
49
|
+
[/^(?:border|b)-([xy])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
50
|
+
[/^(?:border|b)-([rltbse])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
51
|
+
[/^(?:border-)?(?:rounded|rd)()(?:-(.+))?$/, handlerRounded],
|
|
52
|
+
[/^(?:border-)?(?:rounded|rd)-([xy])(?:-(.+))?$/, handlerRounded],
|
|
53
|
+
[/^(?:border-)?(?:rounded|rd)-([rltb])(?:-(.+))?$/, handlerRounded],
|
|
54
|
+
[/^(?:border-)?(?:rounded|rd)-([rltb]{2})(?:-(.+))?$/, handlerRounded],
|
|
56
55
|
["border-solid", { "border-style": "solid" }],
|
|
57
56
|
["border-dashed", { "border-style": "dashed" }],
|
|
58
57
|
["border-dotted", { "border-style": "dotted" }],
|
|
59
58
|
["border-double", { "border-style": "double" }],
|
|
59
|
+
["border-hidden", { "border-style": "hidden" }],
|
|
60
60
|
["border-none", { "border-style": "none" }]
|
|
61
61
|
];
|
|
62
62
|
const borderHasColor = (color, { theme }) => {
|
|
@@ -103,22 +103,25 @@ function handlerBorder(m) {
|
|
|
103
103
|
];
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
function handlerBorderSize([, a, b]) {
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return directionMap[d].map((i) => [`border${i}-width`, v]);
|
|
106
|
+
function handlerBorderSize([, a = "", b = "1"]) {
|
|
107
|
+
const v = handler.bracket.px(b);
|
|
108
|
+
if (a in directionMap && v != null)
|
|
109
|
+
return directionMap[a].map((i) => [`border${i}-width`, v]);
|
|
111
110
|
}
|
|
112
|
-
function handlerBorderColor([, a, c], ctx) {
|
|
113
|
-
if (borderHasColor(c, ctx)) {
|
|
114
|
-
return Object.assign({}, ...directionMap[
|
|
111
|
+
function handlerBorderColor([, a = "", c], ctx) {
|
|
112
|
+
if (a in directionMap && borderHasColor(c, ctx)) {
|
|
113
|
+
return Object.assign({}, ...directionMap[a].map((i) => borderColorResolver(i)(["", c], ctx)));
|
|
115
114
|
}
|
|
116
115
|
}
|
|
117
|
-
function
|
|
118
|
-
const
|
|
116
|
+
function handlerBorderOpacity([, a = "", opacity]) {
|
|
117
|
+
const v = handler.bracket.percent(opacity);
|
|
118
|
+
if (a in directionMap && v != null)
|
|
119
|
+
return directionMap[a].map((i) => [`--un-border${i}-opacity`, v]);
|
|
120
|
+
}
|
|
121
|
+
function handlerRounded([, a = "", s = "DEFAULT"], { theme }) {
|
|
119
122
|
const v = theme.borderRadius?.[s] || handler.auto.rem.fraction.bracket.cssvar(s);
|
|
120
|
-
if (v
|
|
121
|
-
return cornerMap[
|
|
123
|
+
if (a in cornerMap && v != null)
|
|
124
|
+
return cornerMap[a].map((i) => [`border${i}-radius`, v]);
|
|
122
125
|
}
|
|
123
126
|
|
|
124
127
|
const opacity = [
|
|
@@ -133,12 +136,19 @@ const bgColors = [
|
|
|
133
136
|
[/^bg-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-bg-opacity": handler.bracket.percent(opacity2) })]
|
|
134
137
|
];
|
|
135
138
|
|
|
139
|
+
const transitionPropertyGroup = {
|
|
140
|
+
all: "all",
|
|
141
|
+
colors: ["color", "background-color", "border-color", "text-decoration-color", "fill", "stroke"].join(","),
|
|
142
|
+
opacity: "opacity",
|
|
143
|
+
shadow: "box-shadow",
|
|
144
|
+
transform: "transform"
|
|
145
|
+
};
|
|
136
146
|
const transitionProperty = (prop) => {
|
|
137
|
-
return handler.properties(prop)
|
|
147
|
+
return handler.properties(prop) ?? transitionPropertyGroup[prop];
|
|
138
148
|
};
|
|
139
149
|
const transitions = [
|
|
140
|
-
[/^transition(?:-([a-z-]+(?:,[a-z-]+)*))?(?:-(\d+))?$/, ([, prop
|
|
141
|
-
const p = transitionProperty(prop);
|
|
150
|
+
[/^transition(?:-([a-z-]+(?:,[a-z-]+)*))?(?:-(\d+))?$/, ([, prop, duration = "150"]) => {
|
|
151
|
+
const p = prop != null ? transitionProperty(prop) : [transitionPropertyGroup.colors, "opacity", "box-shadow", "transform", "filter", "backdrop-filter"].join(",");
|
|
142
152
|
if (p) {
|
|
143
153
|
return {
|
|
144
154
|
"transition-property": p,
|
|
@@ -147,14 +157,14 @@ const transitions = [
|
|
|
147
157
|
};
|
|
148
158
|
}
|
|
149
159
|
}],
|
|
150
|
-
[/^
|
|
160
|
+
[/^(?:transition-)?delay-(.+)(?:s|ms)?$/, ([, d]) => ({ "transition-delay": handler.bracket.time(d) })],
|
|
161
|
+
[/^(?:transition-)?duration-(.+)(?:s|ms)?$/, ([, d]) => ({ "transition-duration": handler.bracket.time(d) })],
|
|
162
|
+
[/^ease-(.+)$/, ([, d]) => ({ "transition-timing-function": handler.bracket(d) })],
|
|
151
163
|
["ease", { "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)" }],
|
|
152
164
|
["ease-linear", { "transition-timing-function": "linear" }],
|
|
153
165
|
["ease-in", { "transition-timing-function": "cubic-bezier(0.4, 0, 1, 1)" }],
|
|
154
166
|
["ease-out", { "transition-timing-function": "cubic-bezier(0, 0, 0.2, 1)" }],
|
|
155
167
|
["ease-in-out", { "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)" }],
|
|
156
|
-
[/^transition-delay-(\d+)$/, ([, v]) => ({ "transition-delay": `${v}ms` })],
|
|
157
|
-
[/^transition-duration-(\d+)$/, ([, v]) => ({ "transition-duration": `${v}ms` })],
|
|
158
168
|
[/^(?:transition-)?property-(.+)$/, ([, v]) => ({ "transition-property": handler.global(v) || transitionProperty(v) })],
|
|
159
169
|
["transition-property-none", { "transition-property": "none" }],
|
|
160
170
|
["property-none", { "transition-property": "none" }],
|
|
@@ -170,10 +180,11 @@ const flex = [
|
|
|
170
180
|
["flex-initial", { flex: "0 1 auto" }],
|
|
171
181
|
["flex-none", { flex: "none" }],
|
|
172
182
|
[/^flex-(\[.+\])$/, ([, d]) => ({ flex: handler.bracket(d).replace(/\d+\/\d+/, ($1) => handler.fraction($1)) })],
|
|
173
|
-
[
|
|
174
|
-
[
|
|
175
|
-
[
|
|
176
|
-
[
|
|
183
|
+
[/^(?:flex-)?shrink$/, () => ({ "flex-shrink": 1 })],
|
|
184
|
+
[/^(?:flex-)?shrink-0$/, () => ({ "flex-shrink": 0 })],
|
|
185
|
+
[/^(?:flex-)?grow$/, () => ({ "flex-grow": 1 })],
|
|
186
|
+
[/^(?:flex-)?grow-0$/, () => ({ "flex-grow": 0 })],
|
|
187
|
+
[/^(?:flex-)?basis-(.+)$/, ([, d]) => ({ "flex-basis": handler.bracket.fraction.auto.rem(d) })],
|
|
177
188
|
["flex-row", { "flex-direction": "row" }],
|
|
178
189
|
["flex-row-reverse", { "flex-direction": "row-reverse" }],
|
|
179
190
|
["flex-col", { "flex-direction": "column" }],
|
|
@@ -216,7 +227,7 @@ const fonts = [
|
|
|
216
227
|
[/^word-spacing-([^-]+)$/, ([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] || handler.bracket.auto.rem(s) })]
|
|
217
228
|
];
|
|
218
229
|
const tabSizes = [
|
|
219
|
-
[/^tab
|
|
230
|
+
[/^tab(?:-([^-]+))?$/, ([, s]) => {
|
|
220
231
|
const v = handler.bracket.global.number(s || "4");
|
|
221
232
|
if (v != null) {
|
|
222
233
|
return {
|
|
@@ -241,68 +252,64 @@ const textShadows = [
|
|
|
241
252
|
|
|
242
253
|
const directions = {
|
|
243
254
|
"": "",
|
|
244
|
-
"x
|
|
245
|
-
"y
|
|
255
|
+
"x": "column-",
|
|
256
|
+
"y": "row-"
|
|
257
|
+
};
|
|
258
|
+
const handleGap = ([, d = "", s]) => {
|
|
259
|
+
const v = handler.bracket.auto.rem(s);
|
|
260
|
+
if (v != null) {
|
|
261
|
+
return {
|
|
262
|
+
[`grid-${directions[d]}gap`]: v,
|
|
263
|
+
[`${directions[d]}gap`]: v
|
|
264
|
+
};
|
|
265
|
+
}
|
|
246
266
|
};
|
|
247
267
|
const gaps = [
|
|
248
|
-
[/^(?:flex-|grid-)?gap-(
|
|
249
|
-
|
|
250
|
-
if (v != null) {
|
|
251
|
-
return {
|
|
252
|
-
[`grid-${directions[d]}gap`]: v,
|
|
253
|
-
[`${directions[d]}gap`]: v
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
}]
|
|
268
|
+
[/^(?:flex-|grid-)?gap-()([^-]+)$/, handleGap],
|
|
269
|
+
[/^(?:flex-|grid-)?gap-([xy])-([^-]+)$/, handleGap]
|
|
257
270
|
];
|
|
258
271
|
|
|
259
|
-
const
|
|
272
|
+
const rowCol = (s) => s.replace("col", "column");
|
|
260
273
|
const autoDirection = (selector, theme) => {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
274
|
+
const v = theme.fontSize?.[selector];
|
|
275
|
+
if (v != null)
|
|
276
|
+
return toArray(v)[0];
|
|
277
|
+
switch (selector) {
|
|
278
|
+
case "min":
|
|
279
|
+
return "min-content";
|
|
280
|
+
case "max":
|
|
281
|
+
return "max-content";
|
|
282
|
+
case "fr":
|
|
283
|
+
return "minmax(0,1fr)";
|
|
284
|
+
}
|
|
285
|
+
return handler.bracket.auto.rem(selector);
|
|
268
286
|
};
|
|
269
287
|
const grids = [
|
|
270
288
|
["grid", { display: "grid" }],
|
|
271
289
|
["inline-grid", { display: "inline-grid" }],
|
|
272
|
-
[/^(?:grid-)?col-
|
|
273
|
-
[/^(?:grid-)?col-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
if (raw)
|
|
280
|
-
return { [key]: raw };
|
|
281
|
-
const parts = v.split("-");
|
|
282
|
-
if (parts.length === 1 && parts[0] === "auto")
|
|
283
|
-
return { [key]: parts[0] };
|
|
284
|
-
if (parts[0] === "span") {
|
|
285
|
-
if (parts[1] === "full")
|
|
286
|
-
return { [key]: "1/-1" };
|
|
287
|
-
raw = handler.number.bracket(parts[1]);
|
|
288
|
-
if (raw)
|
|
289
|
-
return { [key]: `span ${raw}/span ${raw}` };
|
|
290
|
-
}
|
|
290
|
+
[/^(?:grid-)?(row|col)-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}`]: handler.bracket.auto(v) })],
|
|
291
|
+
[/^(?:grid-)?(row|col)-span-(.+)$/, ([, c, s]) => {
|
|
292
|
+
if (s === "full")
|
|
293
|
+
return { [`grid-${rowCol(c)}`]: "1/-1" };
|
|
294
|
+
const v = handler.bracket.number(s);
|
|
295
|
+
if (v != null)
|
|
296
|
+
return { [`grid-${rowCol(c)}`]: `span ${v}/span ${v}` };
|
|
291
297
|
}],
|
|
292
|
-
[/^(?:grid-)?
|
|
293
|
-
[/^(?:grid-)?
|
|
294
|
-
[/^(?:grid-)?auto-rows-([\w.-]+)$/, ([, v], { theme }) => ({
|
|
295
|
-
[/^grid-
|
|
296
|
-
[/^grid-rows-(
|
|
297
|
-
[/^grid-cols-minmax-([\w.-]+)$/, ([, d]) => ({
|
|
298
|
-
[/^grid-rows-
|
|
299
|
-
[
|
|
300
|
-
[
|
|
298
|
+
[/^(?:grid-)?(row|col)-start-([\w.-]+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-start`]: v })],
|
|
299
|
+
[/^(?:grid-)?(row|col)-end-([\w.-]+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]: v })],
|
|
300
|
+
[/^(?:grid-)?auto-(rows|cols)-([\w.-]+)$/, ([, c, v], { theme }) => ({ [`grid-auto-${rowCol(c)}`]: autoDirection(v, theme) })],
|
|
301
|
+
[/^(?:grid-auto-flow|auto-flow|grid-flow)-((?:row|col)(?:-dense)?)$/, ([, v]) => ({ "grid-auto-flow": rowCol(v).replace("-", " ") })],
|
|
302
|
+
[/^grid-(rows|cols)-(\[.+\])$/, ([, c, v]) => ({ [`grid-template-${rowCol(c)}`]: handler.bracket(v) })],
|
|
303
|
+
[/^grid-(rows|cols)-minmax-([\w.-]+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(auto-fill,minmax(${d},1fr))` })],
|
|
304
|
+
[/^grid-(rows|cols)-(\d+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(${d},minmax(0,1fr))` })],
|
|
305
|
+
["grid-rows-none", { "grid-template-rows": "none" }],
|
|
306
|
+
["grid-cols-none", { "grid-template-columns": "none" }]
|
|
301
307
|
];
|
|
302
308
|
|
|
303
309
|
const overflowValues = [
|
|
304
310
|
"auto",
|
|
305
311
|
"hidden",
|
|
312
|
+
"clip",
|
|
306
313
|
"visible",
|
|
307
314
|
"scroll"
|
|
308
315
|
];
|
|
@@ -311,7 +318,6 @@ const overflows = [
|
|
|
311
318
|
[/^(?:overflow|of)-([xy])-(.+)$/, ([, d, v]) => overflowValues.includes(v) ? { [`overflow-${d}`]: v } : void 0]
|
|
312
319
|
];
|
|
313
320
|
|
|
314
|
-
const basicSet = ["auto", "start", "end", "center", "stretch"];
|
|
315
321
|
const positions = [
|
|
316
322
|
[/^(?:position-|pos-)?(relative|absolute|fixed|sticky)$/, ([, v]) => ({ position: v })],
|
|
317
323
|
[/^(?:position-|pos-)?(static)$/, ([, v]) => ({ position: v })]
|
|
@@ -323,8 +329,15 @@ const justifies = [
|
|
|
323
329
|
["justify-between", { "justify-content": "space-between" }],
|
|
324
330
|
["justify-around", { "justify-content": "space-around" }],
|
|
325
331
|
["justify-evenly", { "justify-content": "space-evenly" }],
|
|
326
|
-
|
|
327
|
-
|
|
332
|
+
["justify-items-start", { "justify-items": "start" }],
|
|
333
|
+
["justify-items-end", { "justify-items": "end" }],
|
|
334
|
+
["justify-items-center", { "justify-items": "center" }],
|
|
335
|
+
["justify-items-stretch", { "justify-items": "stretch" }],
|
|
336
|
+
["justify-self-auto", { "justify-self": "auto" }],
|
|
337
|
+
["justify-self-start", { "justify-self": "start" }],
|
|
338
|
+
["justify-self-end", { "justify-self": "end" }],
|
|
339
|
+
["justify-self-center", { "justify-self": "center" }],
|
|
340
|
+
["justify-self-stretch", { "justify-self": "stretch" }]
|
|
328
341
|
];
|
|
329
342
|
const orders = [
|
|
330
343
|
[/^order-(.+)$/, ([, v]) => ({ order: handler.bracket.number(v) })],
|
|
@@ -333,9 +346,9 @@ const orders = [
|
|
|
333
346
|
["order-none", { order: "0" }]
|
|
334
347
|
];
|
|
335
348
|
const alignments = [
|
|
349
|
+
["content-center", { "align-content": "center" }],
|
|
336
350
|
["content-start", { "align-content": "flex-start" }],
|
|
337
351
|
["content-end", { "align-content": "flex-end" }],
|
|
338
|
-
["content-center", { "align-content": "center" }],
|
|
339
352
|
["content-between", { "align-content": "space-between" }],
|
|
340
353
|
["content-around", { "align-content": "space-around" }],
|
|
341
354
|
["content-evenly", { "align-content": "space-evenly" }],
|
|
@@ -348,29 +361,39 @@ const alignments = [
|
|
|
348
361
|
["self-start", { "align-self": "flex-start" }],
|
|
349
362
|
["self-end", { "align-self": "flex-end" }],
|
|
350
363
|
["self-center", { "align-self": "center" }],
|
|
351
|
-
["self-stretch", { "align-self": "stretch" }]
|
|
364
|
+
["self-stretch", { "align-self": "stretch" }],
|
|
365
|
+
["self-baseline", { "align-self": "baseline" }]
|
|
352
366
|
];
|
|
353
367
|
const placements = [
|
|
368
|
+
["place-content-center", { "place-content": "center" }],
|
|
354
369
|
["place-content-start", { "place-content": "start" }],
|
|
355
370
|
["place-content-end", { "place-content": "end" }],
|
|
356
|
-
["place-content-center", { "place-content": "center" }],
|
|
357
371
|
["place-content-between", { "place-content": "space-between" }],
|
|
358
372
|
["place-content-around", { "place-content": "space-around" }],
|
|
359
373
|
["place-content-evenly", { "place-content": "space-evenly" }],
|
|
360
374
|
["place-content-stretch", { "place-content": "stretch" }],
|
|
361
|
-
|
|
362
|
-
|
|
375
|
+
["place-items-start", { "place-items": "start" }],
|
|
376
|
+
["place-items-end", { "place-items": "end" }],
|
|
377
|
+
["place-items-center", { "place-items": "center" }],
|
|
378
|
+
["place-items-stretch", { "place-items": "stretch" }],
|
|
379
|
+
["place-self-auto", { "place-self": "auto" }],
|
|
380
|
+
["place-self-start", { "place-self": "start" }],
|
|
381
|
+
["place-self-end", { "place-self": "end" }],
|
|
382
|
+
["place-self-center", { "place-self": "center" }],
|
|
383
|
+
["place-self-stretch", { "place-self": "stretch" }]
|
|
363
384
|
];
|
|
364
385
|
function handleInsetValue(v) {
|
|
365
386
|
return { auto: "auto", full: "100%" }[v] ?? handler.bracket.fraction.cssvar.auto.rem(v);
|
|
366
387
|
}
|
|
388
|
+
function handleInsetValues([, d, v]) {
|
|
389
|
+
const r = handleInsetValue(v);
|
|
390
|
+
if (r != null && d in directionMap)
|
|
391
|
+
return directionMap[d].map((i) => [i.slice(1), r]);
|
|
392
|
+
}
|
|
367
393
|
const insets = [
|
|
368
|
-
[/^(?:position-|pos-)?
|
|
369
|
-
[/^(?:position-|pos-)?inset-([xy])-(.+)$/,
|
|
370
|
-
|
|
371
|
-
if (r != null && d in directionMap)
|
|
372
|
-
return directionMap[d].map((i) => [i.slice(1), r]);
|
|
373
|
-
}]
|
|
394
|
+
[/^(?:position-|pos-)?inset-(.+)$/, ([, v]) => ({ inset: handleInsetValue(v) })],
|
|
395
|
+
[/^(?:position-|pos-)?inset-([xy])-(.+)$/, handleInsetValues],
|
|
396
|
+
[/^(?:position-|pos-)?(top|left|right|bottom)-(.+)$/, ([, d, v]) => ({ [d]: handleInsetValue(v) })]
|
|
374
397
|
];
|
|
375
398
|
const floats = [
|
|
376
399
|
["float-left", { float: "left" }],
|
|
@@ -433,7 +456,7 @@ const contents = [
|
|
|
433
456
|
];
|
|
434
457
|
const breaks = [
|
|
435
458
|
["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }],
|
|
436
|
-
["break-
|
|
459
|
+
["break-words", { "overflow-wrap": "break-word" }],
|
|
437
460
|
["break-all", { "word-break": "break-all" }]
|
|
438
461
|
];
|
|
439
462
|
const textOverflows = [
|
|
@@ -465,14 +488,14 @@ const fontSmoothings = [
|
|
|
465
488
|
];
|
|
466
489
|
|
|
467
490
|
const rings = [
|
|
468
|
-
[/^ring
|
|
491
|
+
[/^ring(?:-(.+))?$/, ([, d]) => {
|
|
469
492
|
const value = handler.px(d || "1");
|
|
470
493
|
if (value) {
|
|
471
494
|
return {
|
|
472
495
|
"--un-ring-inset": varEmpty,
|
|
473
496
|
"--un-ring-offset-width": "0px",
|
|
474
497
|
"--un-ring-offset-color": "#fff",
|
|
475
|
-
"--un-ring-color": "rgba(
|
|
498
|
+
"--un-ring-color": "rgba(147, 197, 253, .5)",
|
|
476
499
|
"--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)",
|
|
477
500
|
"--un-ring-shadow": `var(--un-ring-inset) 0 0 0 calc(${value} + var(--un-ring-offset-width)) var(--un-ring-color)`,
|
|
478
501
|
"box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow, 0 0 #0000)"
|
|
@@ -506,7 +529,7 @@ const shadowColorResolver = (body, theme) => {
|
|
|
506
529
|
}
|
|
507
530
|
};
|
|
508
531
|
const boxShadows = [
|
|
509
|
-
[/^shadow
|
|
532
|
+
[/^shadow(?:-(.+))?$/, ([, d], { theme }) => {
|
|
510
533
|
const value = theme.boxShadow?.[d || "DEFAULT"];
|
|
511
534
|
if (value) {
|
|
512
535
|
return {
|
|
@@ -524,27 +547,38 @@ const boxShadows = [
|
|
|
524
547
|
function getPropName(minmax, hw) {
|
|
525
548
|
return `${minmax ? `${minmax}-` : ""}${hw === "h" ? "height" : "width"}`;
|
|
526
549
|
}
|
|
527
|
-
function
|
|
550
|
+
function getSizeValue(minmax, hw, theme, prop) {
|
|
528
551
|
let str = `${hw === "h" ? "height" : "width"}`;
|
|
529
552
|
if (minmax)
|
|
530
553
|
str = `${minmax}${capitalize(str)}`;
|
|
531
|
-
|
|
554
|
+
const v = theme[str]?.[prop];
|
|
555
|
+
if (v != null)
|
|
556
|
+
return v;
|
|
557
|
+
switch (prop) {
|
|
558
|
+
case "fit":
|
|
559
|
+
case "max":
|
|
560
|
+
case "min":
|
|
561
|
+
return `${prop}-content`;
|
|
562
|
+
}
|
|
563
|
+
return handler.bracket.cssvar.fraction.auto.rem(prop);
|
|
532
564
|
}
|
|
533
565
|
const sizes = [
|
|
534
|
-
[/^(?:(min|max)-)?(w|h)-(.+)$/, ([, m, w, s], { theme }) => {
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
return
|
|
543
|
-
|
|
544
|
-
|
|
566
|
+
[/^(?:(min|max)-)?(w|h)-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
|
|
567
|
+
[/^(?:(min|max)-)?(w)-screen-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: theme.breakpoints?.[s] })]
|
|
568
|
+
];
|
|
569
|
+
function getAspectRatio(prop) {
|
|
570
|
+
if (/^\d+\/\d+$/.test(prop))
|
|
571
|
+
return prop;
|
|
572
|
+
switch (prop) {
|
|
573
|
+
case "square":
|
|
574
|
+
return "1/1";
|
|
575
|
+
case "video":
|
|
576
|
+
return "16/9";
|
|
577
|
+
}
|
|
578
|
+
return handler.bracket.cssvar.auto.number(prop);
|
|
579
|
+
}
|
|
545
580
|
const aspectRatio = [
|
|
546
|
-
[
|
|
547
|
-
[/^aspect-ratio-(.+)$/, ([, d]) => ({ "aspect-ratio": (/^\d+\/\d+$/.test(d) ? d : null) || handler.bracket.cssvar.number(d) })]
|
|
581
|
+
[/^aspect-(?:ratio-)?(.+)$/, ([, d]) => ({ "aspect-ratio": getAspectRatio(d) })]
|
|
548
582
|
];
|
|
549
583
|
|
|
550
584
|
const paddings = [
|
|
@@ -580,27 +614,19 @@ const transformBase = {
|
|
|
580
614
|
};
|
|
581
615
|
const transforms = [
|
|
582
616
|
["transform", transformBase],
|
|
583
|
-
[/^
|
|
584
|
-
[/^translate()
|
|
617
|
+
[/^origin-([-\w]{3,})$/, ([, s]) => ({ "transform-origin": positionMap[s] })],
|
|
618
|
+
[/^translate-()(.+)$/, handleTranslate],
|
|
585
619
|
[/^translate-([xyz])-(.+)$/, handleTranslate],
|
|
586
|
-
[/^scale()-(.+)$/, handleScale],
|
|
587
|
-
[/^scale-([xyz])-(.+)$/, handleScale],
|
|
588
620
|
[/^rotate-(.+)$/, handleRotate],
|
|
589
|
-
[/^
|
|
621
|
+
[/^skew-()(.+)$/, handleSkew],
|
|
590
622
|
[/^skew-([xy])-(.+)$/, handleSkew],
|
|
591
|
-
[/^
|
|
623
|
+
[/^scale-()(.+)$/, handleScale],
|
|
624
|
+
[/^scale-([xyz])-(.+)$/, handleScale],
|
|
625
|
+
["preserve-3d", { "transform-style": "preserve-3d" }],
|
|
626
|
+
["preserve-flat", { "transform-style": "flat" }],
|
|
592
627
|
["transform-gpu", transformGpu],
|
|
593
628
|
["transform-cpu", transformCpu],
|
|
594
|
-
["transform-none", { transform: "none" }]
|
|
595
|
-
["origin-center", { "transform-origin": "center" }],
|
|
596
|
-
["origin-top", { "transform-origin": "top" }],
|
|
597
|
-
["origin-top-right", { "transform-origin": "top right" }],
|
|
598
|
-
["origin-right", { "transform-origin": "right" }],
|
|
599
|
-
["origin-bottom-right", { "transform-origin": "bottom right" }],
|
|
600
|
-
["origin-bottom", { "transform-origin": "bottom" }],
|
|
601
|
-
["origin-bottom-left", { "transform-origin": "bottom left" }],
|
|
602
|
-
["origin-left", { "transform-origin": "left" }],
|
|
603
|
-
["origin-top-left", { "transform-origin": "top left" }]
|
|
629
|
+
["transform-none", { transform: "none" }]
|
|
604
630
|
];
|
|
605
631
|
function handleTranslate([, d, b]) {
|
|
606
632
|
const v = handler.bracket.fraction.auto.rem(b);
|
|
@@ -620,17 +646,8 @@ function handleScale([, d, b]) {
|
|
|
620
646
|
];
|
|
621
647
|
}
|
|
622
648
|
}
|
|
623
|
-
function handleRotateWithUnit([, b]) {
|
|
624
|
-
const v = handler.bracket.number(b);
|
|
625
|
-
if (v != null) {
|
|
626
|
-
return [
|
|
627
|
-
transformBase,
|
|
628
|
-
{ "--un-rotate": `${v}deg` }
|
|
629
|
-
];
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
649
|
function handleRotate([, b]) {
|
|
633
|
-
const v = handler.bracket(b);
|
|
650
|
+
const v = handler.bracket.degree(b);
|
|
634
651
|
if (v != null) {
|
|
635
652
|
return [
|
|
636
653
|
transformBase,
|
|
@@ -638,17 +655,8 @@ function handleRotate([, b]) {
|
|
|
638
655
|
];
|
|
639
656
|
}
|
|
640
657
|
}
|
|
641
|
-
function handleSkewWithUnit([, d, b]) {
|
|
642
|
-
const v = handler.bracket.number(b);
|
|
643
|
-
if (v != null) {
|
|
644
|
-
return [
|
|
645
|
-
transformBase,
|
|
646
|
-
{ [`--un-skew-${d}`]: `${v}deg` }
|
|
647
|
-
];
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
658
|
function handleSkew([, d, b]) {
|
|
651
|
-
const v = handler.bracket(b);
|
|
659
|
+
const v = handler.bracket.degree(b);
|
|
652
660
|
if (v != null) {
|
|
653
661
|
return [
|
|
654
662
|
transformBase,
|
|
@@ -701,10 +709,11 @@ ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
|
|
|
701
709
|
];
|
|
702
710
|
|
|
703
711
|
const textDecorations = [
|
|
704
|
-
["underline", { "text-decoration": "underline" }],
|
|
705
|
-
["
|
|
706
|
-
["
|
|
707
|
-
["decoration-
|
|
712
|
+
["underline", { "text-decoration-line": "underline" }],
|
|
713
|
+
["overline", { "text-decoration-line": "overline" }],
|
|
714
|
+
["line-through", { "text-decoration-line": "line-through" }],
|
|
715
|
+
["decoration-underline", { "text-decoration-line": "underline" }],
|
|
716
|
+
["decoration-line-through", { "text-decoration-line": "line-through" }],
|
|
708
717
|
[/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s]) => ({ "text-decoration-thickness": handler.bracket.px(s) })],
|
|
709
718
|
[/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s })],
|
|
710
719
|
[/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
|
package/dist/chunks/default3.cjs
CHANGED
|
@@ -46,24 +46,18 @@ const variantCombinators = [
|
|
|
46
46
|
variants$1.variantMatcher("svg", (input) => `${input} svg *`)
|
|
47
47
|
];
|
|
48
48
|
|
|
49
|
-
const variantColorsMediaOrClass =
|
|
50
|
-
(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (dark === "class")
|
|
56
|
-
return variants$1.variantMatcher("light", (input) => `.light $$ ${input}`)(v);
|
|
57
|
-
},
|
|
58
|
-
(v, { options: { dark } }) => {
|
|
59
|
-
if (dark === "media")
|
|
60
|
-
return variants$1.variantParentMatcher("dark", "@media (prefers-color-scheme: dark)")(v);
|
|
61
|
-
},
|
|
62
|
-
(v, { options: { dark } }) => {
|
|
63
|
-
if (dark === "media")
|
|
64
|
-
return variants$1.variantParentMatcher("light", "@media (prefers-color-scheme: light)")(v);
|
|
49
|
+
const variantColorsMediaOrClass = (options = {}) => {
|
|
50
|
+
if (options?.dark === "class") {
|
|
51
|
+
return [
|
|
52
|
+
variants$1.variantMatcher("dark", (input) => `.dark $$ ${input}`),
|
|
53
|
+
variants$1.variantMatcher("light", (input) => `.light $$ ${input}`)
|
|
54
|
+
];
|
|
65
55
|
}
|
|
66
|
-
|
|
56
|
+
return [
|
|
57
|
+
variants$1.variantParentMatcher("dark", "@media (prefers-color-scheme: dark)"),
|
|
58
|
+
variants$1.variantParentMatcher("light", "@media (prefers-color-scheme: light)")
|
|
59
|
+
];
|
|
60
|
+
};
|
|
67
61
|
|
|
68
62
|
const variantLanguageDirections = [
|
|
69
63
|
variants$1.variantMatcher("rtl", (input) => `[dir="rtl"] $$ ${input}`),
|
|
@@ -103,16 +97,6 @@ const variantNegative = {
|
|
|
103
97
|
}
|
|
104
98
|
}
|
|
105
99
|
};
|
|
106
|
-
const variantSpace = (matcher) => {
|
|
107
|
-
if (/^space-?([xy])-?(-?.+)$/.test(matcher) || /^divide-/.test(matcher)) {
|
|
108
|
-
return {
|
|
109
|
-
matcher,
|
|
110
|
-
selector: (input) => {
|
|
111
|
-
return `${input}>:not([hidden])~:not([hidden])`;
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
100
|
|
|
117
101
|
const variantMotions = [
|
|
118
102
|
variants$1.variantParentMatcher("motion-reduce", "@media (prefers-reduced-motion: reduce)"),
|
|
@@ -126,8 +110,7 @@ const variantOrientations = [
|
|
|
126
110
|
|
|
127
111
|
const variantPrint = variants$1.variantParentMatcher("print", "@media print");
|
|
128
112
|
|
|
129
|
-
const variants = [
|
|
130
|
-
variantSpace,
|
|
113
|
+
const variants = (options) => [
|
|
131
114
|
variantNegative,
|
|
132
115
|
variantImportant,
|
|
133
116
|
variantPrint,
|
|
@@ -137,10 +120,10 @@ const variants = [
|
|
|
137
120
|
...variantCombinators,
|
|
138
121
|
pseudo.variantPseudoClasses,
|
|
139
122
|
pseudo.variantPseudoClassFunctions,
|
|
140
|
-
pseudo.variantTaggedPseudoClasses,
|
|
123
|
+
...pseudo.variantTaggedPseudoClasses(options),
|
|
141
124
|
pseudo.variantPseudoElements,
|
|
142
125
|
pseudo.partClasses,
|
|
143
|
-
...variantColorsMediaOrClass,
|
|
126
|
+
...variantColorsMediaOrClass(options),
|
|
144
127
|
...variantLanguageDirections
|
|
145
128
|
];
|
|
146
129
|
|
|
@@ -153,5 +136,4 @@ exports.variantMotions = variantMotions;
|
|
|
153
136
|
exports.variantNegative = variantNegative;
|
|
154
137
|
exports.variantOrientations = variantOrientations;
|
|
155
138
|
exports.variantPrint = variantPrint;
|
|
156
|
-
exports.variantSpace = variantSpace;
|
|
157
139
|
exports.variants = variants;
|