@unocss/preset-mini 0.16.0 → 0.16.4
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 +291 -225
- package/dist/chunks/default2.mjs +234 -170
- package/dist/chunks/default3.cjs +16 -11
- package/dist/chunks/default3.mjs +16 -11
- package/dist/chunks/pseudo.cjs +36 -30
- package/dist/chunks/pseudo.mjs +36 -30
- package/dist/chunks/{index.cjs → utilities.cjs} +19 -2
- package/dist/chunks/{index.mjs → utilities.mjs} +19 -3
- package/dist/chunks/variants.cjs +8 -6
- package/dist/chunks/variants.mjs +8 -6
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/rules.cjs +4 -2
- package/dist/rules.d.ts +5 -2
- package/dist/rules.mjs +2 -2
- package/dist/utils.cjs +9 -8
- package/dist/utils.d.ts +8 -4
- package/dist/utils.mjs +1 -1
- package/dist/variants.cjs +2 -2
- package/dist/variants.d.ts +3 -3
- package/dist/variants.mjs +2 -2
- package/package.json +2 -2
package/dist/chunks/default3.mjs
CHANGED
|
@@ -6,20 +6,22 @@ const variantBreakpoints = (matcher, _, theme) => {
|
|
|
6
6
|
const variantEntries = Object.entries(theme.breakpoints || {}).map(([point, size], idx) => [point, size, idx]);
|
|
7
7
|
for (const [point, size, idx] of variantEntries) {
|
|
8
8
|
if (!regexCache[point])
|
|
9
|
-
regexCache[point] = new RegExp(`^((?:[
|
|
9
|
+
regexCache[point] = new RegExp(`^((?:[al]t-)?${point}[:-])`);
|
|
10
10
|
const match = matcher.match(regexCache[point]);
|
|
11
11
|
if (!match)
|
|
12
12
|
continue;
|
|
13
13
|
const [, pre] = match;
|
|
14
|
+
const m = matcher.slice(pre.length);
|
|
15
|
+
if (m === "container")
|
|
16
|
+
continue;
|
|
14
17
|
let direction = "min";
|
|
15
|
-
let order =
|
|
18
|
+
let order = 1e3;
|
|
16
19
|
if (pre.startsWith("lt-")) {
|
|
17
20
|
direction = "max";
|
|
18
|
-
order
|
|
21
|
+
order -= idx + 1;
|
|
22
|
+
} else {
|
|
23
|
+
order += idx + 1;
|
|
19
24
|
}
|
|
20
|
-
const m = matcher.slice(pre.length);
|
|
21
|
-
if (m === "container")
|
|
22
|
-
continue;
|
|
23
25
|
if (pre.startsWith("at-") && idx < variantEntries.length - 1) {
|
|
24
26
|
return {
|
|
25
27
|
matcher: m,
|
|
@@ -33,10 +35,13 @@ const variantBreakpoints = (matcher, _, theme) => {
|
|
|
33
35
|
}
|
|
34
36
|
};
|
|
35
37
|
|
|
36
|
-
const
|
|
37
|
-
variantMatcher("children", (input) => `${input} > *`),
|
|
38
|
+
const variantCombinators = [
|
|
38
39
|
variantMatcher("all", (input) => `${input} *`),
|
|
39
|
-
variantMatcher("
|
|
40
|
+
variantMatcher("children", (input) => `${input}>*`),
|
|
41
|
+
variantMatcher("next", (input) => `${input}+*`),
|
|
42
|
+
variantMatcher("sibling", (input) => `${input}+*`),
|
|
43
|
+
variantMatcher("siblings", (input) => `${input}~*`),
|
|
44
|
+
variantMatcher("svg", (input) => `${input} svg *`)
|
|
40
45
|
];
|
|
41
46
|
|
|
42
47
|
const variantColorsClass = [
|
|
@@ -111,9 +116,9 @@ const variants = [
|
|
|
111
116
|
variantNegative,
|
|
112
117
|
variantImportant,
|
|
113
118
|
variantBreakpoints,
|
|
114
|
-
...
|
|
119
|
+
...variantCombinators,
|
|
115
120
|
variantPseudoClasses,
|
|
116
121
|
variantPseudoElements
|
|
117
122
|
];
|
|
118
123
|
|
|
119
|
-
export { variantColorsMedia as a, variantColorsClass as b, variantBreakpoints as c,
|
|
124
|
+
export { variantColorsMedia as a, variantColorsClass as b, variantBreakpoints as c, variantCombinators as d, variantImportant as e, variantNegative as f, variantSpace as g, variants as v };
|
package/dist/chunks/pseudo.cjs
CHANGED
|
@@ -2,40 +2,42 @@
|
|
|
2
2
|
|
|
3
3
|
const core = require('@unocss/core');
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const CONTROL_BYPASS_PSEUDO_CLASS = "$$no-pseudo";
|
|
6
6
|
const PseudoClasses = Object.fromEntries([
|
|
7
|
+
"any-link",
|
|
8
|
+
"link",
|
|
9
|
+
"visited",
|
|
10
|
+
"target",
|
|
11
|
+
"hover",
|
|
7
12
|
"active",
|
|
8
|
-
"checked",
|
|
9
|
-
"default",
|
|
10
|
-
"empty",
|
|
11
|
-
"enabled",
|
|
12
|
-
"disabled",
|
|
13
|
-
"first-of-type",
|
|
14
|
-
["first", "first-child"],
|
|
15
13
|
"focus-visible",
|
|
16
14
|
"focus-within",
|
|
17
15
|
"focus",
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"last-of-type",
|
|
22
|
-
["last", "last-child"],
|
|
23
|
-
"link",
|
|
24
|
-
"only-child",
|
|
25
|
-
"only-of-type",
|
|
26
|
-
"optional",
|
|
27
|
-
"placeholder-shown",
|
|
16
|
+
"autofill",
|
|
17
|
+
"enabled",
|
|
18
|
+
"disabled",
|
|
28
19
|
"read-only",
|
|
29
20
|
"read-write",
|
|
21
|
+
"placeholder-shown",
|
|
22
|
+
"default",
|
|
23
|
+
"checked",
|
|
24
|
+
"indeterminate",
|
|
25
|
+
"valid",
|
|
26
|
+
"invalid",
|
|
30
27
|
"required",
|
|
28
|
+
"optional",
|
|
31
29
|
"root",
|
|
32
|
-
"
|
|
33
|
-
"valid",
|
|
34
|
-
"visited",
|
|
30
|
+
"empty",
|
|
35
31
|
["even-of-type", "nth-of-type(even)"],
|
|
36
32
|
["even", "nth-child(even)"],
|
|
37
33
|
["odd-of-type", "nth-of-type(odd)"],
|
|
38
|
-
["odd", "nth-child(odd)"]
|
|
34
|
+
["odd", "nth-child(odd)"],
|
|
35
|
+
"first-of-type",
|
|
36
|
+
["first", "first-child"],
|
|
37
|
+
"last-of-type",
|
|
38
|
+
["last", "last-child"],
|
|
39
|
+
"only-child",
|
|
40
|
+
"only-of-type"
|
|
39
41
|
].map(core.toArray));
|
|
40
42
|
const PseudoElements = [
|
|
41
43
|
"before",
|
|
@@ -48,19 +50,19 @@ const PseudoElementsRE = new RegExp(`^(${PseudoElements.join("|")})[:-]`);
|
|
|
48
50
|
const PseudoClassesStr = Object.keys(PseudoClasses).join("|");
|
|
49
51
|
const PseudoClassesRE = new RegExp(`^(${PseudoClassesStr})[:-]`);
|
|
50
52
|
const PseudoClassesNotRE = new RegExp(`^not-(${PseudoClassesStr})[:-]`);
|
|
51
|
-
const PseudoClassesGroupRE = new RegExp(`^group-(${PseudoClassesStr})[:-]`);
|
|
52
|
-
const PseudoClassesPeerRE = new RegExp(`^peer-(${PseudoClassesStr})[:-]`);
|
|
53
|
+
const PseudoClassesGroupRE = new RegExp(`^group-((not-)?(${PseudoClassesStr}))[:-]`);
|
|
54
|
+
const PseudoClassesPeerRE = new RegExp(`^peer-((not-)?(${PseudoClassesStr}))[:-]`);
|
|
53
55
|
const variantPseudoElements = (input) => {
|
|
54
56
|
const match = input.match(PseudoElementsRE);
|
|
55
57
|
if (match) {
|
|
56
58
|
return {
|
|
57
59
|
matcher: input.slice(match[1].length + 1),
|
|
58
|
-
selector: (s
|
|
60
|
+
selector: (s) => `${s}::${match[1]}`
|
|
59
61
|
};
|
|
60
62
|
}
|
|
61
63
|
};
|
|
62
64
|
function shouldAdd(entires) {
|
|
63
|
-
return !entires.find((i) => i[0] ===
|
|
65
|
+
return !entires.find((i) => i[0] === CONTROL_BYPASS_PSEUDO_CLASS) || void 0;
|
|
64
66
|
}
|
|
65
67
|
const variantPseudoClasses = {
|
|
66
68
|
match: (input) => {
|
|
@@ -82,7 +84,9 @@ const variantPseudoClasses = {
|
|
|
82
84
|
}
|
|
83
85
|
match = input.match(PseudoClassesGroupRE);
|
|
84
86
|
if (match) {
|
|
85
|
-
|
|
87
|
+
let pseudo = PseudoClasses[match[3]] || match[3];
|
|
88
|
+
if (match[2])
|
|
89
|
+
pseudo = `not(:${pseudo})`;
|
|
86
90
|
return {
|
|
87
91
|
matcher: input.slice(match[1].length + 7),
|
|
88
92
|
selector: (s, body) => shouldAdd(body) && s.includes(".group:") ? s.replace(/\.group:/, `.group:${pseudo}:`) : `.group:${pseudo} ${s}`
|
|
@@ -90,17 +94,19 @@ const variantPseudoClasses = {
|
|
|
90
94
|
}
|
|
91
95
|
match = input.match(PseudoClassesPeerRE);
|
|
92
96
|
if (match) {
|
|
93
|
-
|
|
97
|
+
let pseudo = PseudoClasses[match[3]] || match[3];
|
|
98
|
+
if (match[2])
|
|
99
|
+
pseudo = `not(:${pseudo})`;
|
|
94
100
|
return {
|
|
95
101
|
matcher: input.slice(match[1].length + 6),
|
|
96
|
-
selector: (s, body) => shouldAdd(body) && s.includes(".peer:") ? s.replace(/\.peer:/, `.peer:${pseudo}:`) : `.peer:${pseudo}
|
|
102
|
+
selector: (s, body) => shouldAdd(body) && s.includes(".peer:") ? s.replace(/\.peer:/, `.peer:${pseudo}:`) : `.peer:${pseudo}~${s}`
|
|
97
103
|
};
|
|
98
104
|
}
|
|
99
105
|
},
|
|
100
106
|
multiPass: true
|
|
101
107
|
};
|
|
102
108
|
|
|
103
|
-
exports.
|
|
109
|
+
exports.CONTROL_BYPASS_PSEUDO_CLASS = CONTROL_BYPASS_PSEUDO_CLASS;
|
|
104
110
|
exports.PseudoClasses = PseudoClasses;
|
|
105
111
|
exports.variantPseudoClasses = variantPseudoClasses;
|
|
106
112
|
exports.variantPseudoElements = variantPseudoElements;
|
package/dist/chunks/pseudo.mjs
CHANGED
|
@@ -1,39 +1,41 @@
|
|
|
1
1
|
import { toArray } from '@unocss/core';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const CONTROL_BYPASS_PSEUDO_CLASS = "$$no-pseudo";
|
|
4
4
|
const PseudoClasses = Object.fromEntries([
|
|
5
|
+
"any-link",
|
|
6
|
+
"link",
|
|
7
|
+
"visited",
|
|
8
|
+
"target",
|
|
9
|
+
"hover",
|
|
5
10
|
"active",
|
|
6
|
-
"checked",
|
|
7
|
-
"default",
|
|
8
|
-
"empty",
|
|
9
|
-
"enabled",
|
|
10
|
-
"disabled",
|
|
11
|
-
"first-of-type",
|
|
12
|
-
["first", "first-child"],
|
|
13
11
|
"focus-visible",
|
|
14
12
|
"focus-within",
|
|
15
13
|
"focus",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"last-of-type",
|
|
20
|
-
["last", "last-child"],
|
|
21
|
-
"link",
|
|
22
|
-
"only-child",
|
|
23
|
-
"only-of-type",
|
|
24
|
-
"optional",
|
|
25
|
-
"placeholder-shown",
|
|
14
|
+
"autofill",
|
|
15
|
+
"enabled",
|
|
16
|
+
"disabled",
|
|
26
17
|
"read-only",
|
|
27
18
|
"read-write",
|
|
19
|
+
"placeholder-shown",
|
|
20
|
+
"default",
|
|
21
|
+
"checked",
|
|
22
|
+
"indeterminate",
|
|
23
|
+
"valid",
|
|
24
|
+
"invalid",
|
|
28
25
|
"required",
|
|
26
|
+
"optional",
|
|
29
27
|
"root",
|
|
30
|
-
"
|
|
31
|
-
"valid",
|
|
32
|
-
"visited",
|
|
28
|
+
"empty",
|
|
33
29
|
["even-of-type", "nth-of-type(even)"],
|
|
34
30
|
["even", "nth-child(even)"],
|
|
35
31
|
["odd-of-type", "nth-of-type(odd)"],
|
|
36
|
-
["odd", "nth-child(odd)"]
|
|
32
|
+
["odd", "nth-child(odd)"],
|
|
33
|
+
"first-of-type",
|
|
34
|
+
["first", "first-child"],
|
|
35
|
+
"last-of-type",
|
|
36
|
+
["last", "last-child"],
|
|
37
|
+
"only-child",
|
|
38
|
+
"only-of-type"
|
|
37
39
|
].map(toArray));
|
|
38
40
|
const PseudoElements = [
|
|
39
41
|
"before",
|
|
@@ -46,19 +48,19 @@ const PseudoElementsRE = new RegExp(`^(${PseudoElements.join("|")})[:-]`);
|
|
|
46
48
|
const PseudoClassesStr = Object.keys(PseudoClasses).join("|");
|
|
47
49
|
const PseudoClassesRE = new RegExp(`^(${PseudoClassesStr})[:-]`);
|
|
48
50
|
const PseudoClassesNotRE = new RegExp(`^not-(${PseudoClassesStr})[:-]`);
|
|
49
|
-
const PseudoClassesGroupRE = new RegExp(`^group-(${PseudoClassesStr})[:-]`);
|
|
50
|
-
const PseudoClassesPeerRE = new RegExp(`^peer-(${PseudoClassesStr})[:-]`);
|
|
51
|
+
const PseudoClassesGroupRE = new RegExp(`^group-((not-)?(${PseudoClassesStr}))[:-]`);
|
|
52
|
+
const PseudoClassesPeerRE = new RegExp(`^peer-((not-)?(${PseudoClassesStr}))[:-]`);
|
|
51
53
|
const variantPseudoElements = (input) => {
|
|
52
54
|
const match = input.match(PseudoElementsRE);
|
|
53
55
|
if (match) {
|
|
54
56
|
return {
|
|
55
57
|
matcher: input.slice(match[1].length + 1),
|
|
56
|
-
selector: (s
|
|
58
|
+
selector: (s) => `${s}::${match[1]}`
|
|
57
59
|
};
|
|
58
60
|
}
|
|
59
61
|
};
|
|
60
62
|
function shouldAdd(entires) {
|
|
61
|
-
return !entires.find((i) => i[0] ===
|
|
63
|
+
return !entires.find((i) => i[0] === CONTROL_BYPASS_PSEUDO_CLASS) || void 0;
|
|
62
64
|
}
|
|
63
65
|
const variantPseudoClasses = {
|
|
64
66
|
match: (input) => {
|
|
@@ -80,7 +82,9 @@ const variantPseudoClasses = {
|
|
|
80
82
|
}
|
|
81
83
|
match = input.match(PseudoClassesGroupRE);
|
|
82
84
|
if (match) {
|
|
83
|
-
|
|
85
|
+
let pseudo = PseudoClasses[match[3]] || match[3];
|
|
86
|
+
if (match[2])
|
|
87
|
+
pseudo = `not(:${pseudo})`;
|
|
84
88
|
return {
|
|
85
89
|
matcher: input.slice(match[1].length + 7),
|
|
86
90
|
selector: (s, body) => shouldAdd(body) && s.includes(".group:") ? s.replace(/\.group:/, `.group:${pseudo}:`) : `.group:${pseudo} ${s}`
|
|
@@ -88,14 +92,16 @@ const variantPseudoClasses = {
|
|
|
88
92
|
}
|
|
89
93
|
match = input.match(PseudoClassesPeerRE);
|
|
90
94
|
if (match) {
|
|
91
|
-
|
|
95
|
+
let pseudo = PseudoClasses[match[3]] || match[3];
|
|
96
|
+
if (match[2])
|
|
97
|
+
pseudo = `not(:${pseudo})`;
|
|
92
98
|
return {
|
|
93
99
|
matcher: input.slice(match[1].length + 6),
|
|
94
|
-
selector: (s, body) => shouldAdd(body) && s.includes(".peer:") ? s.replace(/\.peer:/, `.peer:${pseudo}:`) : `.peer:${pseudo}
|
|
100
|
+
selector: (s, body) => shouldAdd(body) && s.includes(".peer:") ? s.replace(/\.peer:/, `.peer:${pseudo}:`) : `.peer:${pseudo}~${s}`
|
|
95
101
|
};
|
|
96
102
|
}
|
|
97
103
|
},
|
|
98
104
|
multiPass: true
|
|
99
105
|
};
|
|
100
106
|
|
|
101
|
-
export {
|
|
107
|
+
export { CONTROL_BYPASS_PSEUDO_CLASS as C, PseudoClasses as P, variantPseudoElements as a, variantPseudoClasses as v };
|
|
@@ -39,6 +39,16 @@ const xyzMap = {
|
|
|
39
39
|
const numberWithUnitRE = /^(-?[0-9.]+)(px|pt|pc|rem|em|%|vh|vw|in|cm|mm|ex|ch|vmin|vmax)?$/i;
|
|
40
40
|
const numberRE = /^(-?[0-9.]+)$/i;
|
|
41
41
|
const unitOnlyRE = /^(px)$/i;
|
|
42
|
+
function numberWithUnit(str) {
|
|
43
|
+
if (str === "auto" || str === "a")
|
|
44
|
+
return "auto";
|
|
45
|
+
const match = str.match(numberWithUnitRE);
|
|
46
|
+
if (!match)
|
|
47
|
+
return;
|
|
48
|
+
const [, , unit] = match;
|
|
49
|
+
if (unit)
|
|
50
|
+
return str;
|
|
51
|
+
}
|
|
42
52
|
function rem(str) {
|
|
43
53
|
if (str === "auto" || str === "a")
|
|
44
54
|
return "auto";
|
|
@@ -104,17 +114,18 @@ function time(str) {
|
|
|
104
114
|
const duration = Number(str.replace(/(s|ms)$/, ""));
|
|
105
115
|
if (isNaN(duration))
|
|
106
116
|
return;
|
|
107
|
-
if (/ms
|
|
117
|
+
if (/(s|ms)$/.test(str))
|
|
108
118
|
return str;
|
|
109
119
|
return `${str}ms`;
|
|
110
120
|
}
|
|
111
121
|
function global(str) {
|
|
112
|
-
if (["inherit", "initial", "unset"].includes(str))
|
|
122
|
+
if (["inherit", "initial", "revert", "unset"].includes(str))
|
|
113
123
|
return str;
|
|
114
124
|
}
|
|
115
125
|
|
|
116
126
|
const valueHandlers = {
|
|
117
127
|
__proto__: null,
|
|
128
|
+
numberWithUnit: numberWithUnit,
|
|
118
129
|
rem: rem,
|
|
119
130
|
px: px,
|
|
120
131
|
number: number,
|
|
@@ -132,10 +143,16 @@ const h = handler;
|
|
|
132
143
|
function capitalize(str) {
|
|
133
144
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
134
145
|
}
|
|
146
|
+
const directionSize = (prefix) => ([_, direction, size]) => {
|
|
147
|
+
const v = handler.bracket.rem.fraction.cssvar(size);
|
|
148
|
+
if (v)
|
|
149
|
+
return directionMap[direction].map((i) => [prefix + i, v]);
|
|
150
|
+
};
|
|
135
151
|
|
|
136
152
|
exports.capitalize = capitalize;
|
|
137
153
|
exports.cornerMap = cornerMap;
|
|
138
154
|
exports.directionMap = directionMap;
|
|
155
|
+
exports.directionSize = directionSize;
|
|
139
156
|
exports.h = h;
|
|
140
157
|
exports.handler = handler;
|
|
141
158
|
exports.valueHandlers = valueHandlers;
|
|
@@ -37,6 +37,16 @@ const xyzMap = {
|
|
|
37
37
|
const numberWithUnitRE = /^(-?[0-9.]+)(px|pt|pc|rem|em|%|vh|vw|in|cm|mm|ex|ch|vmin|vmax)?$/i;
|
|
38
38
|
const numberRE = /^(-?[0-9.]+)$/i;
|
|
39
39
|
const unitOnlyRE = /^(px)$/i;
|
|
40
|
+
function numberWithUnit(str) {
|
|
41
|
+
if (str === "auto" || str === "a")
|
|
42
|
+
return "auto";
|
|
43
|
+
const match = str.match(numberWithUnitRE);
|
|
44
|
+
if (!match)
|
|
45
|
+
return;
|
|
46
|
+
const [, , unit] = match;
|
|
47
|
+
if (unit)
|
|
48
|
+
return str;
|
|
49
|
+
}
|
|
40
50
|
function rem(str) {
|
|
41
51
|
if (str === "auto" || str === "a")
|
|
42
52
|
return "auto";
|
|
@@ -102,17 +112,18 @@ function time(str) {
|
|
|
102
112
|
const duration = Number(str.replace(/(s|ms)$/, ""));
|
|
103
113
|
if (isNaN(duration))
|
|
104
114
|
return;
|
|
105
|
-
if (/ms
|
|
115
|
+
if (/(s|ms)$/.test(str))
|
|
106
116
|
return str;
|
|
107
117
|
return `${str}ms`;
|
|
108
118
|
}
|
|
109
119
|
function global(str) {
|
|
110
|
-
if (["inherit", "initial", "unset"].includes(str))
|
|
120
|
+
if (["inherit", "initial", "revert", "unset"].includes(str))
|
|
111
121
|
return str;
|
|
112
122
|
}
|
|
113
123
|
|
|
114
124
|
const valueHandlers = {
|
|
115
125
|
__proto__: null,
|
|
126
|
+
numberWithUnit: numberWithUnit,
|
|
116
127
|
rem: rem,
|
|
117
128
|
px: px,
|
|
118
129
|
number: number,
|
|
@@ -130,5 +141,10 @@ const h = handler;
|
|
|
130
141
|
function capitalize(str) {
|
|
131
142
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
132
143
|
}
|
|
144
|
+
const directionSize = (prefix) => ([_, direction, size]) => {
|
|
145
|
+
const v = handler.bracket.rem.fraction.cssvar(size);
|
|
146
|
+
if (v)
|
|
147
|
+
return directionMap[direction].map((i) => [prefix + i, v]);
|
|
148
|
+
};
|
|
133
149
|
|
|
134
|
-
export { capitalize as a,
|
|
150
|
+
export { capitalize as a, directionSize as b, cornerMap as c, directionMap as d, h as e, handler as h, valueHandlers as v, xyzMap as x };
|
package/dist/chunks/variants.cjs
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const variantMatcher = (name, selector) => {
|
|
4
|
-
const
|
|
5
|
-
const re = new RegExp(`^${name}[:-]`);
|
|
4
|
+
const re = new RegExp(`^(${name})[:-]`);
|
|
6
5
|
return (input) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const match = input.match(re);
|
|
7
|
+
if (match) {
|
|
8
|
+
return {
|
|
9
|
+
matcher: input.slice(match[1].length + 1),
|
|
10
|
+
selector
|
|
11
|
+
};
|
|
12
|
+
}
|
|
11
13
|
};
|
|
12
14
|
};
|
|
13
15
|
|
package/dist/chunks/variants.mjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
const variantMatcher = (name, selector) => {
|
|
2
|
-
const
|
|
3
|
-
const re = new RegExp(`^${name}[:-]`);
|
|
2
|
+
const re = new RegExp(`^(${name})[:-]`);
|
|
4
3
|
return (input) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
const match = input.match(re);
|
|
5
|
+
if (match) {
|
|
6
|
+
return {
|
|
7
|
+
matcher: input.slice(match[1].length + 1),
|
|
8
|
+
selector
|
|
9
|
+
};
|
|
10
|
+
}
|
|
9
11
|
};
|
|
10
12
|
};
|
|
11
13
|
|
package/dist/index.cjs
CHANGED
|
@@ -7,7 +7,7 @@ const _default$1 = require('./chunks/default2.cjs');
|
|
|
7
7
|
const _default$2 = require('./chunks/default3.cjs');
|
|
8
8
|
const colors = require('./chunks/colors.cjs');
|
|
9
9
|
require('@unocss/core');
|
|
10
|
-
require('./chunks/
|
|
10
|
+
require('./chunks/utilities.cjs');
|
|
11
11
|
require('./chunks/pseudo.cjs');
|
|
12
12
|
require('./chunks/variants.cjs');
|
|
13
13
|
|
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { r as rules } from './chunks/default2.mjs';
|
|
|
4
4
|
import { v as variants, a as variantColorsMedia, b as variantColorsClass } from './chunks/default3.mjs';
|
|
5
5
|
export { c as colors } from './chunks/colors.mjs';
|
|
6
6
|
import '@unocss/core';
|
|
7
|
-
import './chunks/
|
|
7
|
+
import './chunks/utilities.mjs';
|
|
8
8
|
import './chunks/pseudo.mjs';
|
|
9
9
|
import './chunks/variants.mjs';
|
|
10
10
|
|
package/dist/rules.cjs
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const _default = require('./chunks/default2.cjs');
|
|
6
6
|
require('@unocss/core');
|
|
7
|
-
require('./chunks/
|
|
7
|
+
require('./chunks/utilities.cjs');
|
|
8
8
|
require('./chunks/pseudo.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
@@ -21,10 +21,10 @@ exports.boxSizing = _default.boxSizing;
|
|
|
21
21
|
exports.breaks = _default.breaks;
|
|
22
22
|
exports.colorResolver = _default.colorResolver;
|
|
23
23
|
exports.contents = _default.contents;
|
|
24
|
+
exports.cssProps = _default.cssProps;
|
|
24
25
|
exports.cssVariables = _default.cssVariables;
|
|
25
26
|
exports.cursors = _default.cursors;
|
|
26
27
|
exports.displays = _default.displays;
|
|
27
|
-
exports.fillColors = _default.fillColors;
|
|
28
28
|
exports.flex = _default.flex;
|
|
29
29
|
exports.floats = _default.floats;
|
|
30
30
|
exports.fontSmoothings = _default.fontSmoothings;
|
|
@@ -52,6 +52,7 @@ exports.ringOffsetColors = _default.ringOffsetColors;
|
|
|
52
52
|
exports.rings = _default.rings;
|
|
53
53
|
exports.rules = _default.rules;
|
|
54
54
|
exports.sizes = _default.sizes;
|
|
55
|
+
exports.svgUtilities = _default.svgUtilities;
|
|
55
56
|
exports.tabSizes = _default.tabSizes;
|
|
56
57
|
exports.textAligns = _default.textAligns;
|
|
57
58
|
exports.textColors = _default.textColors;
|
|
@@ -67,4 +68,5 @@ exports.userSelects = _default.userSelects;
|
|
|
67
68
|
exports.varEmpty = _default.varEmpty;
|
|
68
69
|
exports.verticalAligns = _default.verticalAligns;
|
|
69
70
|
exports.whitespaces = _default.whitespaces;
|
|
71
|
+
exports.willChange = _default.willChange;
|
|
70
72
|
exports.zIndexes = _default.zIndexes;
|
package/dist/rules.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ declare const textAligns: Rule[];
|
|
|
7
7
|
declare const outline: Rule[];
|
|
8
8
|
declare const appearance: Rule[];
|
|
9
9
|
declare const placeholder: Rule[];
|
|
10
|
+
declare const willChange: Rule[];
|
|
10
11
|
|
|
11
12
|
declare const borders: Rule[];
|
|
12
13
|
|
|
@@ -32,7 +33,6 @@ declare const bgColors: Rule[];
|
|
|
32
33
|
declare const borderColors: Rule[];
|
|
33
34
|
declare const ringColors: Rule[];
|
|
34
35
|
declare const ringOffsetColors: Rule[];
|
|
35
|
-
declare const fillColors: Rule[];
|
|
36
36
|
|
|
37
37
|
declare const rules: Rule[];
|
|
38
38
|
|
|
@@ -71,6 +71,7 @@ declare const aspectRatio: Rule[];
|
|
|
71
71
|
declare const paddings: Rule[];
|
|
72
72
|
declare const margins: Rule[];
|
|
73
73
|
|
|
74
|
+
declare const cssProps: string[];
|
|
74
75
|
declare const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
|
|
75
76
|
declare const displays: Rule[];
|
|
76
77
|
declare const appearances: Rule[];
|
|
@@ -86,6 +87,8 @@ declare const textTransforms: Rule[];
|
|
|
86
87
|
declare const fontStyles: Rule[];
|
|
87
88
|
declare const fontSmoothings: Rule[];
|
|
88
89
|
|
|
90
|
+
declare const svgUtilities: Rule[];
|
|
91
|
+
|
|
89
92
|
declare const transforms: Rule[];
|
|
90
93
|
|
|
91
94
|
declare const transitions: Rule[];
|
|
@@ -100,4 +103,4 @@ declare const cssVariables: Rule[];
|
|
|
100
103
|
|
|
101
104
|
declare const textDecorations: Rule[];
|
|
102
105
|
|
|
103
|
-
export { alignments, appearance, appearances, aspectRatio, bgColors, borderColors, borders, boxShadows, boxSizing, breaks, colorResolver, contents, cssVariables, cursors, displays,
|
|
106
|
+
export { alignments, appearance, appearances, aspectRatio, bgColors, borderColors, borders, boxShadows, boxSizing, breaks, colorResolver, contents, cssProps, cssVariables, cursors, displays, flex, floats, fontSmoothings, fontStyles, fonts, gaps, grids, insets, justifies, margins, opacity, orders, outline, overflows, paddings, parseColorUtil, placeholder, placements, pointerEvents, positions, questionMark, resizes, ringColors, ringOffsetColors, rings, rules, sizes, svgUtilities, tabSizes, textAligns, textColors, textDecorations, textIndents, textOverflows, textShadows, textStrokes, textTransforms, transforms, transitions, userSelects, varEmpty, verticalAligns, whitespaces, willChange, zIndexes };
|
package/dist/rules.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { x as alignments, a as appearance,
|
|
1
|
+
export { x as alignments, a as appearance, N as appearances, H as aspectRatio, g as bgColors, h as borderColors, b as borders, F as boxShadows, C as boxSizing, U as breaks, d as colorResolver, T as contents, K as cssProps, a5 as cssVariables, O as cursors, M as displays, k as flex, A as floats, Y as fontSmoothings, X as fontStyles, a0 as fonts, l as gaps, m as grids, z as insets, s as justifies, J as margins, e as opacity, u as orders, o as outline, n as overflows, I as paddings, c as parseColorUtil, p as placeholder, y as placements, P as pointerEvents, q as positions, D as questionMark, Q as resizes, i as ringColors, j as ringOffsetColors, E as rings, r as rules, G as sizes, Z as svgUtilities, a1 as tabSizes, t as textAligns, f as textColors, a6 as textDecorations, a2 as textIndents, V as textOverflows, a4 as textShadows, a3 as textStrokes, W as textTransforms, _ as transforms, $ as transitions, R as userSelects, L as varEmpty, v as verticalAligns, S as whitespaces, w as willChange, B as zIndexes } from './chunks/default2.mjs';
|
|
2
2
|
import '@unocss/core';
|
|
3
|
-
import './chunks/
|
|
3
|
+
import './chunks/utilities.mjs';
|
|
4
4
|
import './chunks/pseudo.mjs';
|
package/dist/utils.cjs
CHANGED
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const utilities = require('./chunks/utilities.cjs');
|
|
6
6
|
const variants = require('./chunks/variants.cjs');
|
|
7
7
|
require('@unocss/core');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.capitalize =
|
|
12
|
-
exports.cornerMap =
|
|
13
|
-
exports.directionMap =
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
11
|
+
exports.capitalize = utilities.capitalize;
|
|
12
|
+
exports.cornerMap = utilities.cornerMap;
|
|
13
|
+
exports.directionMap = utilities.directionMap;
|
|
14
|
+
exports.directionSize = utilities.directionSize;
|
|
15
|
+
exports.h = utilities.h;
|
|
16
|
+
exports.handler = utilities.handler;
|
|
17
|
+
exports.valueHandlers = utilities.valueHandlers;
|
|
18
|
+
exports.xyzMap = utilities.xyzMap;
|
|
18
19
|
exports.variantMatcher = variants.variantMatcher;
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as _unocss_core from '@unocss/core';
|
|
2
|
-
import { VariantHandler } from '@unocss/core';
|
|
2
|
+
import { VariantHandler, CSSEntries } from '@unocss/core';
|
|
3
3
|
|
|
4
4
|
declare const directionMap: Record<string, string[]>;
|
|
5
5
|
declare const cornerMap: Record<string, string[]>;
|
|
6
6
|
declare const xyzMap: Record<string, string[]>;
|
|
7
7
|
|
|
8
|
+
declare function numberWithUnit(str: string): string | undefined;
|
|
8
9
|
declare function rem(str: string): string | undefined;
|
|
9
10
|
declare function px(str: string): string | undefined;
|
|
10
11
|
declare function number(str: string): number | undefined;
|
|
@@ -15,6 +16,7 @@ declare function cssvar(str: string): string | undefined;
|
|
|
15
16
|
declare function time(str: string): string | undefined;
|
|
16
17
|
declare function global(str: string): string | undefined;
|
|
17
18
|
|
|
19
|
+
declare const handlers_numberWithUnit: typeof numberWithUnit;
|
|
18
20
|
declare const handlers_rem: typeof rem;
|
|
19
21
|
declare const handlers_px: typeof px;
|
|
20
22
|
declare const handlers_number: typeof number;
|
|
@@ -26,6 +28,7 @@ declare const handlers_time: typeof time;
|
|
|
26
28
|
declare const handlers_global: typeof global;
|
|
27
29
|
declare namespace handlers {
|
|
28
30
|
export {
|
|
31
|
+
handlers_numberWithUnit as numberWithUnit,
|
|
29
32
|
handlers_rem as rem,
|
|
30
33
|
handlers_px as px,
|
|
31
34
|
handlers_number as number,
|
|
@@ -38,11 +41,12 @@ declare namespace handlers {
|
|
|
38
41
|
};
|
|
39
42
|
}
|
|
40
43
|
|
|
41
|
-
declare const handler: _unocss_core.ValueHandler<"number" | "rem" | "px" | "percent" | "fraction" | "bracket" | "cssvar" | "time" | "global">;
|
|
42
|
-
declare const h: _unocss_core.ValueHandler<"number" | "rem" | "px" | "percent" | "fraction" | "bracket" | "cssvar" | "time" | "global">;
|
|
44
|
+
declare const handler: _unocss_core.ValueHandler<"number" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "cssvar" | "time" | "global">;
|
|
45
|
+
declare const h: _unocss_core.ValueHandler<"number" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "cssvar" | "time" | "global">;
|
|
43
46
|
|
|
44
47
|
declare const variantMatcher: (name: string, selector?: ((input: string) => string | undefined) | undefined) => (input: string) => VariantHandler | undefined;
|
|
45
48
|
|
|
46
49
|
declare function capitalize<T extends string>(str: T): Capitalize<T>;
|
|
50
|
+
declare const directionSize: (prefix: string) => ([_, direction, size]: string[]) => CSSEntries | undefined;
|
|
47
51
|
|
|
48
|
-
export { capitalize, cornerMap, directionMap, h, handler, handlers as valueHandlers, variantMatcher, xyzMap };
|
|
52
|
+
export { capitalize, cornerMap, directionMap, directionSize, h, handler, handlers as valueHandlers, variantMatcher, xyzMap };
|
package/dist/utils.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { a as capitalize, c as cornerMap, d as directionMap, b as h, h as handler, v as valueHandlers, x as xyzMap } from './chunks/
|
|
1
|
+
export { a as capitalize, c as cornerMap, d as directionMap, b as directionSize, e as h, h as handler, v as valueHandlers, x as xyzMap } from './chunks/utilities.mjs';
|
|
2
2
|
export { v as variantMatcher } from './chunks/variants.mjs';
|
|
3
3
|
import '@unocss/core';
|
package/dist/variants.cjs
CHANGED
|
@@ -10,14 +10,14 @@ require('@unocss/core');
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
exports.variantBreakpoints = _default.variantBreakpoints;
|
|
13
|
-
exports.variantChildren = _default.variantChildren;
|
|
14
13
|
exports.variantColorsClass = _default.variantColorsClass;
|
|
15
14
|
exports.variantColorsMedia = _default.variantColorsMedia;
|
|
15
|
+
exports.variantCombinators = _default.variantCombinators;
|
|
16
16
|
exports.variantImportant = _default.variantImportant;
|
|
17
17
|
exports.variantNegative = _default.variantNegative;
|
|
18
18
|
exports.variantSpace = _default.variantSpace;
|
|
19
19
|
exports.variants = _default.variants;
|
|
20
|
-
exports.
|
|
20
|
+
exports.CONTROL_BYPASS_PSEUDO_CLASS = pseudo.CONTROL_BYPASS_PSEUDO_CLASS;
|
|
21
21
|
exports.PseudoClasses = pseudo.PseudoClasses;
|
|
22
22
|
exports.variantPseudoClasses = pseudo.variantPseudoClasses;
|
|
23
23
|
exports.variantPseudoElements = pseudo.variantPseudoElements;
|