@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,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const colors = require('./preset-mini.
|
|
3
|
+
const colors = require('./preset-mini.65179802.cjs');
|
|
4
4
|
const core = require('@unocss/core');
|
|
5
|
-
const variants$1 = require('./preset-mini.
|
|
5
|
+
const variants$1 = require('./preset-mini.77e00c7b.cjs');
|
|
6
6
|
|
|
7
7
|
const variantAria = {
|
|
8
8
|
name: "aria",
|
|
9
|
-
match(matcher,
|
|
10
|
-
const variant = variants$1.variantGetParameter("aria-", matcher,
|
|
9
|
+
match(matcher, ctx) {
|
|
10
|
+
const variant = variants$1.variantGetParameter("aria-", matcher, ctx.generator.config.separators);
|
|
11
11
|
if (variant) {
|
|
12
12
|
const [match, rest] = variant;
|
|
13
|
-
const aria = colors.handler.bracket(match) ?? theme.aria?.[match] ?? "";
|
|
13
|
+
const aria = colors.handler.bracket(match) ?? ctx.theme.aria?.[match] ?? "";
|
|
14
14
|
if (aria) {
|
|
15
15
|
return {
|
|
16
16
|
matcher: rest,
|
|
@@ -21,74 +21,77 @@ const variantAria = {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
const regexCache = {};
|
|
25
24
|
const calcMaxWidthBySize = (size) => {
|
|
26
25
|
const value = size.match(/^-?[0-9]+\.?[0-9]*/)?.[0] || "";
|
|
27
26
|
const unit = size.slice(value.length);
|
|
28
27
|
const maxWidth = parseFloat(value) - 0.1;
|
|
29
28
|
return Number.isNaN(maxWidth) ? size : `${maxWidth}${unit}`;
|
|
30
29
|
};
|
|
31
|
-
const variantBreakpoints = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
order
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
30
|
+
const variantBreakpoints = () => {
|
|
31
|
+
const regexCache = {};
|
|
32
|
+
return {
|
|
33
|
+
name: "breakpoints",
|
|
34
|
+
match(matcher, context) {
|
|
35
|
+
const variantEntries = Object.entries(colors.resolveBreakpoints(context) ?? {}).map(([point, size], idx) => [point, size, idx]);
|
|
36
|
+
for (const [point, size, idx] of variantEntries) {
|
|
37
|
+
if (!regexCache[point])
|
|
38
|
+
regexCache[point] = new RegExp(`^((?:[al]t-)?${point}(?:${context.generator.config.separators.join("|")}))`);
|
|
39
|
+
const match = matcher.match(regexCache[point]);
|
|
40
|
+
if (!match)
|
|
41
|
+
continue;
|
|
42
|
+
const [, pre] = match;
|
|
43
|
+
const m = matcher.slice(pre.length);
|
|
44
|
+
if (m === "container")
|
|
45
|
+
continue;
|
|
46
|
+
const isLtPrefix = pre.startsWith("lt-");
|
|
47
|
+
const isAtPrefix = pre.startsWith("at-");
|
|
48
|
+
let order = 1e3;
|
|
49
|
+
if (isLtPrefix) {
|
|
50
|
+
order -= idx + 1;
|
|
51
|
+
return {
|
|
52
|
+
matcher: m,
|
|
53
|
+
handle: (input, next) => next({
|
|
54
|
+
...input,
|
|
55
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (max-width: ${calcMaxWidthBySize(size)})`,
|
|
56
|
+
parentOrder: order
|
|
57
|
+
})
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
order += idx + 1;
|
|
61
|
+
if (isAtPrefix && idx < variantEntries.length - 1) {
|
|
62
|
+
return {
|
|
63
|
+
matcher: m,
|
|
64
|
+
handle: (input, next) => next({
|
|
65
|
+
...input,
|
|
66
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (min-width: ${size}) and (max-width: ${calcMaxWidthBySize(variantEntries[idx + 1][1])})`,
|
|
67
|
+
parentOrder: order
|
|
68
|
+
})
|
|
69
|
+
};
|
|
70
|
+
}
|
|
61
71
|
return {
|
|
62
72
|
matcher: m,
|
|
63
73
|
handle: (input, next) => next({
|
|
64
74
|
...input,
|
|
65
|
-
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (min-width: ${size})
|
|
75
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (min-width: ${size})`,
|
|
66
76
|
parentOrder: order
|
|
67
77
|
})
|
|
68
78
|
};
|
|
69
79
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (min-width: ${size})`,
|
|
75
|
-
parentOrder: order
|
|
76
|
-
})
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
multiPass: true,
|
|
81
|
-
autocomplete: "(at-|lt-|)$breakpoints:"
|
|
80
|
+
},
|
|
81
|
+
multiPass: true,
|
|
82
|
+
autocomplete: "(at-|lt-|)$breakpoints:"
|
|
83
|
+
};
|
|
82
84
|
};
|
|
83
85
|
|
|
84
86
|
const scopeMatcher = (name, combinator) => ({
|
|
85
87
|
name: `combinator:${name}`,
|
|
86
|
-
match(matcher) {
|
|
88
|
+
match(matcher, ctx) {
|
|
87
89
|
if (!matcher.startsWith(name))
|
|
88
90
|
return;
|
|
89
|
-
|
|
91
|
+
const separators = ctx.generator.config.separators;
|
|
92
|
+
let body = variants$1.variantGetBracket(`${name}-`, matcher, separators);
|
|
90
93
|
if (!body) {
|
|
91
|
-
for (const separator of
|
|
94
|
+
for (const separator of separators) {
|
|
92
95
|
if (matcher.startsWith(`${name}${separator}`)) {
|
|
93
96
|
body = ["", matcher.slice(name.length + separator.length)];
|
|
94
97
|
break;
|
|
@@ -117,10 +120,10 @@ const variantCombinators = [
|
|
|
117
120
|
|
|
118
121
|
const variantContainerQuery = {
|
|
119
122
|
name: "@",
|
|
120
|
-
match(matcher,
|
|
123
|
+
match(matcher, ctx) {
|
|
121
124
|
if (matcher.startsWith("@container"))
|
|
122
125
|
return;
|
|
123
|
-
const variant = variants$1.variantGetParameter("@", matcher,
|
|
126
|
+
const variant = variants$1.variantGetParameter("@", matcher, ctx.generator.config.separators);
|
|
124
127
|
if (variant) {
|
|
125
128
|
const [match, rest, label] = variant;
|
|
126
129
|
const unbracket = colors.handler.bracket(match);
|
|
@@ -130,7 +133,7 @@ const variantContainerQuery = {
|
|
|
130
133
|
if (minWidth)
|
|
131
134
|
container = `(min-width: ${minWidth})`;
|
|
132
135
|
} else {
|
|
133
|
-
container = theme.containers?.[match] ?? "";
|
|
136
|
+
container = ctx.theme.containers?.[match] ?? "";
|
|
134
137
|
}
|
|
135
138
|
if (container) {
|
|
136
139
|
core.warnOnce("The container query variant is experimental and may not follow semver.");
|
|
@@ -149,11 +152,11 @@ const variantContainerQuery = {
|
|
|
149
152
|
|
|
150
153
|
const variantDataAttribute = {
|
|
151
154
|
name: "data",
|
|
152
|
-
match(matcher,
|
|
153
|
-
const variant = variants$1.variantGetParameter("data-", matcher,
|
|
155
|
+
match(matcher, ctx) {
|
|
156
|
+
const variant = variants$1.variantGetParameter("data-", matcher, ctx.generator.config.separators);
|
|
154
157
|
if (variant) {
|
|
155
158
|
const [match, rest] = variant;
|
|
156
|
-
const dataAttribute = colors.handler.bracket(match) ?? theme.data?.[match] ?? "";
|
|
159
|
+
const dataAttribute = colors.handler.bracket(match) ?? ctx.theme.data?.[match] ?? "";
|
|
157
160
|
if (dataAttribute) {
|
|
158
161
|
return {
|
|
159
162
|
matcher: rest,
|
|
@@ -167,13 +170,13 @@ const variantDataAttribute = {
|
|
|
167
170
|
const variantPrint = variants$1.variantParentMatcher("print", "@media print");
|
|
168
171
|
const variantCustomMedia = {
|
|
169
172
|
name: "media",
|
|
170
|
-
match(matcher,
|
|
171
|
-
const variant = variants$1.variantGetParameter("media-", matcher,
|
|
173
|
+
match(matcher, ctx) {
|
|
174
|
+
const variant = variants$1.variantGetParameter("media-", matcher, ctx.generator.config.separators);
|
|
172
175
|
if (variant) {
|
|
173
176
|
const [match, rest] = variant;
|
|
174
177
|
let media = colors.handler.bracket(match) ?? "";
|
|
175
178
|
if (media === "")
|
|
176
|
-
media = theme.media?.[match] ?? "";
|
|
179
|
+
media = ctx.theme.media?.[match] ?? "";
|
|
177
180
|
if (media) {
|
|
178
181
|
return {
|
|
179
182
|
matcher: rest,
|
|
@@ -190,13 +193,13 @@ const variantCustomMedia = {
|
|
|
190
193
|
|
|
191
194
|
const variantSupports = {
|
|
192
195
|
name: "supports",
|
|
193
|
-
match(matcher,
|
|
194
|
-
const variant = variants$1.variantGetParameter("supports-", matcher,
|
|
196
|
+
match(matcher, ctx) {
|
|
197
|
+
const variant = variants$1.variantGetParameter("supports-", matcher, ctx.generator.config.separators);
|
|
195
198
|
if (variant) {
|
|
196
199
|
const [match, rest] = variant;
|
|
197
200
|
let supports = colors.handler.bracket(match) ?? "";
|
|
198
201
|
if (supports === "")
|
|
199
|
-
supports = theme.supports?.[match] ?? "";
|
|
202
|
+
supports = ctx.theme.supports?.[match] ?? "";
|
|
200
203
|
if (supports) {
|
|
201
204
|
return {
|
|
202
205
|
matcher: rest,
|
|
@@ -232,8 +235,8 @@ const variantLanguageDirections = [
|
|
|
232
235
|
|
|
233
236
|
const variantSelector = {
|
|
234
237
|
name: "selector",
|
|
235
|
-
match(matcher) {
|
|
236
|
-
const variant = variants$1.variantGetBracket("selector-", matcher,
|
|
238
|
+
match(matcher, ctx) {
|
|
239
|
+
const variant = variants$1.variantGetBracket("selector-", matcher, ctx.generator.config.separators);
|
|
237
240
|
if (variant) {
|
|
238
241
|
const [match, rest] = variant;
|
|
239
242
|
const selector = colors.handler.bracket(match);
|
|
@@ -248,8 +251,8 @@ const variantSelector = {
|
|
|
248
251
|
};
|
|
249
252
|
const variantCssLayer = {
|
|
250
253
|
name: "layer",
|
|
251
|
-
match(matcher) {
|
|
252
|
-
const variant = variants$1.variantGetParameter("layer-", matcher,
|
|
254
|
+
match(matcher, ctx) {
|
|
255
|
+
const variant = variants$1.variantGetParameter("layer-", matcher, ctx.generator.config.separators);
|
|
253
256
|
if (variant) {
|
|
254
257
|
const [match, rest] = variant;
|
|
255
258
|
const layer = colors.handler.bracket(match) ?? match;
|
|
@@ -267,8 +270,8 @@ const variantCssLayer = {
|
|
|
267
270
|
};
|
|
268
271
|
const variantInternalLayer = {
|
|
269
272
|
name: "uno-layer",
|
|
270
|
-
match(matcher) {
|
|
271
|
-
const variant = variants$1.variantGetParameter("uno-layer-", matcher,
|
|
273
|
+
match(matcher, ctx) {
|
|
274
|
+
const variant = variants$1.variantGetParameter("uno-layer-", matcher, ctx.generator.config.separators);
|
|
272
275
|
if (variant) {
|
|
273
276
|
const [match, rest] = variant;
|
|
274
277
|
const layer = colors.handler.bracket(match) ?? match;
|
|
@@ -283,8 +286,8 @@ const variantInternalLayer = {
|
|
|
283
286
|
};
|
|
284
287
|
const variantScope = {
|
|
285
288
|
name: "scope",
|
|
286
|
-
match(matcher) {
|
|
287
|
-
const variant = variants$1.variantGetBracket("scope-", matcher,
|
|
289
|
+
match(matcher, ctx) {
|
|
290
|
+
const variant = variants$1.variantGetBracket("scope-", matcher, ctx.generator.config.separators);
|
|
288
291
|
if (variant) {
|
|
289
292
|
const [match, rest] = variant;
|
|
290
293
|
const scope = colors.handler.bracket(match);
|
|
@@ -299,14 +302,14 @@ const variantScope = {
|
|
|
299
302
|
};
|
|
300
303
|
const variantVariables = {
|
|
301
304
|
name: "variables",
|
|
302
|
-
match(matcher) {
|
|
305
|
+
match(matcher, ctx) {
|
|
303
306
|
if (!matcher.startsWith("["))
|
|
304
307
|
return;
|
|
305
308
|
const [match, rest] = colors.getBracket(matcher, "[", "]") ?? [];
|
|
306
309
|
if (!(match && rest))
|
|
307
310
|
return;
|
|
308
311
|
let newMatcher;
|
|
309
|
-
for (const separator of
|
|
312
|
+
for (const separator of ctx.generator.config.separators) {
|
|
310
313
|
if (rest.startsWith(separator)) {
|
|
311
314
|
newMatcher = rest.slice(separator.length);
|
|
312
315
|
break;
|
|
@@ -382,28 +385,33 @@ const variantNegative = {
|
|
|
382
385
|
}
|
|
383
386
|
};
|
|
384
387
|
|
|
385
|
-
const variantImportant = {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
388
|
+
const variantImportant = () => {
|
|
389
|
+
let re;
|
|
390
|
+
return {
|
|
391
|
+
name: "important",
|
|
392
|
+
match(matcher, ctx) {
|
|
393
|
+
if (!re)
|
|
394
|
+
re = new RegExp(`^(important(?:${ctx.generator.config.separators.join("|")})|!)`);
|
|
395
|
+
let base;
|
|
396
|
+
const match = matcher.match(re);
|
|
397
|
+
if (match)
|
|
398
|
+
base = matcher.slice(match[0].length);
|
|
399
|
+
else if (matcher.endsWith("!"))
|
|
400
|
+
base = matcher.slice(0, -1);
|
|
401
|
+
if (base) {
|
|
402
|
+
return {
|
|
403
|
+
matcher: base,
|
|
404
|
+
body: (body) => {
|
|
405
|
+
body.forEach((v) => {
|
|
406
|
+
if (v[1])
|
|
407
|
+
v[1] += " !important";
|
|
408
|
+
});
|
|
409
|
+
return body;
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
}
|
|
405
413
|
}
|
|
406
|
-
}
|
|
414
|
+
};
|
|
407
415
|
};
|
|
408
416
|
|
|
409
417
|
const PseudoClasses = Object.fromEntries([
|
|
@@ -471,8 +479,9 @@ const sortValue = (pseudo) => {
|
|
|
471
479
|
};
|
|
472
480
|
const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
473
481
|
const rawRE = new RegExp(`^(${core.escapeRegExp(parent)}:)(\\S+)${core.escapeRegExp(combinator)}\\1`);
|
|
474
|
-
|
|
475
|
-
|
|
482
|
+
let splitRE;
|
|
483
|
+
let pseudoRE;
|
|
484
|
+
let pseudoColonRE;
|
|
476
485
|
const matchBracket = (input) => {
|
|
477
486
|
const body = variants$1.variantGetBracket(`${tag}-`, input, []);
|
|
478
487
|
if (!body)
|
|
@@ -481,7 +490,7 @@ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
|
481
490
|
const bracketValue = colors.handler.bracket(match);
|
|
482
491
|
if (bracketValue == null)
|
|
483
492
|
return;
|
|
484
|
-
const label = rest.split(
|
|
493
|
+
const label = rest.split(splitRE, 1)?.[0] ?? "";
|
|
485
494
|
const prefix = `${parent}${core.escapeSelector(label)}`;
|
|
486
495
|
return [
|
|
487
496
|
label,
|
|
@@ -507,7 +516,12 @@ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
|
507
516
|
};
|
|
508
517
|
return {
|
|
509
518
|
name: `pseudo:${tag}`,
|
|
510
|
-
match(input) {
|
|
519
|
+
match(input, ctx) {
|
|
520
|
+
if (!(splitRE && pseudoRE && pseudoColonRE)) {
|
|
521
|
+
splitRE = new RegExp(`(?:${ctx.generator.config.separators.join("|")})`);
|
|
522
|
+
pseudoRE = new RegExp(`^${tag}-(?:(?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))(?:(/\\w+))?(?:${ctx.generator.config.separators.join("|")})`);
|
|
523
|
+
pseudoColonRE = new RegExp(`^${tag}-(?:(?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesColonStr}))(?:(/\\w+))?(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`);
|
|
524
|
+
}
|
|
511
525
|
if (!input.startsWith(tag))
|
|
512
526
|
return;
|
|
513
527
|
const result = matchBracket(input) || matchPseudo(input);
|
|
@@ -530,50 +544,62 @@ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
|
530
544
|
};
|
|
531
545
|
const PseudoClassesAndElementsStr = Object.entries(PseudoClasses).map(([key]) => key).join("|");
|
|
532
546
|
const PseudoClassesAndElementsColonStr = Object.entries(PseudoClassesColon).map(([key]) => key).join("|");
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
547
|
+
const variantPseudoClassesAndElements = () => {
|
|
548
|
+
let PseudoClassesAndElementsRE;
|
|
549
|
+
let PseudoClassesAndElementsColonRE;
|
|
550
|
+
return {
|
|
551
|
+
name: "pseudo",
|
|
552
|
+
match(input, ctx) {
|
|
553
|
+
if (!(PseudoClassesAndElementsRE && PseudoClassesAndElementsRE)) {
|
|
554
|
+
PseudoClassesAndElementsRE = new RegExp(`^(${PseudoClassesAndElementsStr})(?:${ctx.generator.config.separators.join("|")})`);
|
|
555
|
+
PseudoClassesAndElementsColonRE = new RegExp(`^(${PseudoClassesAndElementsColonStr})(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`);
|
|
556
|
+
}
|
|
557
|
+
const match = input.match(PseudoClassesAndElementsRE) || input.match(PseudoClassesAndElementsColonRE);
|
|
558
|
+
if (match) {
|
|
559
|
+
const pseudo = PseudoClasses[match[1]] || PseudoClassesColon[match[1]] || `:${match[1]}`;
|
|
560
|
+
return {
|
|
561
|
+
matcher: input.slice(match[0].length),
|
|
562
|
+
handle: (input2, next) => {
|
|
563
|
+
const selectors = pseudo.startsWith("::") ? {
|
|
564
|
+
pseudo: `${input2.pseudo}${pseudo}`
|
|
565
|
+
} : {
|
|
566
|
+
selector: `${input2.selector}${pseudo}`
|
|
567
|
+
};
|
|
568
|
+
return next({
|
|
569
|
+
...input2,
|
|
570
|
+
...selectors,
|
|
571
|
+
sort: sortValue(match[1])
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
multiPass: true,
|
|
578
|
+
autocomplete: `(${PseudoClassesAndElementsStr}|${PseudoClassesAndElementsColonStr}):`
|
|
579
|
+
};
|
|
560
580
|
};
|
|
561
|
-
const
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
581
|
+
const variantPseudoClassFunctions = () => {
|
|
582
|
+
let PseudoClassFunctionsRE;
|
|
583
|
+
let PseudoClassColonFunctionsRE;
|
|
584
|
+
return {
|
|
585
|
+
match(input, ctx) {
|
|
586
|
+
if (!(PseudoClassFunctionsRE && PseudoClassColonFunctionsRE)) {
|
|
587
|
+
PseudoClassFunctionsRE = new RegExp(`^(${PseudoClassFunctionsStr})-(${PseudoClassesStr})(?:${ctx.generator.config.separators.join("|")})`);
|
|
588
|
+
PseudoClassColonFunctionsRE = new RegExp(`^(${PseudoClassFunctionsStr})-(${PseudoClassesColonStr})(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`);
|
|
589
|
+
}
|
|
590
|
+
const match = input.match(PseudoClassFunctionsRE) || input.match(PseudoClassColonFunctionsRE);
|
|
591
|
+
if (match) {
|
|
592
|
+
const fn = match[1];
|
|
593
|
+
const pseudo = PseudoClasses[match[2]] || PseudoClassesColon[match[2]] || `:${match[2]}`;
|
|
594
|
+
return {
|
|
595
|
+
matcher: input.slice(match[0].length),
|
|
596
|
+
selector: (s) => `${s}:${fn}(${pseudo})`
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
},
|
|
600
|
+
multiPass: true,
|
|
601
|
+
autocomplete: `(${PseudoClassFunctionsStr})-(${PseudoClassesStr}|${PseudoClassesColonStr}):`
|
|
602
|
+
};
|
|
577
603
|
};
|
|
578
604
|
const variantTaggedPseudoClasses = (options = {}) => {
|
|
579
605
|
const attributify = !!options?.attributifyPseudo;
|
|
@@ -606,14 +632,14 @@ const variants = (options) => [
|
|
|
606
632
|
variantSelector,
|
|
607
633
|
variantInternalLayer,
|
|
608
634
|
variantNegative,
|
|
609
|
-
variantImportant,
|
|
635
|
+
variantImportant(),
|
|
610
636
|
variantSupports,
|
|
611
637
|
variantPrint,
|
|
612
638
|
variantCustomMedia,
|
|
613
|
-
variantBreakpoints,
|
|
639
|
+
variantBreakpoints(),
|
|
614
640
|
...variantCombinators,
|
|
615
|
-
variantPseudoClassesAndElements,
|
|
616
|
-
variantPseudoClassFunctions,
|
|
641
|
+
variantPseudoClassesAndElements(),
|
|
642
|
+
variantPseudoClassFunctions(),
|
|
617
643
|
...variantTaggedPseudoClasses(options),
|
|
618
644
|
partClasses,
|
|
619
645
|
...variantColorsMediaOrClass(options),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as colors } from './preset-mini.65ac75be.mjs';
|
|
2
|
-
import { P as transformBase, Q as boxShadowsBase, R as ringBase } from './preset-mini.
|
|
3
|
-
import './preset-mini.
|
|
2
|
+
import { P as transformBase, Q as boxShadowsBase, R as ringBase } from './preset-mini.8c7d231d.mjs';
|
|
3
|
+
import './preset-mini.d9489281.mjs';
|
|
4
4
|
import '@unocss/core';
|
|
5
5
|
|
|
6
6
|
const fontFamily = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const decoration = require('./preset-mini.
|
|
4
|
-
const colors = require('./preset-mini.
|
|
3
|
+
const decoration = require('./preset-mini.5d6b20c4.cjs');
|
|
4
|
+
const colors = require('./preset-mini.65179802.cjs');
|
|
5
5
|
const core = require('@unocss/core');
|
|
6
6
|
|
|
7
7
|
const opacity = [
|
|
@@ -214,7 +214,7 @@ const cssVariables = [
|
|
|
214
214
|
}]
|
|
215
215
|
];
|
|
216
216
|
const cssProperty = [
|
|
217
|
-
[/^\[(--(\w|\\\W)+|[\w-]+):(
|
|
217
|
+
[/^\[(--(\w|\\\W)+|[\w-]+):([^:].*)\]$/, ([match, prop, , value]) => {
|
|
218
218
|
if (!isURI(match.slice(1, -1)))
|
|
219
219
|
return { [prop]: colors.handler.bracket(`[${value}]`) };
|
|
220
220
|
}]
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const core = require('@unocss/core');
|
|
4
|
-
const colors = require('./preset-mini.
|
|
4
|
+
const colors = require('./preset-mini.65179802.cjs');
|
|
5
5
|
|
|
6
6
|
const variantMatcher = (name, handler) => {
|
|
7
|
-
|
|
7
|
+
let re;
|
|
8
8
|
return {
|
|
9
9
|
name,
|
|
10
|
-
match(input) {
|
|
10
|
+
match(input, ctx) {
|
|
11
|
+
if (!re)
|
|
12
|
+
re = new RegExp(`^${core.escapeRegExp(name)}(?:${ctx.generator.config.separators.join("|")})`);
|
|
11
13
|
const match = input.match(re);
|
|
12
14
|
if (match) {
|
|
13
15
|
return {
|
|
@@ -23,10 +25,12 @@ const variantMatcher = (name, handler) => {
|
|
|
23
25
|
};
|
|
24
26
|
};
|
|
25
27
|
const variantParentMatcher = (name, parent) => {
|
|
26
|
-
|
|
28
|
+
let re;
|
|
27
29
|
return {
|
|
28
30
|
name,
|
|
29
|
-
match(input) {
|
|
31
|
+
match(input, ctx) {
|
|
32
|
+
if (!re)
|
|
33
|
+
re = new RegExp(`^${core.escapeRegExp(name)}(?:${ctx.generator.config.separators.join("|")})`);
|
|
30
34
|
const match = input.match(re);
|
|
31
35
|
if (match) {
|
|
32
36
|
return {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { escapeRegExp } from '@unocss/core';
|
|
2
|
-
import { q as getBracket } from './preset-mini.
|
|
2
|
+
import { q as getBracket } from './preset-mini.d9489281.mjs';
|
|
3
3
|
|
|
4
4
|
const variantMatcher = (name, handler) => {
|
|
5
|
-
|
|
5
|
+
let re;
|
|
6
6
|
return {
|
|
7
7
|
name,
|
|
8
|
-
match(input) {
|
|
8
|
+
match(input, ctx) {
|
|
9
|
+
if (!re)
|
|
10
|
+
re = new RegExp(`^${escapeRegExp(name)}(?:${ctx.generator.config.separators.join("|")})`);
|
|
9
11
|
const match = input.match(re);
|
|
10
12
|
if (match) {
|
|
11
13
|
return {
|
|
@@ -21,10 +23,12 @@ const variantMatcher = (name, handler) => {
|
|
|
21
23
|
};
|
|
22
24
|
};
|
|
23
25
|
const variantParentMatcher = (name, parent) => {
|
|
24
|
-
|
|
26
|
+
let re;
|
|
25
27
|
return {
|
|
26
28
|
name,
|
|
27
|
-
match(input) {
|
|
29
|
+
match(input, ctx) {
|
|
30
|
+
if (!re)
|
|
31
|
+
re = new RegExp(`^${escapeRegExp(name)}(?:${ctx.generator.config.separators.join("|")})`);
|
|
28
32
|
const match = input.match(re);
|
|
29
33
|
if (match) {
|
|
30
34
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as globalKeywords, h as handler, c as colorResolver, d as directionMap, a as hasParseableColor, b as cornerMap, p as parseColor, e as colorToString, f as colorOpacityToString, m as makeGlobalStaticRules, s as splitShorthand, i as colorableShadows, j as insetMap, k as positionMap, x as xyzMap } from './preset-mini.
|
|
1
|
+
import { g as globalKeywords, h as handler, c as colorResolver, d as directionMap, a as hasParseableColor, b as cornerMap, p as parseColor, e as colorToString, f as colorOpacityToString, m as makeGlobalStaticRules, s as splitShorthand, i as colorableShadows, j as insetMap, k as positionMap, x as xyzMap } from './preset-mini.d9489281.mjs';
|
|
2
2
|
import { toArray } from '@unocss/core';
|
|
3
3
|
|
|
4
4
|
const verticalAlignAlias = {
|
|
@@ -69,9 +69,9 @@ const borders = [
|
|
|
69
69
|
[/^(?:border|b)-(block|inline)-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
70
70
|
[/^(?:border|b)-([bi][se])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
71
71
|
[/^(?:border-|b-)?(?:rounded|rd)()(?:-(.+))?$/, handlerRounded, { autocomplete: ["(border|b)-(rounded|rd)", "(border|b)-(rounded|rd)-<num>", "(rounded|rd)", "(rounded|rd)-<num>"] }],
|
|
72
|
-
[/^(?:border-|b-)?(?:rounded|rd)-([
|
|
72
|
+
[/^(?:border-|b-)?(?:rounded|rd)-([rltbse])(?:-(.+))?$/, handlerRounded],
|
|
73
73
|
[/^(?:border-|b-)?(?:rounded|rd)-([rltb]{2})(?:-(.+))?$/, handlerRounded],
|
|
74
|
-
[/^(?:border-|b-)?(?:rounded|rd)-([
|
|
74
|
+
[/^(?:border-|b-)?(?:rounded|rd)-([bise][se])(?:-(.+))?$/, handlerRounded],
|
|
75
75
|
[/^(?:border-|b-)?(?:rounded|rd)-([bi][se]-[bi][se])(?:-(.+))?$/, handlerRounded],
|
|
76
76
|
[/^(?:border|b)-(?:style-)?()(.+)$/, handlerBorderStyle, { autocomplete: ["(border|b)-style", `(border|b)-(${borderStyles.join("|")})`, "(border|b)-<directions>-style", `(border|b)-<directions>-(${borderStyles.join("|")})`, `(border|b)-<directions>-style-(${borderStyles.join("|")})`, `(border|b)-style-(${borderStyles.join("|")})`] }],
|
|
77
77
|
[/^(?:border|b)-([xy])-(?:style-)?(.+)$/, handlerBorderStyle],
|
|
@@ -141,7 +141,7 @@ function handlerBorderStyle([, a = "", s]) {
|
|
|
141
141
|
|
|
142
142
|
const transitionPropertyGroup = {
|
|
143
143
|
all: "all",
|
|
144
|
-
colors: ["color", "background-color", "border-color", "text-decoration-color", "fill", "stroke"].join(","),
|
|
144
|
+
colors: ["color", "background-color", "border-color", "outline-color", "text-decoration-color", "fill", "stroke"].join(","),
|
|
145
145
|
none: "none",
|
|
146
146
|
opacity: "opacity",
|
|
147
147
|
shadow: "box-shadow",
|
|
@@ -405,6 +405,7 @@ const insets = [
|
|
|
405
405
|
]
|
|
406
406
|
}
|
|
407
407
|
],
|
|
408
|
+
[/^(?:position-|pos-)?(start|end)-(.+)$/, handleInsetValues],
|
|
408
409
|
[/^(?:position-|pos-)?inset-([xy])-(.+)$/, handleInsetValues],
|
|
409
410
|
[/^(?:position-|pos-)?inset-([rltbse])-(.+)$/, handleInsetValues],
|
|
410
411
|
[/^(?:position-|pos-)?inset-(block|inline)-(.+)$/, handleInsetValues],
|