@unocss/preset-mini 0.48.5 → 0.49.1
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/index.cjs +18 -15
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +19 -16
- package/dist/rules.cjs +3 -3
- package/dist/rules.mjs +3 -3
- package/dist/shared/{preset-mini.43dfafb9.cjs → preset-mini.3a9c563b.cjs} +2 -2
- package/dist/shared/{preset-mini.8953ff1a.cjs → preset-mini.5d6b20c4.cjs} +5 -4
- package/dist/shared/{preset-mini.e54ce13d.cjs → preset-mini.65179802.cjs} +14 -2
- package/dist/shared/{preset-mini.89cb41ec.cjs → preset-mini.6f1356df.cjs} +172 -146
- package/dist/shared/{preset-mini.0a36abfc.mjs → preset-mini.708f19ca.mjs} +2 -2
- package/dist/shared/{preset-mini.435805c5.cjs → preset-mini.70cd3126.cjs} +3 -3
- package/dist/shared/{preset-mini.28b1d01c.cjs → preset-mini.77e00c7b.cjs} +9 -5
- package/dist/shared/{preset-mini.bd4c0c0c.mjs → preset-mini.816a9399.mjs} +9 -5
- package/dist/shared/{preset-mini.a6daaf18.mjs → preset-mini.8c7d231d.mjs} +5 -4
- package/dist/shared/{preset-mini.0d510914.mjs → preset-mini.aabbbe8d.mjs} +172 -146
- package/dist/shared/{preset-mini.6b96b995.mjs → preset-mini.c2430d65.mjs} +3 -3
- package/dist/shared/{preset-mini.ca595ab5.mjs → preset-mini.d9489281.mjs} +14 -2
- package/dist/theme.cjs +3 -3
- package/dist/theme.mjs +3 -3
- package/dist/utils.cjs +2 -2
- package/dist/utils.mjs +2 -2
- package/dist/variants.cjs +3 -3
- package/dist/variants.d.ts +6 -6
- package/dist/variants.mjs +3 -3
- package/package.json +2 -2
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { h as handler, l as resolveBreakpoints, q as getBracket, C as CONTROL_MINI_NO_NEGATIVE, t as getComponent } from './preset-mini.
|
|
1
|
+
import { h as handler, l as resolveBreakpoints, q as getBracket, C as CONTROL_MINI_NO_NEGATIVE, t as getComponent } from './preset-mini.d9489281.mjs';
|
|
2
2
|
import { warnOnce, escapeRegExp, escapeSelector } from '@unocss/core';
|
|
3
|
-
import { v as variantGetParameter, a as variantGetBracket, b as variantParentMatcher, c as variantMatcher } from './preset-mini.
|
|
3
|
+
import { v as variantGetParameter, a as variantGetBracket, b as variantParentMatcher, c as variantMatcher } from './preset-mini.816a9399.mjs';
|
|
4
4
|
|
|
5
5
|
const variantAria = {
|
|
6
6
|
name: "aria",
|
|
7
|
-
match(matcher,
|
|
8
|
-
const variant = variantGetParameter("aria-", matcher,
|
|
7
|
+
match(matcher, ctx) {
|
|
8
|
+
const variant = variantGetParameter("aria-", matcher, ctx.generator.config.separators);
|
|
9
9
|
if (variant) {
|
|
10
10
|
const [match, rest] = variant;
|
|
11
|
-
const aria = handler.bracket(match) ?? theme.aria?.[match] ?? "";
|
|
11
|
+
const aria = handler.bracket(match) ?? ctx.theme.aria?.[match] ?? "";
|
|
12
12
|
if (aria) {
|
|
13
13
|
return {
|
|
14
14
|
matcher: rest,
|
|
@@ -19,74 +19,77 @@ const variantAria = {
|
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
const regexCache = {};
|
|
23
22
|
const calcMaxWidthBySize = (size) => {
|
|
24
23
|
const value = size.match(/^-?[0-9]+\.?[0-9]*/)?.[0] || "";
|
|
25
24
|
const unit = size.slice(value.length);
|
|
26
25
|
const maxWidth = parseFloat(value) - 0.1;
|
|
27
26
|
return Number.isNaN(maxWidth) ? size : `${maxWidth}${unit}`;
|
|
28
27
|
};
|
|
29
|
-
const variantBreakpoints = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
order
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
28
|
+
const variantBreakpoints = () => {
|
|
29
|
+
const regexCache = {};
|
|
30
|
+
return {
|
|
31
|
+
name: "breakpoints",
|
|
32
|
+
match(matcher, context) {
|
|
33
|
+
const variantEntries = Object.entries(resolveBreakpoints(context) ?? {}).map(([point, size], idx) => [point, size, idx]);
|
|
34
|
+
for (const [point, size, idx] of variantEntries) {
|
|
35
|
+
if (!regexCache[point])
|
|
36
|
+
regexCache[point] = new RegExp(`^((?:[al]t-)?${point}(?:${context.generator.config.separators.join("|")}))`);
|
|
37
|
+
const match = matcher.match(regexCache[point]);
|
|
38
|
+
if (!match)
|
|
39
|
+
continue;
|
|
40
|
+
const [, pre] = match;
|
|
41
|
+
const m = matcher.slice(pre.length);
|
|
42
|
+
if (m === "container")
|
|
43
|
+
continue;
|
|
44
|
+
const isLtPrefix = pre.startsWith("lt-");
|
|
45
|
+
const isAtPrefix = pre.startsWith("at-");
|
|
46
|
+
let order = 1e3;
|
|
47
|
+
if (isLtPrefix) {
|
|
48
|
+
order -= idx + 1;
|
|
49
|
+
return {
|
|
50
|
+
matcher: m,
|
|
51
|
+
handle: (input, next) => next({
|
|
52
|
+
...input,
|
|
53
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (max-width: ${calcMaxWidthBySize(size)})`,
|
|
54
|
+
parentOrder: order
|
|
55
|
+
})
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
order += idx + 1;
|
|
59
|
+
if (isAtPrefix && idx < variantEntries.length - 1) {
|
|
60
|
+
return {
|
|
61
|
+
matcher: m,
|
|
62
|
+
handle: (input, next) => next({
|
|
63
|
+
...input,
|
|
64
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (min-width: ${size}) and (max-width: ${calcMaxWidthBySize(variantEntries[idx + 1][1])})`,
|
|
65
|
+
parentOrder: order
|
|
66
|
+
})
|
|
67
|
+
};
|
|
68
|
+
}
|
|
59
69
|
return {
|
|
60
70
|
matcher: m,
|
|
61
71
|
handle: (input, next) => next({
|
|
62
72
|
...input,
|
|
63
|
-
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (min-width: ${size})
|
|
73
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (min-width: ${size})`,
|
|
64
74
|
parentOrder: order
|
|
65
75
|
})
|
|
66
76
|
};
|
|
67
77
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (min-width: ${size})`,
|
|
73
|
-
parentOrder: order
|
|
74
|
-
})
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
multiPass: true,
|
|
79
|
-
autocomplete: "(at-|lt-|)$breakpoints:"
|
|
78
|
+
},
|
|
79
|
+
multiPass: true,
|
|
80
|
+
autocomplete: "(at-|lt-|)$breakpoints:"
|
|
81
|
+
};
|
|
80
82
|
};
|
|
81
83
|
|
|
82
84
|
const scopeMatcher = (name, combinator) => ({
|
|
83
85
|
name: `combinator:${name}`,
|
|
84
|
-
match(matcher) {
|
|
86
|
+
match(matcher, ctx) {
|
|
85
87
|
if (!matcher.startsWith(name))
|
|
86
88
|
return;
|
|
87
|
-
|
|
89
|
+
const separators = ctx.generator.config.separators;
|
|
90
|
+
let body = variantGetBracket(`${name}-`, matcher, separators);
|
|
88
91
|
if (!body) {
|
|
89
|
-
for (const separator of
|
|
92
|
+
for (const separator of separators) {
|
|
90
93
|
if (matcher.startsWith(`${name}${separator}`)) {
|
|
91
94
|
body = ["", matcher.slice(name.length + separator.length)];
|
|
92
95
|
break;
|
|
@@ -115,10 +118,10 @@ const variantCombinators = [
|
|
|
115
118
|
|
|
116
119
|
const variantContainerQuery = {
|
|
117
120
|
name: "@",
|
|
118
|
-
match(matcher,
|
|
121
|
+
match(matcher, ctx) {
|
|
119
122
|
if (matcher.startsWith("@container"))
|
|
120
123
|
return;
|
|
121
|
-
const variant = variantGetParameter("@", matcher,
|
|
124
|
+
const variant = variantGetParameter("@", matcher, ctx.generator.config.separators);
|
|
122
125
|
if (variant) {
|
|
123
126
|
const [match, rest, label] = variant;
|
|
124
127
|
const unbracket = handler.bracket(match);
|
|
@@ -128,7 +131,7 @@ const variantContainerQuery = {
|
|
|
128
131
|
if (minWidth)
|
|
129
132
|
container = `(min-width: ${minWidth})`;
|
|
130
133
|
} else {
|
|
131
|
-
container = theme.containers?.[match] ?? "";
|
|
134
|
+
container = ctx.theme.containers?.[match] ?? "";
|
|
132
135
|
}
|
|
133
136
|
if (container) {
|
|
134
137
|
warnOnce("The container query variant is experimental and may not follow semver.");
|
|
@@ -147,11 +150,11 @@ const variantContainerQuery = {
|
|
|
147
150
|
|
|
148
151
|
const variantDataAttribute = {
|
|
149
152
|
name: "data",
|
|
150
|
-
match(matcher,
|
|
151
|
-
const variant = variantGetParameter("data-", matcher,
|
|
153
|
+
match(matcher, ctx) {
|
|
154
|
+
const variant = variantGetParameter("data-", matcher, ctx.generator.config.separators);
|
|
152
155
|
if (variant) {
|
|
153
156
|
const [match, rest] = variant;
|
|
154
|
-
const dataAttribute = handler.bracket(match) ?? theme.data?.[match] ?? "";
|
|
157
|
+
const dataAttribute = handler.bracket(match) ?? ctx.theme.data?.[match] ?? "";
|
|
155
158
|
if (dataAttribute) {
|
|
156
159
|
return {
|
|
157
160
|
matcher: rest,
|
|
@@ -165,13 +168,13 @@ const variantDataAttribute = {
|
|
|
165
168
|
const variantPrint = variantParentMatcher("print", "@media print");
|
|
166
169
|
const variantCustomMedia = {
|
|
167
170
|
name: "media",
|
|
168
|
-
match(matcher,
|
|
169
|
-
const variant = variantGetParameter("media-", matcher,
|
|
171
|
+
match(matcher, ctx) {
|
|
172
|
+
const variant = variantGetParameter("media-", matcher, ctx.generator.config.separators);
|
|
170
173
|
if (variant) {
|
|
171
174
|
const [match, rest] = variant;
|
|
172
175
|
let media = handler.bracket(match) ?? "";
|
|
173
176
|
if (media === "")
|
|
174
|
-
media = theme.media?.[match] ?? "";
|
|
177
|
+
media = ctx.theme.media?.[match] ?? "";
|
|
175
178
|
if (media) {
|
|
176
179
|
return {
|
|
177
180
|
matcher: rest,
|
|
@@ -188,13 +191,13 @@ const variantCustomMedia = {
|
|
|
188
191
|
|
|
189
192
|
const variantSupports = {
|
|
190
193
|
name: "supports",
|
|
191
|
-
match(matcher,
|
|
192
|
-
const variant = variantGetParameter("supports-", matcher,
|
|
194
|
+
match(matcher, ctx) {
|
|
195
|
+
const variant = variantGetParameter("supports-", matcher, ctx.generator.config.separators);
|
|
193
196
|
if (variant) {
|
|
194
197
|
const [match, rest] = variant;
|
|
195
198
|
let supports = handler.bracket(match) ?? "";
|
|
196
199
|
if (supports === "")
|
|
197
|
-
supports = theme.supports?.[match] ?? "";
|
|
200
|
+
supports = ctx.theme.supports?.[match] ?? "";
|
|
198
201
|
if (supports) {
|
|
199
202
|
return {
|
|
200
203
|
matcher: rest,
|
|
@@ -230,8 +233,8 @@ const variantLanguageDirections = [
|
|
|
230
233
|
|
|
231
234
|
const variantSelector = {
|
|
232
235
|
name: "selector",
|
|
233
|
-
match(matcher) {
|
|
234
|
-
const variant = variantGetBracket("selector-", matcher,
|
|
236
|
+
match(matcher, ctx) {
|
|
237
|
+
const variant = variantGetBracket("selector-", matcher, ctx.generator.config.separators);
|
|
235
238
|
if (variant) {
|
|
236
239
|
const [match, rest] = variant;
|
|
237
240
|
const selector = handler.bracket(match);
|
|
@@ -246,8 +249,8 @@ const variantSelector = {
|
|
|
246
249
|
};
|
|
247
250
|
const variantCssLayer = {
|
|
248
251
|
name: "layer",
|
|
249
|
-
match(matcher) {
|
|
250
|
-
const variant = variantGetParameter("layer-", matcher,
|
|
252
|
+
match(matcher, ctx) {
|
|
253
|
+
const variant = variantGetParameter("layer-", matcher, ctx.generator.config.separators);
|
|
251
254
|
if (variant) {
|
|
252
255
|
const [match, rest] = variant;
|
|
253
256
|
const layer = handler.bracket(match) ?? match;
|
|
@@ -265,8 +268,8 @@ const variantCssLayer = {
|
|
|
265
268
|
};
|
|
266
269
|
const variantInternalLayer = {
|
|
267
270
|
name: "uno-layer",
|
|
268
|
-
match(matcher) {
|
|
269
|
-
const variant = variantGetParameter("uno-layer-", matcher,
|
|
271
|
+
match(matcher, ctx) {
|
|
272
|
+
const variant = variantGetParameter("uno-layer-", matcher, ctx.generator.config.separators);
|
|
270
273
|
if (variant) {
|
|
271
274
|
const [match, rest] = variant;
|
|
272
275
|
const layer = handler.bracket(match) ?? match;
|
|
@@ -281,8 +284,8 @@ const variantInternalLayer = {
|
|
|
281
284
|
};
|
|
282
285
|
const variantScope = {
|
|
283
286
|
name: "scope",
|
|
284
|
-
match(matcher) {
|
|
285
|
-
const variant = variantGetBracket("scope-", matcher,
|
|
287
|
+
match(matcher, ctx) {
|
|
288
|
+
const variant = variantGetBracket("scope-", matcher, ctx.generator.config.separators);
|
|
286
289
|
if (variant) {
|
|
287
290
|
const [match, rest] = variant;
|
|
288
291
|
const scope = handler.bracket(match);
|
|
@@ -297,14 +300,14 @@ const variantScope = {
|
|
|
297
300
|
};
|
|
298
301
|
const variantVariables = {
|
|
299
302
|
name: "variables",
|
|
300
|
-
match(matcher) {
|
|
303
|
+
match(matcher, ctx) {
|
|
301
304
|
if (!matcher.startsWith("["))
|
|
302
305
|
return;
|
|
303
306
|
const [match, rest] = getBracket(matcher, "[", "]") ?? [];
|
|
304
307
|
if (!(match && rest))
|
|
305
308
|
return;
|
|
306
309
|
let newMatcher;
|
|
307
|
-
for (const separator of
|
|
310
|
+
for (const separator of ctx.generator.config.separators) {
|
|
308
311
|
if (rest.startsWith(separator)) {
|
|
309
312
|
newMatcher = rest.slice(separator.length);
|
|
310
313
|
break;
|
|
@@ -380,28 +383,33 @@ const variantNegative = {
|
|
|
380
383
|
}
|
|
381
384
|
};
|
|
382
385
|
|
|
383
|
-
const variantImportant = {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
386
|
+
const variantImportant = () => {
|
|
387
|
+
let re;
|
|
388
|
+
return {
|
|
389
|
+
name: "important",
|
|
390
|
+
match(matcher, ctx) {
|
|
391
|
+
if (!re)
|
|
392
|
+
re = new RegExp(`^(important(?:${ctx.generator.config.separators.join("|")})|!)`);
|
|
393
|
+
let base;
|
|
394
|
+
const match = matcher.match(re);
|
|
395
|
+
if (match)
|
|
396
|
+
base = matcher.slice(match[0].length);
|
|
397
|
+
else if (matcher.endsWith("!"))
|
|
398
|
+
base = matcher.slice(0, -1);
|
|
399
|
+
if (base) {
|
|
400
|
+
return {
|
|
401
|
+
matcher: base,
|
|
402
|
+
body: (body) => {
|
|
403
|
+
body.forEach((v) => {
|
|
404
|
+
if (v[1])
|
|
405
|
+
v[1] += " !important";
|
|
406
|
+
});
|
|
407
|
+
return body;
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
}
|
|
403
411
|
}
|
|
404
|
-
}
|
|
412
|
+
};
|
|
405
413
|
};
|
|
406
414
|
|
|
407
415
|
const PseudoClasses = Object.fromEntries([
|
|
@@ -469,8 +477,9 @@ const sortValue = (pseudo) => {
|
|
|
469
477
|
};
|
|
470
478
|
const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
471
479
|
const rawRE = new RegExp(`^(${escapeRegExp(parent)}:)(\\S+)${escapeRegExp(combinator)}\\1`);
|
|
472
|
-
|
|
473
|
-
|
|
480
|
+
let splitRE;
|
|
481
|
+
let pseudoRE;
|
|
482
|
+
let pseudoColonRE;
|
|
474
483
|
const matchBracket = (input) => {
|
|
475
484
|
const body = variantGetBracket(`${tag}-`, input, []);
|
|
476
485
|
if (!body)
|
|
@@ -479,7 +488,7 @@ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
|
479
488
|
const bracketValue = handler.bracket(match);
|
|
480
489
|
if (bracketValue == null)
|
|
481
490
|
return;
|
|
482
|
-
const label = rest.split(
|
|
491
|
+
const label = rest.split(splitRE, 1)?.[0] ?? "";
|
|
483
492
|
const prefix = `${parent}${escapeSelector(label)}`;
|
|
484
493
|
return [
|
|
485
494
|
label,
|
|
@@ -505,7 +514,12 @@ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
|
505
514
|
};
|
|
506
515
|
return {
|
|
507
516
|
name: `pseudo:${tag}`,
|
|
508
|
-
match(input) {
|
|
517
|
+
match(input, ctx) {
|
|
518
|
+
if (!(splitRE && pseudoRE && pseudoColonRE)) {
|
|
519
|
+
splitRE = new RegExp(`(?:${ctx.generator.config.separators.join("|")})`);
|
|
520
|
+
pseudoRE = new RegExp(`^${tag}-(?:(?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))(?:(/\\w+))?(?:${ctx.generator.config.separators.join("|")})`);
|
|
521
|
+
pseudoColonRE = new RegExp(`^${tag}-(?:(?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesColonStr}))(?:(/\\w+))?(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`);
|
|
522
|
+
}
|
|
509
523
|
if (!input.startsWith(tag))
|
|
510
524
|
return;
|
|
511
525
|
const result = matchBracket(input) || matchPseudo(input);
|
|
@@ -528,50 +542,62 @@ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
|
528
542
|
};
|
|
529
543
|
const PseudoClassesAndElementsStr = Object.entries(PseudoClasses).map(([key]) => key).join("|");
|
|
530
544
|
const PseudoClassesAndElementsColonStr = Object.entries(PseudoClassesColon).map(([key]) => key).join("|");
|
|
531
|
-
const
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
545
|
+
const variantPseudoClassesAndElements = () => {
|
|
546
|
+
let PseudoClassesAndElementsRE;
|
|
547
|
+
let PseudoClassesAndElementsColonRE;
|
|
548
|
+
return {
|
|
549
|
+
name: "pseudo",
|
|
550
|
+
match(input, ctx) {
|
|
551
|
+
if (!(PseudoClassesAndElementsRE && PseudoClassesAndElementsRE)) {
|
|
552
|
+
PseudoClassesAndElementsRE = new RegExp(`^(${PseudoClassesAndElementsStr})(?:${ctx.generator.config.separators.join("|")})`);
|
|
553
|
+
PseudoClassesAndElementsColonRE = new RegExp(`^(${PseudoClassesAndElementsColonStr})(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`);
|
|
554
|
+
}
|
|
555
|
+
const match = input.match(PseudoClassesAndElementsRE) || input.match(PseudoClassesAndElementsColonRE);
|
|
556
|
+
if (match) {
|
|
557
|
+
const pseudo = PseudoClasses[match[1]] || PseudoClassesColon[match[1]] || `:${match[1]}`;
|
|
558
|
+
return {
|
|
559
|
+
matcher: input.slice(match[0].length),
|
|
560
|
+
handle: (input2, next) => {
|
|
561
|
+
const selectors = pseudo.startsWith("::") ? {
|
|
562
|
+
pseudo: `${input2.pseudo}${pseudo}`
|
|
563
|
+
} : {
|
|
564
|
+
selector: `${input2.selector}${pseudo}`
|
|
565
|
+
};
|
|
566
|
+
return next({
|
|
567
|
+
...input2,
|
|
568
|
+
...selectors,
|
|
569
|
+
sort: sortValue(match[1])
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
multiPass: true,
|
|
576
|
+
autocomplete: `(${PseudoClassesAndElementsStr}|${PseudoClassesAndElementsColonStr}):`
|
|
577
|
+
};
|
|
558
578
|
};
|
|
559
|
-
const
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
579
|
+
const variantPseudoClassFunctions = () => {
|
|
580
|
+
let PseudoClassFunctionsRE;
|
|
581
|
+
let PseudoClassColonFunctionsRE;
|
|
582
|
+
return {
|
|
583
|
+
match(input, ctx) {
|
|
584
|
+
if (!(PseudoClassFunctionsRE && PseudoClassColonFunctionsRE)) {
|
|
585
|
+
PseudoClassFunctionsRE = new RegExp(`^(${PseudoClassFunctionsStr})-(${PseudoClassesStr})(?:${ctx.generator.config.separators.join("|")})`);
|
|
586
|
+
PseudoClassColonFunctionsRE = new RegExp(`^(${PseudoClassFunctionsStr})-(${PseudoClassesColonStr})(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`);
|
|
587
|
+
}
|
|
588
|
+
const match = input.match(PseudoClassFunctionsRE) || input.match(PseudoClassColonFunctionsRE);
|
|
589
|
+
if (match) {
|
|
590
|
+
const fn = match[1];
|
|
591
|
+
const pseudo = PseudoClasses[match[2]] || PseudoClassesColon[match[2]] || `:${match[2]}`;
|
|
592
|
+
return {
|
|
593
|
+
matcher: input.slice(match[0].length),
|
|
594
|
+
selector: (s) => `${s}:${fn}(${pseudo})`
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
multiPass: true,
|
|
599
|
+
autocomplete: `(${PseudoClassFunctionsStr})-(${PseudoClassesStr}|${PseudoClassesColonStr}):`
|
|
600
|
+
};
|
|
575
601
|
};
|
|
576
602
|
const variantTaggedPseudoClasses = (options = {}) => {
|
|
577
603
|
const attributify = !!options?.attributifyPseudo;
|
|
@@ -604,14 +630,14 @@ const variants = (options) => [
|
|
|
604
630
|
variantSelector,
|
|
605
631
|
variantInternalLayer,
|
|
606
632
|
variantNegative,
|
|
607
|
-
variantImportant,
|
|
633
|
+
variantImportant(),
|
|
608
634
|
variantSupports,
|
|
609
635
|
variantPrint,
|
|
610
636
|
variantCustomMedia,
|
|
611
|
-
variantBreakpoints,
|
|
637
|
+
variantBreakpoints(),
|
|
612
638
|
...variantCombinators,
|
|
613
|
-
variantPseudoClassesAndElements,
|
|
614
|
-
variantPseudoClassFunctions,
|
|
639
|
+
variantPseudoClassesAndElements(),
|
|
640
|
+
variantPseudoClassFunctions(),
|
|
615
641
|
...variantTaggedPseudoClasses(options),
|
|
616
642
|
partClasses,
|
|
617
643
|
...variantColorsMediaOrClass(options),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as displays, b as borders, c as contentVisibility, a as contents, f as fonts, t as tabSizes, e as textIndents, g as textOverflows, h as textDecorations, i as textStrokes, j as textShadows, k as textTransforms, l as textAligns, m as fontStyles, n as fontSmoothings, o as boxShadows, r as rings, p as positions, q as cursors, s as appearances, u as pointerEvents, v as resizes, w as verticalAligns, x as userSelects, y as whitespaces, z as breaks, A as overflows, B as outline, C as appearance, D as orders, E as justifies, F as alignments, G as placements, H as insets, I as floats, J as zIndexes, K as boxSizing, L as transitions, M as transforms, N as willChange, O as contains } from './preset-mini.
|
|
2
|
-
import { h as handler, c as colorResolver, n as numberWithUnitRE, r as resolveVerticalBreakpoints, l as resolveBreakpoints, o as directionSize } from './preset-mini.
|
|
1
|
+
import { d as displays, b as borders, c as contentVisibility, a as contents, f as fonts, t as tabSizes, e as textIndents, g as textOverflows, h as textDecorations, i as textStrokes, j as textShadows, k as textTransforms, l as textAligns, m as fontStyles, n as fontSmoothings, o as boxShadows, r as rings, p as positions, q as cursors, s as appearances, u as pointerEvents, v as resizes, w as verticalAligns, x as userSelects, y as whitespaces, z as breaks, A as overflows, B as outline, C as appearance, D as orders, E as justifies, F as alignments, G as placements, H as insets, I as floats, J as zIndexes, K as boxSizing, L as transitions, M as transforms, N as willChange, O as contains } from './preset-mini.8c7d231d.mjs';
|
|
2
|
+
import { h as handler, c as colorResolver, n as numberWithUnitRE, r as resolveVerticalBreakpoints, l as resolveBreakpoints, o as directionSize } from './preset-mini.d9489281.mjs';
|
|
3
3
|
import { warnOnce } from '@unocss/core';
|
|
4
4
|
|
|
5
5
|
const opacity = [
|
|
@@ -212,7 +212,7 @@ const cssVariables = [
|
|
|
212
212
|
}]
|
|
213
213
|
];
|
|
214
214
|
const cssProperty = [
|
|
215
|
-
[/^\[(--(\w|\\\W)+|[\w-]+):(
|
|
215
|
+
[/^\[(--(\w|\\\W)+|[\w-]+):([^:].*)\]$/, ([match, prop, , value]) => {
|
|
216
216
|
if (!isURI(match.slice(1, -1)))
|
|
217
217
|
return { [prop]: handler.bracket(`[${value}]`) };
|
|
218
218
|
}]
|
|
@@ -20,7 +20,9 @@ const directionMap = {
|
|
|
20
20
|
const insetMap = {
|
|
21
21
|
...directionMap,
|
|
22
22
|
s: ["-inset-inline-start"],
|
|
23
|
+
start: ["-inset-inline-start"],
|
|
23
24
|
e: ["-inset-inline-end"],
|
|
25
|
+
end: ["-inset-inline-end"],
|
|
24
26
|
bs: ["-inset-block-start"],
|
|
25
27
|
be: ["-inset-block-end"],
|
|
26
28
|
is: ["-inset-inline-start"],
|
|
@@ -44,14 +46,20 @@ const cornerMap = {
|
|
|
44
46
|
"": [""],
|
|
45
47
|
"bs": ["-start-start", "-start-end"],
|
|
46
48
|
"be": ["-end-start", "-end-end"],
|
|
49
|
+
"s": ["-end-start", "-start-start"],
|
|
47
50
|
"is": ["-end-start", "-start-start"],
|
|
51
|
+
"e": ["-start-end", "-end-end"],
|
|
48
52
|
"ie": ["-start-end", "-end-end"],
|
|
53
|
+
"ss": ["-start-start"],
|
|
49
54
|
"bs-is": ["-start-start"],
|
|
50
55
|
"is-bs": ["-start-start"],
|
|
56
|
+
"se": ["-start-end"],
|
|
51
57
|
"bs-ie": ["-start-end"],
|
|
52
58
|
"ie-bs": ["-start-end"],
|
|
59
|
+
"es": ["-end-start"],
|
|
53
60
|
"be-is": ["-end-start"],
|
|
54
61
|
"is-be": ["-end-start"],
|
|
62
|
+
"ee": ["-end-end"],
|
|
55
63
|
"be-ie": ["-end-end"],
|
|
56
64
|
"ie-be": ["-end-end"]
|
|
57
65
|
};
|
|
@@ -248,8 +256,12 @@ function bracketWithType(str, requiredType) {
|
|
|
248
256
|
case "quoted":
|
|
249
257
|
return base.replace(/(^|[^\\])_/g, "$1 ").replace(/\\_/g, "_").replace(/(["\\])/g, "\\$1").replace(/^(.+)$/, '"$1"');
|
|
250
258
|
}
|
|
251
|
-
return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/(^|[^\\])_/g, "$1 ").replace(/\\_/g, "_").replace(/(?:calc|clamp|max|min)\((.*)/g, (
|
|
252
|
-
|
|
259
|
+
return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/(^|[^\\])_/g, "$1 ").replace(/\\_/g, "_").replace(/(?:calc|clamp|max|min)\((.*)/g, (match2) => {
|
|
260
|
+
const vars = [];
|
|
261
|
+
return match2.replace(/var\((--.+?)[,)]/g, (match3, g1) => {
|
|
262
|
+
vars.push(g1);
|
|
263
|
+
return match3.replace(g1, "--v");
|
|
264
|
+
}).replace(/(-?\d*\.?\d(?!\b-\d.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ").replace("--v", () => vars.shift());
|
|
253
265
|
});
|
|
254
266
|
}
|
|
255
267
|
}
|
package/dist/theme.cjs
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const colors = require('./shared/preset-mini.30606736.cjs');
|
|
6
|
-
const _default = require('./shared/preset-mini.
|
|
7
|
-
require('./shared/preset-mini.
|
|
8
|
-
require('./shared/preset-mini.
|
|
6
|
+
const _default = require('./shared/preset-mini.3a9c563b.cjs');
|
|
7
|
+
require('./shared/preset-mini.5d6b20c4.cjs');
|
|
8
|
+
require('./shared/preset-mini.65179802.cjs');
|
|
9
9
|
require('@unocss/core');
|
|
10
10
|
|
|
11
11
|
|
package/dist/theme.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { c as colors } from './shared/preset-mini.65ac75be.mjs';
|
|
2
|
-
export { p as baseSize, b as blur, m as borderRadius, n as boxShadow, i as breakpoints, z as containers, d as dropShadow, k as duration, o as easing, f as fontFamily, a as fontSize, x as height, h as letterSpacing, l as lineHeight, j as lineWidth, y as maxHeight, u as maxWidth, A as preflightBase, r as ringWidth, s as spacing, c as textIndent, g as textShadow, e as textStrokeWidth, t as theme, v as verticalBreakpoints, q as width, w as wordSpacing } from './shared/preset-mini.
|
|
3
|
-
import './shared/preset-mini.
|
|
4
|
-
import './shared/preset-mini.
|
|
2
|
+
export { p as baseSize, b as blur, m as borderRadius, n as boxShadow, i as breakpoints, z as containers, d as dropShadow, k as duration, o as easing, f as fontFamily, a as fontSize, x as height, h as letterSpacing, l as lineHeight, j as lineWidth, y as maxHeight, u as maxWidth, A as preflightBase, r as ringWidth, s as spacing, c as textIndent, g as textShadow, e as textStrokeWidth, t as theme, v as verticalBreakpoints, q as width, w as wordSpacing } from './shared/preset-mini.708f19ca.mjs';
|
|
3
|
+
import './shared/preset-mini.8c7d231d.mjs';
|
|
4
|
+
import './shared/preset-mini.d9489281.mjs';
|
|
5
5
|
import '@unocss/core';
|
package/dist/utils.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const colors = require('./shared/preset-mini.
|
|
6
|
-
const variants = require('./shared/preset-mini.
|
|
5
|
+
const colors = require('./shared/preset-mini.65179802.cjs');
|
|
6
|
+
const variants = require('./shared/preset-mini.77e00c7b.cjs');
|
|
7
7
|
require('@unocss/core');
|
|
8
8
|
|
|
9
9
|
|
package/dist/utils.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { C as CONTROL_MINI_NO_NEGATIVE, f as colorOpacityToString, c as colorResolver, e as colorToString, i as colorableShadows, b as cornerMap, d as directionMap, o as directionSize, q as getBracket, t as getComponent, z as getComponents, g as globalKeywords, w as h, h as handler, a as hasParseableColor, u as hex2rgba, j as insetMap, m as makeGlobalStaticRules, p as parseColor, v as parseCssColor, k as positionMap, l as resolveBreakpoints, r as resolveVerticalBreakpoints, s as splitShorthand, y as valueHandlers, x as xyzMap } from './shared/preset-mini.
|
|
2
|
-
export { a as variantGetBracket, v as variantGetParameter, c as variantMatcher, b as variantParentMatcher } from './shared/preset-mini.
|
|
1
|
+
export { C as CONTROL_MINI_NO_NEGATIVE, f as colorOpacityToString, c as colorResolver, e as colorToString, i as colorableShadows, b as cornerMap, d as directionMap, o as directionSize, q as getBracket, t as getComponent, z as getComponents, g as globalKeywords, w as h, h as handler, a as hasParseableColor, u as hex2rgba, j as insetMap, m as makeGlobalStaticRules, p as parseColor, v as parseCssColor, k as positionMap, l as resolveBreakpoints, r as resolveVerticalBreakpoints, s as splitShorthand, y as valueHandlers, x as xyzMap } from './shared/preset-mini.d9489281.mjs';
|
|
2
|
+
export { a as variantGetBracket, v as variantGetParameter, c as variantMatcher, b as variantParentMatcher } from './shared/preset-mini.816a9399.mjs';
|
|
3
3
|
import '@unocss/core';
|
package/dist/variants.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const _default = require('./shared/preset-mini.
|
|
6
|
-
require('./shared/preset-mini.
|
|
5
|
+
const _default = require('./shared/preset-mini.6f1356df.cjs');
|
|
6
|
+
require('./shared/preset-mini.65179802.cjs');
|
|
7
7
|
require('@unocss/core');
|
|
8
|
-
require('./shared/preset-mini.
|
|
8
|
+
require('./shared/preset-mini.77e00c7b.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|