@unocss/preset-mini 0.29.2 → 0.29.5
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/default2.cjs +1 -1
- package/dist/chunks/default2.mjs +1 -1
- package/dist/chunks/default3.cjs +49 -41
- package/dist/chunks/default3.mjs +49 -41
- package/dist/chunks/variants.cjs +22 -16
- package/dist/chunks/variants.mjs +22 -16
- package/dist/utils.d.ts +3 -3
- package/dist/variants.d.ts +3 -3
- package/package.json +2 -2
package/dist/chunks/default2.cjs
CHANGED
|
@@ -63,7 +63,7 @@ const borders = [
|
|
|
63
63
|
[/^(?:border|b)-([rltbse])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
64
64
|
[/^(?:border|b)-(block|inline)-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
65
65
|
[/^(?:border|b)-([bi][se])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
66
|
-
[/^(?:border-|b-)?(?:rounded|rd)()(?:-(.+))?$/, handlerRounded, { autocomplete: ["(border|b)-(rounded
|
|
66
|
+
[/^(?:border-|b-)?(?:rounded|rd)()(?:-(.+))?$/, handlerRounded, { autocomplete: ["(border|b)-(rounded|rd)", "(border|b)-(rounded|rd)-<num>", "(rounded|rd)", "(rounded|rd)-<num>"] }],
|
|
67
67
|
[/^(?:border-|b-)?(?:rounded|rd)-([rltb])(?:-(.+))?$/, handlerRounded],
|
|
68
68
|
[/^(?:border-|b-)?(?:rounded|rd)-([rltb]{2})(?:-(.+))?$/, handlerRounded],
|
|
69
69
|
[/^(?:border-|b-)?(?:rounded|rd)-([bi][se])(?:-(.+))?$/, handlerRounded],
|
package/dist/chunks/default2.mjs
CHANGED
|
@@ -61,7 +61,7 @@ const borders = [
|
|
|
61
61
|
[/^(?:border|b)-([rltbse])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
62
62
|
[/^(?:border|b)-(block|inline)-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
63
63
|
[/^(?:border|b)-([bi][se])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
64
|
-
[/^(?:border-|b-)?(?:rounded|rd)()(?:-(.+))?$/, handlerRounded, { autocomplete: ["(border|b)-(rounded
|
|
64
|
+
[/^(?:border-|b-)?(?:rounded|rd)()(?:-(.+))?$/, handlerRounded, { autocomplete: ["(border|b)-(rounded|rd)", "(border|b)-(rounded|rd)-<num>", "(rounded|rd)", "(rounded|rd)-<num>"] }],
|
|
65
65
|
[/^(?:border-|b-)?(?:rounded|rd)-([rltb])(?:-(.+))?$/, handlerRounded],
|
|
66
66
|
[/^(?:border-|b-)?(?:rounded|rd)-([rltb]{2})(?:-(.+))?$/, handlerRounded],
|
|
67
67
|
[/^(?:border-|b-)?(?:rounded|rd)-([bi][se])(?:-(.+))?$/, handlerRounded],
|
package/dist/chunks/default3.cjs
CHANGED
|
@@ -10,40 +10,43 @@ const calcMaxWidthBySize = (size) => {
|
|
|
10
10
|
const maxWidth = parseFloat(value) - 0.1;
|
|
11
11
|
return Number.isNaN(maxWidth) ? size : `${maxWidth}${unit}`;
|
|
12
12
|
};
|
|
13
|
-
const variantBreakpoints =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
13
|
+
const variantBreakpoints = {
|
|
14
|
+
match(matcher, { theme }) {
|
|
15
|
+
const variantEntries = Object.entries(theme.breakpoints || {}).map(([point, size], idx) => [point, size, idx]);
|
|
16
|
+
for (const [point, size, idx] of variantEntries) {
|
|
17
|
+
if (!regexCache[point])
|
|
18
|
+
regexCache[point] = new RegExp(`^((?:[al]t-)?${point}[:-])`);
|
|
19
|
+
const match = matcher.match(regexCache[point]);
|
|
20
|
+
if (!match)
|
|
21
|
+
continue;
|
|
22
|
+
const [, pre] = match;
|
|
23
|
+
const m = matcher.slice(pre.length);
|
|
24
|
+
if (m === "container")
|
|
25
|
+
continue;
|
|
26
|
+
const isLtPrefix = pre.startsWith("lt-");
|
|
27
|
+
const isAtPrefix = pre.startsWith("at-");
|
|
28
|
+
let order = 1e3;
|
|
29
|
+
if (isLtPrefix) {
|
|
30
|
+
order -= idx + 1;
|
|
31
|
+
return {
|
|
32
|
+
matcher: m,
|
|
33
|
+
parent: [`@media (max-width: ${calcMaxWidthBySize(size)})`, order]
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
order += idx + 1;
|
|
37
|
+
if (isAtPrefix && idx < variantEntries.length - 1) {
|
|
38
|
+
return {
|
|
39
|
+
matcher: m,
|
|
40
|
+
parent: [`@media (min-width: ${size}) and (max-width: ${calcMaxWidthBySize(variantEntries[idx + 1][1])})`, order]
|
|
41
|
+
};
|
|
42
|
+
}
|
|
30
43
|
return {
|
|
31
44
|
matcher: m,
|
|
32
|
-
parent: [`@media (
|
|
45
|
+
parent: [`@media (min-width: ${size})`, order]
|
|
33
46
|
};
|
|
34
47
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return {
|
|
38
|
-
matcher: m,
|
|
39
|
-
parent: [`@media (min-width: ${size}) and (max-width: ${calcMaxWidthBySize(variantEntries[idx + 1][1])})`, order]
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
return {
|
|
43
|
-
matcher: m,
|
|
44
|
-
parent: [`@media (min-width: ${size})`, order]
|
|
45
|
-
};
|
|
46
|
-
}
|
|
48
|
+
},
|
|
49
|
+
autocomplete: "(at-|lt-|)$breakpoints:"
|
|
47
50
|
};
|
|
48
51
|
|
|
49
52
|
const scopeMatcher = (strict, name, template) => {
|
|
@@ -250,15 +253,18 @@ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
|
250
253
|
}
|
|
251
254
|
};
|
|
252
255
|
};
|
|
253
|
-
const variantPseudoElements =
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
256
|
+
const variantPseudoElements = {
|
|
257
|
+
match: (input) => {
|
|
258
|
+
const match = input.match(PseudoElementsRE);
|
|
259
|
+
if (match) {
|
|
260
|
+
const pseudo = PseudoElements[match[1]] || `::${match[1]}`;
|
|
261
|
+
return {
|
|
262
|
+
matcher: input.slice(match[0].length),
|
|
263
|
+
selector: (s) => `${s}${pseudo}`
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
autocomplete: `(${PseudoElementsStr}):`
|
|
262
268
|
};
|
|
263
269
|
const variantPseudoClasses = {
|
|
264
270
|
match: (input) => {
|
|
@@ -272,7 +278,8 @@ const variantPseudoClasses = {
|
|
|
272
278
|
};
|
|
273
279
|
}
|
|
274
280
|
},
|
|
275
|
-
multiPass: true
|
|
281
|
+
multiPass: true,
|
|
282
|
+
autocomplete: `(${PseudoClassesStr}):`
|
|
276
283
|
};
|
|
277
284
|
const variantPseudoClassFunctions = {
|
|
278
285
|
match: (input) => {
|
|
@@ -286,7 +293,8 @@ const variantPseudoClassFunctions = {
|
|
|
286
293
|
};
|
|
287
294
|
}
|
|
288
295
|
},
|
|
289
|
-
multiPass: true
|
|
296
|
+
multiPass: true,
|
|
297
|
+
autocomplete: `(${PseudoClassFunctionsStr})-(${PseudoClassesStr}):`
|
|
290
298
|
};
|
|
291
299
|
const variantTaggedPseudoClasses = (options = {}) => {
|
|
292
300
|
const attributify = !!options?.attributifyPseudo;
|
package/dist/chunks/default3.mjs
CHANGED
|
@@ -8,40 +8,43 @@ const calcMaxWidthBySize = (size) => {
|
|
|
8
8
|
const maxWidth = parseFloat(value) - 0.1;
|
|
9
9
|
return Number.isNaN(maxWidth) ? size : `${maxWidth}${unit}`;
|
|
10
10
|
};
|
|
11
|
-
const variantBreakpoints =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
11
|
+
const variantBreakpoints = {
|
|
12
|
+
match(matcher, { theme }) {
|
|
13
|
+
const variantEntries = Object.entries(theme.breakpoints || {}).map(([point, size], idx) => [point, size, idx]);
|
|
14
|
+
for (const [point, size, idx] of variantEntries) {
|
|
15
|
+
if (!regexCache[point])
|
|
16
|
+
regexCache[point] = new RegExp(`^((?:[al]t-)?${point}[:-])`);
|
|
17
|
+
const match = matcher.match(regexCache[point]);
|
|
18
|
+
if (!match)
|
|
19
|
+
continue;
|
|
20
|
+
const [, pre] = match;
|
|
21
|
+
const m = matcher.slice(pre.length);
|
|
22
|
+
if (m === "container")
|
|
23
|
+
continue;
|
|
24
|
+
const isLtPrefix = pre.startsWith("lt-");
|
|
25
|
+
const isAtPrefix = pre.startsWith("at-");
|
|
26
|
+
let order = 1e3;
|
|
27
|
+
if (isLtPrefix) {
|
|
28
|
+
order -= idx + 1;
|
|
29
|
+
return {
|
|
30
|
+
matcher: m,
|
|
31
|
+
parent: [`@media (max-width: ${calcMaxWidthBySize(size)})`, order]
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
order += idx + 1;
|
|
35
|
+
if (isAtPrefix && idx < variantEntries.length - 1) {
|
|
36
|
+
return {
|
|
37
|
+
matcher: m,
|
|
38
|
+
parent: [`@media (min-width: ${size}) and (max-width: ${calcMaxWidthBySize(variantEntries[idx + 1][1])})`, order]
|
|
39
|
+
};
|
|
40
|
+
}
|
|
28
41
|
return {
|
|
29
42
|
matcher: m,
|
|
30
|
-
parent: [`@media (
|
|
43
|
+
parent: [`@media (min-width: ${size})`, order]
|
|
31
44
|
};
|
|
32
45
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return {
|
|
36
|
-
matcher: m,
|
|
37
|
-
parent: [`@media (min-width: ${size}) and (max-width: ${calcMaxWidthBySize(variantEntries[idx + 1][1])})`, order]
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
return {
|
|
41
|
-
matcher: m,
|
|
42
|
-
parent: [`@media (min-width: ${size})`, order]
|
|
43
|
-
};
|
|
44
|
-
}
|
|
46
|
+
},
|
|
47
|
+
autocomplete: "(at-|lt-|)$breakpoints:"
|
|
45
48
|
};
|
|
46
49
|
|
|
47
50
|
const scopeMatcher = (strict, name, template) => {
|
|
@@ -248,15 +251,18 @@ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
|
248
251
|
}
|
|
249
252
|
};
|
|
250
253
|
};
|
|
251
|
-
const variantPseudoElements =
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
254
|
+
const variantPseudoElements = {
|
|
255
|
+
match: (input) => {
|
|
256
|
+
const match = input.match(PseudoElementsRE);
|
|
257
|
+
if (match) {
|
|
258
|
+
const pseudo = PseudoElements[match[1]] || `::${match[1]}`;
|
|
259
|
+
return {
|
|
260
|
+
matcher: input.slice(match[0].length),
|
|
261
|
+
selector: (s) => `${s}${pseudo}`
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
autocomplete: `(${PseudoElementsStr}):`
|
|
260
266
|
};
|
|
261
267
|
const variantPseudoClasses = {
|
|
262
268
|
match: (input) => {
|
|
@@ -270,7 +276,8 @@ const variantPseudoClasses = {
|
|
|
270
276
|
};
|
|
271
277
|
}
|
|
272
278
|
},
|
|
273
|
-
multiPass: true
|
|
279
|
+
multiPass: true,
|
|
280
|
+
autocomplete: `(${PseudoClassesStr}):`
|
|
274
281
|
};
|
|
275
282
|
const variantPseudoClassFunctions = {
|
|
276
283
|
match: (input) => {
|
|
@@ -284,7 +291,8 @@ const variantPseudoClassFunctions = {
|
|
|
284
291
|
};
|
|
285
292
|
}
|
|
286
293
|
},
|
|
287
|
-
multiPass: true
|
|
294
|
+
multiPass: true,
|
|
295
|
+
autocomplete: `(${PseudoClassFunctionsStr})-(${PseudoClassesStr}):`
|
|
288
296
|
};
|
|
289
297
|
const variantTaggedPseudoClasses = (options = {}) => {
|
|
290
298
|
const attributify = !!options?.attributifyPseudo;
|
package/dist/chunks/variants.cjs
CHANGED
|
@@ -4,26 +4,32 @@ const core = require('@unocss/core');
|
|
|
4
4
|
|
|
5
5
|
const variantMatcher = (name, selector) => {
|
|
6
6
|
const re = new RegExp(`^${core.escapeRegExp(name)}[:-]`);
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
return {
|
|
8
|
+
match: (input) => {
|
|
9
|
+
const match = input.match(re);
|
|
10
|
+
if (match) {
|
|
11
|
+
return {
|
|
12
|
+
matcher: input.slice(match[0].length),
|
|
13
|
+
selector
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
autocomplete: `${name}:`
|
|
15
18
|
};
|
|
16
19
|
};
|
|
17
20
|
const variantParentMatcher = (name, parent) => {
|
|
18
21
|
const re = new RegExp(`^${core.escapeRegExp(name)}[:-]`);
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
return {
|
|
23
|
+
match: (input) => {
|
|
24
|
+
const match = input.match(re);
|
|
25
|
+
if (match) {
|
|
26
|
+
return {
|
|
27
|
+
matcher: input.slice(match[0].length),
|
|
28
|
+
parent
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
autocomplete: `${name}:`
|
|
27
33
|
};
|
|
28
34
|
};
|
|
29
35
|
|
package/dist/chunks/variants.mjs
CHANGED
|
@@ -2,26 +2,32 @@ import { escapeRegExp } from '@unocss/core';
|
|
|
2
2
|
|
|
3
3
|
const variantMatcher = (name, selector) => {
|
|
4
4
|
const re = new RegExp(`^${escapeRegExp(name)}[:-]`);
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
return {
|
|
6
|
+
match: (input) => {
|
|
7
|
+
const match = input.match(re);
|
|
8
|
+
if (match) {
|
|
9
|
+
return {
|
|
10
|
+
matcher: input.slice(match[0].length),
|
|
11
|
+
selector
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
autocomplete: `${name}:`
|
|
13
16
|
};
|
|
14
17
|
};
|
|
15
18
|
const variantParentMatcher = (name, parent) => {
|
|
16
19
|
const re = new RegExp(`^${escapeRegExp(name)}[:-]`);
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
return {
|
|
21
|
+
match: (input) => {
|
|
22
|
+
const match = input.match(re);
|
|
23
|
+
if (match) {
|
|
24
|
+
return {
|
|
25
|
+
matcher: input.slice(match[0].length),
|
|
26
|
+
parent
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
autocomplete: `${name}:`
|
|
25
31
|
};
|
|
26
32
|
};
|
|
27
33
|
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _unocss_core from '@unocss/core';
|
|
2
|
-
import { RGBAColorValue, CSSColorValue,
|
|
2
|
+
import { RGBAColorValue, CSSColorValue, VariantObject } from '@unocss/core';
|
|
3
3
|
export { c as colorResolver, a as colorableShadows, d as directionSize, h as hasParseableColor, p as parseColor } from './utilities-820bcff8.js';
|
|
4
4
|
import './types-f7b2c653.js';
|
|
5
5
|
|
|
@@ -68,7 +68,7 @@ declare namespace handlers {
|
|
|
68
68
|
declare const handler: _unocss_core.ValueHandler<"number" | "global" | "auto" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "cssvar" | "time" | "degree" | "properties">;
|
|
69
69
|
declare const h: _unocss_core.ValueHandler<"number" | "global" | "auto" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "cssvar" | "time" | "degree" | "properties">;
|
|
70
70
|
|
|
71
|
-
declare const variantMatcher: (name: string, selector?: ((input: string) => string | undefined) | undefined) =>
|
|
72
|
-
declare const variantParentMatcher: (name: string, parent: string) =>
|
|
71
|
+
declare const variantMatcher: (name: string, selector?: ((input: string) => string | undefined) | undefined) => VariantObject;
|
|
72
|
+
declare const variantParentMatcher: (name: string, parent: string) => VariantObject;
|
|
73
73
|
|
|
74
74
|
export { colorToString, cornerMap, directionMap, getComponents, h, handler, hex2rgba, insetMap, parseCssColor, positionMap, handlers as valueHandlers, variantMatcher, variantParentMatcher, xyzMap };
|
package/dist/variants.d.ts
CHANGED
|
@@ -9,10 +9,10 @@ declare const variantBreakpoints: Variant<Theme>;
|
|
|
9
9
|
|
|
10
10
|
declare const variantCombinators: Variant[];
|
|
11
11
|
|
|
12
|
-
declare const variantPrint:
|
|
12
|
+
declare const variantPrint: Variant;
|
|
13
13
|
declare const variantCustomMedia: VariantFunction;
|
|
14
14
|
|
|
15
|
-
declare const variantColorsMediaOrClass: (options?: PresetMiniOptions) =>
|
|
15
|
+
declare const variantColorsMediaOrClass: (options?: PresetMiniOptions) => Variant[];
|
|
16
16
|
|
|
17
17
|
declare const variants: (options: PresetMiniOptions) => Variant<Theme>[];
|
|
18
18
|
|
|
@@ -24,7 +24,7 @@ declare const variantScope: Variant;
|
|
|
24
24
|
declare const variantImportant: Variant;
|
|
25
25
|
declare const variantNegative: Variant;
|
|
26
26
|
|
|
27
|
-
declare const variantPseudoElements:
|
|
27
|
+
declare const variantPseudoElements: VariantObject;
|
|
28
28
|
declare const variantPseudoClasses: VariantObject;
|
|
29
29
|
declare const variantPseudoClassFunctions: VariantObject;
|
|
30
30
|
declare const variantTaggedPseudoClasses: (options?: PresetMiniOptions) => VariantObject[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-mini",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.5",
|
|
4
4
|
"description": "The minimal preset for UnoCSS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unocss",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
],
|
|
62
62
|
"sideEffects": false,
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@unocss/core": "0.29.
|
|
64
|
+
"@unocss/core": "0.29.5"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "unbuild",
|