@unocss/preset-mini 0.39.2 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/default3.cjs +74 -15
- package/dist/chunks/default3.mjs +75 -17
- package/dist/chunks/utilities.cjs +1 -1
- package/dist/chunks/utilities.mjs +1 -1
- package/dist/chunks/variants.cjs +5 -2
- package/dist/chunks/variants.mjs +5 -2
- package/dist/index.cjs +4 -2
- package/dist/index.mjs +4 -2
- package/dist/utils.d.ts +2 -2
- package/dist/variants.cjs +1 -0
- package/dist/variants.d.ts +2 -1
- package/dist/variants.mjs +1 -1
- package/package.json +2 -2
package/dist/chunks/default3.cjs
CHANGED
|
@@ -32,22 +32,35 @@ const variantBreakpoints = {
|
|
|
32
32
|
order -= idx + 1;
|
|
33
33
|
return {
|
|
34
34
|
matcher: m,
|
|
35
|
-
|
|
35
|
+
handle: (input, next) => next({
|
|
36
|
+
...input,
|
|
37
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (max-width: ${calcMaxWidthBySize(size)})`,
|
|
38
|
+
parentOrder: order
|
|
39
|
+
})
|
|
36
40
|
};
|
|
37
41
|
}
|
|
38
42
|
order += idx + 1;
|
|
39
43
|
if (isAtPrefix && idx < variantEntries.length - 1) {
|
|
40
44
|
return {
|
|
41
45
|
matcher: m,
|
|
42
|
-
|
|
46
|
+
handle: (input, next) => next({
|
|
47
|
+
...input,
|
|
48
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (min-width: ${size}) and (max-width: ${calcMaxWidthBySize(variantEntries[idx + 1][1])})`,
|
|
49
|
+
parentOrder: order
|
|
50
|
+
})
|
|
43
51
|
};
|
|
44
52
|
}
|
|
45
53
|
return {
|
|
46
54
|
matcher: m,
|
|
47
|
-
|
|
55
|
+
handle: (input, next) => next({
|
|
56
|
+
...input,
|
|
57
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (min-width: ${size})`,
|
|
58
|
+
parentOrder: order
|
|
59
|
+
})
|
|
48
60
|
};
|
|
49
61
|
}
|
|
50
62
|
},
|
|
63
|
+
multiPass: true,
|
|
51
64
|
autocomplete: "(at-|lt-|)$breakpoints:"
|
|
52
65
|
};
|
|
53
66
|
|
|
@@ -87,17 +100,21 @@ const variantCustomMedia = {
|
|
|
87
100
|
const media = theme.media?.[match[1]] ?? `(--${match[1]})`;
|
|
88
101
|
return {
|
|
89
102
|
matcher: matcher.slice(match[0].length),
|
|
90
|
-
|
|
103
|
+
handle: (input, next) => next({
|
|
104
|
+
...input,
|
|
105
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media ${media}`
|
|
106
|
+
})
|
|
91
107
|
};
|
|
92
108
|
}
|
|
93
|
-
}
|
|
109
|
+
},
|
|
110
|
+
multiPass: true
|
|
94
111
|
};
|
|
95
112
|
|
|
96
113
|
const variantColorsMediaOrClass = (options = {}) => {
|
|
97
114
|
if (options?.dark === "class") {
|
|
98
115
|
return [
|
|
99
|
-
variants$1.variantMatcher("dark", (input) => `.dark $$ ${input}`),
|
|
100
|
-
variants$1.variantMatcher("light", (input) => `.light $$ ${input}`)
|
|
116
|
+
variants$1.variantMatcher("dark", (input) => ({ prefix: `.dark $$ ${input.prefix}` })),
|
|
117
|
+
variants$1.variantMatcher("light", (input) => ({ prefix: `.light $$ ${input.prefix}` }))
|
|
101
118
|
];
|
|
102
119
|
}
|
|
103
120
|
return [
|
|
@@ -107,8 +124,8 @@ const variantColorsMediaOrClass = (options = {}) => {
|
|
|
107
124
|
};
|
|
108
125
|
|
|
109
126
|
const variantLanguageDirections = [
|
|
110
|
-
variants$1.variantMatcher("rtl", (input) => `[dir="rtl"] $$ ${input}`),
|
|
111
|
-
variants$1.variantMatcher("ltr", (input) => `[dir="ltr"] $$ ${input}`)
|
|
127
|
+
variants$1.variantMatcher("rtl", (input) => ({ prefix: `[dir="rtl"] $$ ${input.prefix}` })),
|
|
128
|
+
variants$1.variantMatcher("ltr", (input) => ({ prefix: `[dir="ltr"] $$ ${input.prefix}` }))
|
|
112
129
|
];
|
|
113
130
|
|
|
114
131
|
const variantSelector = {
|
|
@@ -130,7 +147,10 @@ const variantCssLayer = {
|
|
|
130
147
|
if (match) {
|
|
131
148
|
return {
|
|
132
149
|
matcher: matcher.slice(match[0].length),
|
|
133
|
-
|
|
150
|
+
handle: (input, next) => next({
|
|
151
|
+
...input,
|
|
152
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@layer ${match[1]}`
|
|
153
|
+
})
|
|
134
154
|
};
|
|
135
155
|
}
|
|
136
156
|
}
|
|
@@ -159,6 +179,30 @@ const variantScope = {
|
|
|
159
179
|
}
|
|
160
180
|
}
|
|
161
181
|
};
|
|
182
|
+
const variantVariables = {
|
|
183
|
+
name: "variables",
|
|
184
|
+
match(matcher) {
|
|
185
|
+
const match = matcher.match(/^(\[.+?\]):/);
|
|
186
|
+
if (match) {
|
|
187
|
+
const variant = utilities.handler.bracket(match[1]) ?? "";
|
|
188
|
+
return {
|
|
189
|
+
matcher: matcher.slice(match[0].length),
|
|
190
|
+
handle(input, next) {
|
|
191
|
+
const updates = variant.startsWith("@") ? {
|
|
192
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}${variant}`
|
|
193
|
+
} : {
|
|
194
|
+
selector: variant.replace(/&/g, input.selector)
|
|
195
|
+
};
|
|
196
|
+
return next({
|
|
197
|
+
...input,
|
|
198
|
+
...updates
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
multiPass: true
|
|
205
|
+
};
|
|
162
206
|
|
|
163
207
|
const numberRE = /[0-9.]+(?:[a-z]+|%)?/;
|
|
164
208
|
const ignoreProps = [
|
|
@@ -282,7 +326,7 @@ const sortValue = (pseudo) => {
|
|
|
282
326
|
return 1;
|
|
283
327
|
};
|
|
284
328
|
const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
285
|
-
const rawRe = new RegExp(
|
|
329
|
+
const rawRe = new RegExp(`${core.escapeRegExp(parent)}:`);
|
|
286
330
|
const pseudoRE = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))[:-]`);
|
|
287
331
|
const pseudoColonRE = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesColonStr}))[:]`);
|
|
288
332
|
return {
|
|
@@ -295,8 +339,11 @@ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
|
295
339
|
pseudo = `:${match[2]}(${pseudo})`;
|
|
296
340
|
return {
|
|
297
341
|
matcher: input.slice(match[0].length),
|
|
298
|
-
|
|
299
|
-
|
|
342
|
+
handle: (input2, next) => next({
|
|
343
|
+
...input2,
|
|
344
|
+
prefix: rawRe.test(input2.prefix) ? input2.prefix.replace(rawRe, `${parent}${pseudo}:`) : `${parent}${pseudo}${combinator}${input2.prefix}`,
|
|
345
|
+
sort: sortValue(match[3])
|
|
346
|
+
})
|
|
300
347
|
};
|
|
301
348
|
}
|
|
302
349
|
}
|
|
@@ -314,8 +361,18 @@ const variantPseudoClassesAndElements = {
|
|
|
314
361
|
const pseudo = PseudoClasses[match[1]] || PseudoClassesColon[match[1]] || `:${match[1]}`;
|
|
315
362
|
return {
|
|
316
363
|
matcher: input.slice(match[0].length),
|
|
317
|
-
|
|
318
|
-
|
|
364
|
+
handle: (input2, next) => {
|
|
365
|
+
const selectors = pseudo.startsWith("::") ? {
|
|
366
|
+
pseudo: `${input2.pseudo}${pseudo}`
|
|
367
|
+
} : {
|
|
368
|
+
selector: `${input2.selector}${pseudo}`
|
|
369
|
+
};
|
|
370
|
+
return next({
|
|
371
|
+
...input2,
|
|
372
|
+
...selectors,
|
|
373
|
+
sort: sortValue(match[1])
|
|
374
|
+
});
|
|
375
|
+
}
|
|
319
376
|
};
|
|
320
377
|
}
|
|
321
378
|
},
|
|
@@ -376,6 +433,7 @@ const partClasses = {
|
|
|
376
433
|
};
|
|
377
434
|
|
|
378
435
|
const variants = (options) => [
|
|
436
|
+
variantVariables,
|
|
379
437
|
variantCssLayer,
|
|
380
438
|
variantSelector,
|
|
381
439
|
variantInternalLayer,
|
|
@@ -410,4 +468,5 @@ exports.variantPseudoClassesAndElements = variantPseudoClassesAndElements;
|
|
|
410
468
|
exports.variantScope = variantScope;
|
|
411
469
|
exports.variantSelector = variantSelector;
|
|
412
470
|
exports.variantTaggedPseudoClasses = variantTaggedPseudoClasses;
|
|
471
|
+
exports.variantVariables = variantVariables;
|
|
413
472
|
exports.variants = variants;
|
package/dist/chunks/default3.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as resolveBreakpoints, C as CONTROL_MINI_NO_NEGATIVE } from './utilities.mjs';
|
|
1
|
+
import { k as resolveBreakpoints, h as handler, C as CONTROL_MINI_NO_NEGATIVE } from './utilities.mjs';
|
|
2
2
|
import { v as variantParentMatcher, a as variantMatcher } from './variants.mjs';
|
|
3
3
|
import { escapeRegExp } from '@unocss/core';
|
|
4
4
|
|
|
@@ -30,22 +30,35 @@ const variantBreakpoints = {
|
|
|
30
30
|
order -= idx + 1;
|
|
31
31
|
return {
|
|
32
32
|
matcher: m,
|
|
33
|
-
|
|
33
|
+
handle: (input, next) => next({
|
|
34
|
+
...input,
|
|
35
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (max-width: ${calcMaxWidthBySize(size)})`,
|
|
36
|
+
parentOrder: order
|
|
37
|
+
})
|
|
34
38
|
};
|
|
35
39
|
}
|
|
36
40
|
order += idx + 1;
|
|
37
41
|
if (isAtPrefix && idx < variantEntries.length - 1) {
|
|
38
42
|
return {
|
|
39
43
|
matcher: m,
|
|
40
|
-
|
|
44
|
+
handle: (input, next) => next({
|
|
45
|
+
...input,
|
|
46
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (min-width: ${size}) and (max-width: ${calcMaxWidthBySize(variantEntries[idx + 1][1])})`,
|
|
47
|
+
parentOrder: order
|
|
48
|
+
})
|
|
41
49
|
};
|
|
42
50
|
}
|
|
43
51
|
return {
|
|
44
52
|
matcher: m,
|
|
45
|
-
|
|
53
|
+
handle: (input, next) => next({
|
|
54
|
+
...input,
|
|
55
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (min-width: ${size})`,
|
|
56
|
+
parentOrder: order
|
|
57
|
+
})
|
|
46
58
|
};
|
|
47
59
|
}
|
|
48
60
|
},
|
|
61
|
+
multiPass: true,
|
|
49
62
|
autocomplete: "(at-|lt-|)$breakpoints:"
|
|
50
63
|
};
|
|
51
64
|
|
|
@@ -85,17 +98,21 @@ const variantCustomMedia = {
|
|
|
85
98
|
const media = theme.media?.[match[1]] ?? `(--${match[1]})`;
|
|
86
99
|
return {
|
|
87
100
|
matcher: matcher.slice(match[0].length),
|
|
88
|
-
|
|
101
|
+
handle: (input, next) => next({
|
|
102
|
+
...input,
|
|
103
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media ${media}`
|
|
104
|
+
})
|
|
89
105
|
};
|
|
90
106
|
}
|
|
91
|
-
}
|
|
107
|
+
},
|
|
108
|
+
multiPass: true
|
|
92
109
|
};
|
|
93
110
|
|
|
94
111
|
const variantColorsMediaOrClass = (options = {}) => {
|
|
95
112
|
if (options?.dark === "class") {
|
|
96
113
|
return [
|
|
97
|
-
variantMatcher("dark", (input) => `.dark $$ ${input}`),
|
|
98
|
-
variantMatcher("light", (input) => `.light $$ ${input}`)
|
|
114
|
+
variantMatcher("dark", (input) => ({ prefix: `.dark $$ ${input.prefix}` })),
|
|
115
|
+
variantMatcher("light", (input) => ({ prefix: `.light $$ ${input.prefix}` }))
|
|
99
116
|
];
|
|
100
117
|
}
|
|
101
118
|
return [
|
|
@@ -105,8 +122,8 @@ const variantColorsMediaOrClass = (options = {}) => {
|
|
|
105
122
|
};
|
|
106
123
|
|
|
107
124
|
const variantLanguageDirections = [
|
|
108
|
-
variantMatcher("rtl", (input) => `[dir="rtl"] $$ ${input}`),
|
|
109
|
-
variantMatcher("ltr", (input) => `[dir="ltr"] $$ ${input}`)
|
|
125
|
+
variantMatcher("rtl", (input) => ({ prefix: `[dir="rtl"] $$ ${input.prefix}` })),
|
|
126
|
+
variantMatcher("ltr", (input) => ({ prefix: `[dir="ltr"] $$ ${input.prefix}` }))
|
|
110
127
|
];
|
|
111
128
|
|
|
112
129
|
const variantSelector = {
|
|
@@ -128,7 +145,10 @@ const variantCssLayer = {
|
|
|
128
145
|
if (match) {
|
|
129
146
|
return {
|
|
130
147
|
matcher: matcher.slice(match[0].length),
|
|
131
|
-
|
|
148
|
+
handle: (input, next) => next({
|
|
149
|
+
...input,
|
|
150
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@layer ${match[1]}`
|
|
151
|
+
})
|
|
132
152
|
};
|
|
133
153
|
}
|
|
134
154
|
}
|
|
@@ -157,6 +177,30 @@ const variantScope = {
|
|
|
157
177
|
}
|
|
158
178
|
}
|
|
159
179
|
};
|
|
180
|
+
const variantVariables = {
|
|
181
|
+
name: "variables",
|
|
182
|
+
match(matcher) {
|
|
183
|
+
const match = matcher.match(/^(\[.+?\]):/);
|
|
184
|
+
if (match) {
|
|
185
|
+
const variant = handler.bracket(match[1]) ?? "";
|
|
186
|
+
return {
|
|
187
|
+
matcher: matcher.slice(match[0].length),
|
|
188
|
+
handle(input, next) {
|
|
189
|
+
const updates = variant.startsWith("@") ? {
|
|
190
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}${variant}`
|
|
191
|
+
} : {
|
|
192
|
+
selector: variant.replace(/&/g, input.selector)
|
|
193
|
+
};
|
|
194
|
+
return next({
|
|
195
|
+
...input,
|
|
196
|
+
...updates
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
multiPass: true
|
|
203
|
+
};
|
|
160
204
|
|
|
161
205
|
const numberRE = /[0-9.]+(?:[a-z]+|%)?/;
|
|
162
206
|
const ignoreProps = [
|
|
@@ -280,7 +324,7 @@ const sortValue = (pseudo) => {
|
|
|
280
324
|
return 1;
|
|
281
325
|
};
|
|
282
326
|
const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
283
|
-
const rawRe = new RegExp(
|
|
327
|
+
const rawRe = new RegExp(`${escapeRegExp(parent)}:`);
|
|
284
328
|
const pseudoRE = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))[:-]`);
|
|
285
329
|
const pseudoColonRE = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesColonStr}))[:]`);
|
|
286
330
|
return {
|
|
@@ -293,8 +337,11 @@ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
|
293
337
|
pseudo = `:${match[2]}(${pseudo})`;
|
|
294
338
|
return {
|
|
295
339
|
matcher: input.slice(match[0].length),
|
|
296
|
-
|
|
297
|
-
|
|
340
|
+
handle: (input2, next) => next({
|
|
341
|
+
...input2,
|
|
342
|
+
prefix: rawRe.test(input2.prefix) ? input2.prefix.replace(rawRe, `${parent}${pseudo}:`) : `${parent}${pseudo}${combinator}${input2.prefix}`,
|
|
343
|
+
sort: sortValue(match[3])
|
|
344
|
+
})
|
|
298
345
|
};
|
|
299
346
|
}
|
|
300
347
|
}
|
|
@@ -312,8 +359,18 @@ const variantPseudoClassesAndElements = {
|
|
|
312
359
|
const pseudo = PseudoClasses[match[1]] || PseudoClassesColon[match[1]] || `:${match[1]}`;
|
|
313
360
|
return {
|
|
314
361
|
matcher: input.slice(match[0].length),
|
|
315
|
-
|
|
316
|
-
|
|
362
|
+
handle: (input2, next) => {
|
|
363
|
+
const selectors = pseudo.startsWith("::") ? {
|
|
364
|
+
pseudo: `${input2.pseudo}${pseudo}`
|
|
365
|
+
} : {
|
|
366
|
+
selector: `${input2.selector}${pseudo}`
|
|
367
|
+
};
|
|
368
|
+
return next({
|
|
369
|
+
...input2,
|
|
370
|
+
...selectors,
|
|
371
|
+
sort: sortValue(match[1])
|
|
372
|
+
});
|
|
373
|
+
}
|
|
317
374
|
};
|
|
318
375
|
}
|
|
319
376
|
},
|
|
@@ -374,6 +431,7 @@ const partClasses = {
|
|
|
374
431
|
};
|
|
375
432
|
|
|
376
433
|
const variants = (options) => [
|
|
434
|
+
variantVariables,
|
|
377
435
|
variantCssLayer,
|
|
378
436
|
variantSelector,
|
|
379
437
|
variantInternalLayer,
|
|
@@ -392,4 +450,4 @@ const variants = (options) => [
|
|
|
392
450
|
variantScope
|
|
393
451
|
];
|
|
394
452
|
|
|
395
|
-
export { variantBreakpoints as a, variantCombinators as b, variantPrint as c, variantCustomMedia as d, variantColorsMediaOrClass as e, variantLanguageDirections as f, variantSelector as g, variantCssLayer as h, variantInternalLayer as i, variantScope as j,
|
|
453
|
+
export { variantBreakpoints as a, variantCombinators as b, variantPrint as c, variantCustomMedia as d, variantColorsMediaOrClass as e, variantLanguageDirections as f, variantSelector as g, variantCssLayer as h, variantInternalLayer as i, variantScope as j, variantVariables as k, variantPseudoClassesAndElements as l, variantPseudoClassFunctions as m, variantTaggedPseudoClasses as n, variantImportant as o, partClasses as p, variantNegative as q, variants as v };
|
|
@@ -449,7 +449,7 @@ function bracketWithType(str, type) {
|
|
|
449
449
|
else if (type && match[1] === type)
|
|
450
450
|
base = str.slice(match[0].length, -1);
|
|
451
451
|
if (base !== void 0) {
|
|
452
|
-
return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/([^\\])_/g, "$1 ").replace(/calc\((.*)/g, (v) => {
|
|
452
|
+
return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/([^\\])_/g, "$1 ").replace(/(?:calc|clamp|max|min)\((.*)/g, (v) => {
|
|
453
453
|
return v.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ");
|
|
454
454
|
});
|
|
455
455
|
}
|
|
@@ -447,7 +447,7 @@ function bracketWithType(str, type) {
|
|
|
447
447
|
else if (type && match[1] === type)
|
|
448
448
|
base = str.slice(match[0].length, -1);
|
|
449
449
|
if (base !== void 0) {
|
|
450
|
-
return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/([^\\])_/g, "$1 ").replace(/calc\((.*)/g, (v) => {
|
|
450
|
+
return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/([^\\])_/g, "$1 ").replace(/(?:calc|clamp|max|min)\((.*)/g, (v) => {
|
|
451
451
|
return v.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ");
|
|
452
452
|
});
|
|
453
453
|
}
|
package/dist/chunks/variants.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const core = require('@unocss/core');
|
|
4
4
|
|
|
5
|
-
const variantMatcher = (name,
|
|
5
|
+
const variantMatcher = (name, handler) => {
|
|
6
6
|
const re = new RegExp(`^${core.escapeRegExp(name)}[:-]`);
|
|
7
7
|
return {
|
|
8
8
|
name,
|
|
@@ -11,7 +11,10 @@ const variantMatcher = (name, selector) => {
|
|
|
11
11
|
if (match) {
|
|
12
12
|
return {
|
|
13
13
|
matcher: input.slice(match[0].length),
|
|
14
|
-
|
|
14
|
+
handle: (input2, next) => next({
|
|
15
|
+
...input2,
|
|
16
|
+
...handler(input2)
|
|
17
|
+
})
|
|
15
18
|
};
|
|
16
19
|
}
|
|
17
20
|
},
|
package/dist/chunks/variants.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { escapeRegExp } from '@unocss/core';
|
|
2
2
|
|
|
3
|
-
const variantMatcher = (name,
|
|
3
|
+
const variantMatcher = (name, handler) => {
|
|
4
4
|
const re = new RegExp(`^${escapeRegExp(name)}[:-]`);
|
|
5
5
|
return {
|
|
6
6
|
name,
|
|
@@ -9,7 +9,10 @@ const variantMatcher = (name, selector) => {
|
|
|
9
9
|
if (match) {
|
|
10
10
|
return {
|
|
11
11
|
matcher: input.slice(match[0].length),
|
|
12
|
-
|
|
12
|
+
handle: (input2, next) => next({
|
|
13
|
+
...input2,
|
|
14
|
+
...handler(input2)
|
|
15
|
+
})
|
|
13
16
|
};
|
|
14
17
|
}
|
|
15
18
|
},
|
package/dist/index.cjs
CHANGED
|
@@ -15,8 +15,10 @@ const preflights = [
|
|
|
15
15
|
{
|
|
16
16
|
layer: "preflights",
|
|
17
17
|
getCSS(ctx) {
|
|
18
|
-
if (ctx.theme.preflightBase)
|
|
19
|
-
|
|
18
|
+
if (ctx.theme.preflightBase) {
|
|
19
|
+
const css = core.entriesToCss(Object.entries(ctx.theme.preflightBase));
|
|
20
|
+
return `*,::before,::after{${css}}::backdrop{${css}}`;
|
|
21
|
+
}
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
];
|
package/dist/index.mjs
CHANGED
|
@@ -12,8 +12,10 @@ const preflights = [
|
|
|
12
12
|
{
|
|
13
13
|
layer: "preflights",
|
|
14
14
|
getCSS(ctx) {
|
|
15
|
-
if (ctx.theme.preflightBase)
|
|
16
|
-
|
|
15
|
+
if (ctx.theme.preflightBase) {
|
|
16
|
+
const css = entriesToCss(Object.entries(ctx.theme.preflightBase));
|
|
17
|
+
return `*,::before,::after{${css}}::backdrop{${css}}`;
|
|
18
|
+
}
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
];
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _unocss_core from '@unocss/core';
|
|
2
|
-
import { RGBAColorValue, CSSColorValue, VariantObject } from '@unocss/core';
|
|
2
|
+
import { RGBAColorValue, CSSColorValue, VariantHandlerContext, VariantObject } from '@unocss/core';
|
|
3
3
|
export { C as CONTROL_MINI_NO_NEGATIVE, c as colorResolver, a as colorableShadows, d as directionSize, h as hasParseableColor, p as parseColor, r as resolveBreakpoints, b as resolveVerticalBreakpoints } from './utilities-c3da10e0.js';
|
|
4
4
|
import './types-2a2972f5.js';
|
|
5
5
|
|
|
@@ -76,7 +76,7 @@ declare namespace handlers {
|
|
|
76
76
|
declare const handler: _unocss_core.ValueHandler<"number" | "auto" | "global" | "position" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "bracketOfPosition" | "cssvar" | "time" | "degree" | "properties">;
|
|
77
77
|
declare const h: _unocss_core.ValueHandler<"number" | "auto" | "global" | "position" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "bracketOfPosition" | "cssvar" | "time" | "degree" | "properties">;
|
|
78
78
|
|
|
79
|
-
declare const variantMatcher: (name: string,
|
|
79
|
+
declare const variantMatcher: (name: string, handler: (input: VariantHandlerContext) => Record<string, any>) => VariantObject;
|
|
80
80
|
declare const variantParentMatcher: (name: string, parent: string) => VariantObject;
|
|
81
81
|
|
|
82
82
|
export { colorOpacityToString, colorToString, cornerMap, directionMap, getComponents, globalKeywords, h, handler, hex2rgba, insetMap, parseCssColor, positionMap, handlers as valueHandlers, variantMatcher, variantParentMatcher, xyzMap };
|
package/dist/variants.cjs
CHANGED
|
@@ -25,4 +25,5 @@ exports.variantPseudoClassesAndElements = _default.variantPseudoClassesAndElemen
|
|
|
25
25
|
exports.variantScope = _default.variantScope;
|
|
26
26
|
exports.variantSelector = _default.variantSelector;
|
|
27
27
|
exports.variantTaggedPseudoClasses = _default.variantTaggedPseudoClasses;
|
|
28
|
+
exports.variantVariables = _default.variantVariables;
|
|
28
29
|
exports.variants = _default.variants;
|
package/dist/variants.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ declare const variantSelector: Variant;
|
|
|
22
22
|
declare const variantCssLayer: Variant;
|
|
23
23
|
declare const variantInternalLayer: Variant;
|
|
24
24
|
declare const variantScope: Variant;
|
|
25
|
+
declare const variantVariables: Variant;
|
|
25
26
|
|
|
26
27
|
declare const variantPseudoClassesAndElements: VariantObject;
|
|
27
28
|
declare const variantPseudoClassFunctions: VariantObject;
|
|
@@ -32,4 +33,4 @@ declare const variantImportant: Variant;
|
|
|
32
33
|
|
|
33
34
|
declare const variantNegative: Variant;
|
|
34
35
|
|
|
35
|
-
export { partClasses, variantBreakpoints, variantColorsMediaOrClass, variantCombinators, variantCssLayer, variantCustomMedia, variantImportant, variantInternalLayer, variantLanguageDirections, variantNegative, variantPrint, variantPseudoClassFunctions, variantPseudoClassesAndElements, variantScope, variantSelector, variantTaggedPseudoClasses, variants };
|
|
36
|
+
export { partClasses, variantBreakpoints, variantColorsMediaOrClass, variantCombinators, variantCssLayer, variantCustomMedia, variantImportant, variantInternalLayer, variantLanguageDirections, variantNegative, variantPrint, variantPseudoClassFunctions, variantPseudoClassesAndElements, variantScope, variantSelector, variantTaggedPseudoClasses, variantVariables, variants };
|
package/dist/variants.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { p as partClasses, a as variantBreakpoints, e as variantColorsMediaOrClass, b as variantCombinators, h as variantCssLayer, d as variantCustomMedia,
|
|
1
|
+
export { p as partClasses, a as variantBreakpoints, e as variantColorsMediaOrClass, b as variantCombinators, h as variantCssLayer, d as variantCustomMedia, o as variantImportant, i as variantInternalLayer, f as variantLanguageDirections, q as variantNegative, c as variantPrint, m as variantPseudoClassFunctions, l as variantPseudoClassesAndElements, j as variantScope, g as variantSelector, n as variantTaggedPseudoClasses, k as variantVariables, v as variants } from './chunks/default3.mjs';
|
|
2
2
|
import './chunks/utilities.mjs';
|
|
3
3
|
import '@unocss/core';
|
|
4
4
|
import './chunks/variants.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-mini",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"description": "The minimal preset for UnoCSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"*.css"
|
|
62
62
|
],
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@unocss/core": "0.
|
|
64
|
+
"@unocss/core": "0.41.0"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "unbuild",
|