@unocss/preset-uno 0.14.3 → 0.15.3
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/colors.cjs +4 -2
- package/dist/colors.d.ts +1 -2
- package/dist/colors.mjs +1 -1
- package/dist/index.cjs +6 -25
- package/dist/index.d.ts +8 -12
- package/dist/index.mjs +4 -23
- package/dist/theme.cjs +4 -22
- package/dist/theme.d.ts +1 -157
- package/dist/theme.mjs +1 -2
- package/dist/utils.cjs +4 -18
- package/dist/utils.d.ts +1 -56
- package/dist/utils.mjs +1 -2
- package/package.json +4 -12
- package/dist/chunks/colors.cjs +0 -339
- package/dist/chunks/colors.mjs +0 -337
- package/dist/chunks/default.cjs +0 -1781
- package/dist/chunks/default.mjs +0 -1668
- package/dist/chunks/default2.cjs +0 -226
- package/dist/chunks/default2.mjs +0 -206
- package/dist/chunks/default3.cjs +0 -128
- package/dist/chunks/default3.mjs +0 -119
- package/dist/chunks/index.cjs +0 -169
- package/dist/chunks/index.mjs +0 -153
- package/dist/chunks/pseudo.cjs +0 -106
- package/dist/chunks/pseudo.mjs +0 -101
- package/dist/chunks/variants.cjs +0 -14
- package/dist/chunks/variants.mjs +0 -12
- package/dist/colors-d6b5a5b4.d.ts +0 -5
- package/dist/default-c7c67d23.d.ts +0 -5
- package/dist/rules.cjs +0 -123
- package/dist/rules.d.ts +0 -162
- package/dist/rules.mjs +0 -4
- package/dist/types-7963d0b3.d.ts +0 -24
- package/dist/variants.cjs +0 -23
- package/dist/variants.d.ts +0 -22
- package/dist/variants.mjs +0 -4
package/dist/chunks/index.cjs
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const directionMap = {
|
|
4
|
-
"l": ["-left"],
|
|
5
|
-
"r": ["-right"],
|
|
6
|
-
"t": ["-top"],
|
|
7
|
-
"b": ["-bottom"],
|
|
8
|
-
"s": ["-inline-start"],
|
|
9
|
-
"e": ["-inline-end"],
|
|
10
|
-
"x": ["-left", "-right"],
|
|
11
|
-
"y": ["-top", "-bottom"],
|
|
12
|
-
"": [""],
|
|
13
|
-
"a": [""]
|
|
14
|
-
};
|
|
15
|
-
const cornerMap = {
|
|
16
|
-
"t": ["-top-left", "-top-right"],
|
|
17
|
-
"r": ["-top-right", "-bottom-right"],
|
|
18
|
-
"b": ["-bottom-left", "-bottom-right"],
|
|
19
|
-
"l": ["-bottom-left", "-top-left"],
|
|
20
|
-
"tl": ["-top-left"],
|
|
21
|
-
"lt": ["-top-left"],
|
|
22
|
-
"tr": ["-top-right"],
|
|
23
|
-
"rt": ["-top-right"],
|
|
24
|
-
"bl": ["-bottom-left"],
|
|
25
|
-
"lb": ["-bottom-left"],
|
|
26
|
-
"br": ["-bottom-right"],
|
|
27
|
-
"rb": ["-bottom-right"],
|
|
28
|
-
"": [""]
|
|
29
|
-
};
|
|
30
|
-
const xyzMap = {
|
|
31
|
-
"x": ["-x"],
|
|
32
|
-
"y": ["-y"],
|
|
33
|
-
"z": ["-z"],
|
|
34
|
-
"": ["-x", "-y"]
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const numberWithUnitRE = /^(-?[0-9.]+)(px|pt|pc|rem|em|%|vh|vw|in|cm|mm|ex|ch|vmin|vmax)?$/i;
|
|
38
|
-
const numberRE = /^(-?[0-9.]+)$/i;
|
|
39
|
-
function rem(str) {
|
|
40
|
-
if (str === "auto" || str === "a")
|
|
41
|
-
return "auto";
|
|
42
|
-
const match = str.match(numberWithUnitRE);
|
|
43
|
-
if (!match)
|
|
44
|
-
return;
|
|
45
|
-
const [, n, unit] = match;
|
|
46
|
-
if (unit)
|
|
47
|
-
return str;
|
|
48
|
-
const num = parseFloat(n);
|
|
49
|
-
if (!Number.isNaN(num))
|
|
50
|
-
return `${num / 4}rem`;
|
|
51
|
-
}
|
|
52
|
-
function px(str) {
|
|
53
|
-
const match = str.match(numberWithUnitRE);
|
|
54
|
-
if (!match)
|
|
55
|
-
return;
|
|
56
|
-
const [, n, unit] = match;
|
|
57
|
-
if (unit)
|
|
58
|
-
return str;
|
|
59
|
-
const num = parseFloat(n);
|
|
60
|
-
if (!Number.isNaN(num))
|
|
61
|
-
return `${num}px`;
|
|
62
|
-
}
|
|
63
|
-
function number(str) {
|
|
64
|
-
if (!numberRE.test(str))
|
|
65
|
-
return;
|
|
66
|
-
const num = parseFloat(str);
|
|
67
|
-
if (!Number.isNaN(num))
|
|
68
|
-
return num;
|
|
69
|
-
}
|
|
70
|
-
function percent(str) {
|
|
71
|
-
if (str.endsWith("%"))
|
|
72
|
-
str = str.slice(0, -1);
|
|
73
|
-
const num = parseFloat(str);
|
|
74
|
-
if (!Number.isNaN(num))
|
|
75
|
-
return `${num / 100}`;
|
|
76
|
-
}
|
|
77
|
-
function fraction(str) {
|
|
78
|
-
if (str === "full")
|
|
79
|
-
return "100%";
|
|
80
|
-
const [left, right] = str.split("/");
|
|
81
|
-
const num = parseFloat(left) / parseFloat(right);
|
|
82
|
-
if (!Number.isNaN(num))
|
|
83
|
-
return `${num * 100}%`;
|
|
84
|
-
}
|
|
85
|
-
function bracket(str) {
|
|
86
|
-
if (str && str[0] === "[" && str[str.length - 1] === "]") {
|
|
87
|
-
return str.slice(1, -1).replace(/_/g, " ").replace(/calc\((.*)/g, (v) => {
|
|
88
|
-
return v.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ");
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
function cssvar(str) {
|
|
93
|
-
if (str.startsWith("$"))
|
|
94
|
-
return `var(--${str.slice(1)})`;
|
|
95
|
-
}
|
|
96
|
-
function time(str) {
|
|
97
|
-
const duration = Number(str.replace(/(s|ms)$/, ""));
|
|
98
|
-
if (isNaN(duration))
|
|
99
|
-
return;
|
|
100
|
-
if (/ms|s$/.test(str))
|
|
101
|
-
return str;
|
|
102
|
-
return `${str}ms`;
|
|
103
|
-
}
|
|
104
|
-
function global(str) {
|
|
105
|
-
if (["inherit", "initial", "unset"].includes(str))
|
|
106
|
-
return str;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const handlers = {
|
|
110
|
-
__proto__: null,
|
|
111
|
-
rem: rem,
|
|
112
|
-
px: px,
|
|
113
|
-
number: number,
|
|
114
|
-
percent: percent,
|
|
115
|
-
fraction: fraction,
|
|
116
|
-
bracket: bracket,
|
|
117
|
-
cssvar: cssvar,
|
|
118
|
-
time: time,
|
|
119
|
-
global: global
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const handlersNames = Object.keys(handlers);
|
|
123
|
-
const handler = function(str) {
|
|
124
|
-
const s = this.__options?.sequence || [];
|
|
125
|
-
this.__options.sequence = [];
|
|
126
|
-
for (const n of s) {
|
|
127
|
-
const res = handlers[n](str);
|
|
128
|
-
if (res != null)
|
|
129
|
-
return res;
|
|
130
|
-
}
|
|
131
|
-
return void 0;
|
|
132
|
-
};
|
|
133
|
-
function addProcessor(that, name) {
|
|
134
|
-
if (!that.__options) {
|
|
135
|
-
that.__options = {
|
|
136
|
-
sequence: []
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
that.__options.sequence.push(name);
|
|
140
|
-
return that;
|
|
141
|
-
}
|
|
142
|
-
handlersNames.forEach((i) => {
|
|
143
|
-
Object.defineProperty(handler, i, {
|
|
144
|
-
enumerable: true,
|
|
145
|
-
get() {
|
|
146
|
-
return addProcessor(this, i);
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
function capitalize(str) {
|
|
152
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
exports.bracket = bracket;
|
|
156
|
-
exports.capitalize = capitalize;
|
|
157
|
-
exports.cornerMap = cornerMap;
|
|
158
|
-
exports.cssvar = cssvar;
|
|
159
|
-
exports.directionMap = directionMap;
|
|
160
|
-
exports.fraction = fraction;
|
|
161
|
-
exports.global = global;
|
|
162
|
-
exports.handler = handler;
|
|
163
|
-
exports.handlersNames = handlersNames;
|
|
164
|
-
exports.number = number;
|
|
165
|
-
exports.percent = percent;
|
|
166
|
-
exports.px = px;
|
|
167
|
-
exports.rem = rem;
|
|
168
|
-
exports.time = time;
|
|
169
|
-
exports.xyzMap = xyzMap;
|
package/dist/chunks/index.mjs
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
const directionMap = {
|
|
2
|
-
"l": ["-left"],
|
|
3
|
-
"r": ["-right"],
|
|
4
|
-
"t": ["-top"],
|
|
5
|
-
"b": ["-bottom"],
|
|
6
|
-
"s": ["-inline-start"],
|
|
7
|
-
"e": ["-inline-end"],
|
|
8
|
-
"x": ["-left", "-right"],
|
|
9
|
-
"y": ["-top", "-bottom"],
|
|
10
|
-
"": [""],
|
|
11
|
-
"a": [""]
|
|
12
|
-
};
|
|
13
|
-
const cornerMap = {
|
|
14
|
-
"t": ["-top-left", "-top-right"],
|
|
15
|
-
"r": ["-top-right", "-bottom-right"],
|
|
16
|
-
"b": ["-bottom-left", "-bottom-right"],
|
|
17
|
-
"l": ["-bottom-left", "-top-left"],
|
|
18
|
-
"tl": ["-top-left"],
|
|
19
|
-
"lt": ["-top-left"],
|
|
20
|
-
"tr": ["-top-right"],
|
|
21
|
-
"rt": ["-top-right"],
|
|
22
|
-
"bl": ["-bottom-left"],
|
|
23
|
-
"lb": ["-bottom-left"],
|
|
24
|
-
"br": ["-bottom-right"],
|
|
25
|
-
"rb": ["-bottom-right"],
|
|
26
|
-
"": [""]
|
|
27
|
-
};
|
|
28
|
-
const xyzMap = {
|
|
29
|
-
"x": ["-x"],
|
|
30
|
-
"y": ["-y"],
|
|
31
|
-
"z": ["-z"],
|
|
32
|
-
"": ["-x", "-y"]
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const numberWithUnitRE = /^(-?[0-9.]+)(px|pt|pc|rem|em|%|vh|vw|in|cm|mm|ex|ch|vmin|vmax)?$/i;
|
|
36
|
-
const numberRE = /^(-?[0-9.]+)$/i;
|
|
37
|
-
function rem(str) {
|
|
38
|
-
if (str === "auto" || str === "a")
|
|
39
|
-
return "auto";
|
|
40
|
-
const match = str.match(numberWithUnitRE);
|
|
41
|
-
if (!match)
|
|
42
|
-
return;
|
|
43
|
-
const [, n, unit] = match;
|
|
44
|
-
if (unit)
|
|
45
|
-
return str;
|
|
46
|
-
const num = parseFloat(n);
|
|
47
|
-
if (!Number.isNaN(num))
|
|
48
|
-
return `${num / 4}rem`;
|
|
49
|
-
}
|
|
50
|
-
function px(str) {
|
|
51
|
-
const match = str.match(numberWithUnitRE);
|
|
52
|
-
if (!match)
|
|
53
|
-
return;
|
|
54
|
-
const [, n, unit] = match;
|
|
55
|
-
if (unit)
|
|
56
|
-
return str;
|
|
57
|
-
const num = parseFloat(n);
|
|
58
|
-
if (!Number.isNaN(num))
|
|
59
|
-
return `${num}px`;
|
|
60
|
-
}
|
|
61
|
-
function number(str) {
|
|
62
|
-
if (!numberRE.test(str))
|
|
63
|
-
return;
|
|
64
|
-
const num = parseFloat(str);
|
|
65
|
-
if (!Number.isNaN(num))
|
|
66
|
-
return num;
|
|
67
|
-
}
|
|
68
|
-
function percent(str) {
|
|
69
|
-
if (str.endsWith("%"))
|
|
70
|
-
str = str.slice(0, -1);
|
|
71
|
-
const num = parseFloat(str);
|
|
72
|
-
if (!Number.isNaN(num))
|
|
73
|
-
return `${num / 100}`;
|
|
74
|
-
}
|
|
75
|
-
function fraction(str) {
|
|
76
|
-
if (str === "full")
|
|
77
|
-
return "100%";
|
|
78
|
-
const [left, right] = str.split("/");
|
|
79
|
-
const num = parseFloat(left) / parseFloat(right);
|
|
80
|
-
if (!Number.isNaN(num))
|
|
81
|
-
return `${num * 100}%`;
|
|
82
|
-
}
|
|
83
|
-
function bracket(str) {
|
|
84
|
-
if (str && str[0] === "[" && str[str.length - 1] === "]") {
|
|
85
|
-
return str.slice(1, -1).replace(/_/g, " ").replace(/calc\((.*)/g, (v) => {
|
|
86
|
-
return v.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ");
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
function cssvar(str) {
|
|
91
|
-
if (str.startsWith("$"))
|
|
92
|
-
return `var(--${str.slice(1)})`;
|
|
93
|
-
}
|
|
94
|
-
function time(str) {
|
|
95
|
-
const duration = Number(str.replace(/(s|ms)$/, ""));
|
|
96
|
-
if (isNaN(duration))
|
|
97
|
-
return;
|
|
98
|
-
if (/ms|s$/.test(str))
|
|
99
|
-
return str;
|
|
100
|
-
return `${str}ms`;
|
|
101
|
-
}
|
|
102
|
-
function global(str) {
|
|
103
|
-
if (["inherit", "initial", "unset"].includes(str))
|
|
104
|
-
return str;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const handlers = {
|
|
108
|
-
__proto__: null,
|
|
109
|
-
rem: rem,
|
|
110
|
-
px: px,
|
|
111
|
-
number: number,
|
|
112
|
-
percent: percent,
|
|
113
|
-
fraction: fraction,
|
|
114
|
-
bracket: bracket,
|
|
115
|
-
cssvar: cssvar,
|
|
116
|
-
time: time,
|
|
117
|
-
global: global
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
const handlersNames = Object.keys(handlers);
|
|
121
|
-
const handler = function(str) {
|
|
122
|
-
const s = this.__options?.sequence || [];
|
|
123
|
-
this.__options.sequence = [];
|
|
124
|
-
for (const n of s) {
|
|
125
|
-
const res = handlers[n](str);
|
|
126
|
-
if (res != null)
|
|
127
|
-
return res;
|
|
128
|
-
}
|
|
129
|
-
return void 0;
|
|
130
|
-
};
|
|
131
|
-
function addProcessor(that, name) {
|
|
132
|
-
if (!that.__options) {
|
|
133
|
-
that.__options = {
|
|
134
|
-
sequence: []
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
that.__options.sequence.push(name);
|
|
138
|
-
return that;
|
|
139
|
-
}
|
|
140
|
-
handlersNames.forEach((i) => {
|
|
141
|
-
Object.defineProperty(handler, i, {
|
|
142
|
-
enumerable: true,
|
|
143
|
-
get() {
|
|
144
|
-
return addProcessor(this, i);
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
function capitalize(str) {
|
|
150
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export { capitalize as a, percent as b, cornerMap as c, directionMap as d, bracket as e, fraction as f, cssvar as g, handler as h, global as i, handlersNames as j, number as n, px as p, rem as r, time as t, xyzMap as x };
|
package/dist/chunks/pseudo.cjs
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const core = require('@unocss/core');
|
|
4
|
-
|
|
5
|
-
const CONTROL_BYPASS_PSEUDO = "$$no-pseudo";
|
|
6
|
-
const PseudoClasses = Object.fromEntries([
|
|
7
|
-
"active",
|
|
8
|
-
"checked",
|
|
9
|
-
"default",
|
|
10
|
-
"empty",
|
|
11
|
-
"enabled",
|
|
12
|
-
"disabled",
|
|
13
|
-
"first-of-type",
|
|
14
|
-
["first", "first-child"],
|
|
15
|
-
"focus-visible",
|
|
16
|
-
"focus-within",
|
|
17
|
-
"focus",
|
|
18
|
-
"hover",
|
|
19
|
-
"indeterminate",
|
|
20
|
-
"invalid",
|
|
21
|
-
"last-of-type",
|
|
22
|
-
["last", "last-child"],
|
|
23
|
-
"link",
|
|
24
|
-
"only-child",
|
|
25
|
-
"only-of-type",
|
|
26
|
-
"optional",
|
|
27
|
-
"placeholder-shown",
|
|
28
|
-
"read-only",
|
|
29
|
-
"read-write",
|
|
30
|
-
"required",
|
|
31
|
-
"root",
|
|
32
|
-
"target",
|
|
33
|
-
"valid",
|
|
34
|
-
"visited",
|
|
35
|
-
["even-of-type", "nth-of-type(even)"],
|
|
36
|
-
["even", "nth-child(even)"],
|
|
37
|
-
["odd-of-type", "nth-of-type(odd)"],
|
|
38
|
-
["odd", "nth-child(odd)"]
|
|
39
|
-
].map(core.toArray));
|
|
40
|
-
const PseudoElements = [
|
|
41
|
-
"before",
|
|
42
|
-
"after",
|
|
43
|
-
"first-letter",
|
|
44
|
-
"first-line",
|
|
45
|
-
"selection"
|
|
46
|
-
];
|
|
47
|
-
const PseudoElementsRE = new RegExp(`^(${PseudoElements.join("|")})[:-]`);
|
|
48
|
-
const PseudoClassesStr = Object.keys(PseudoClasses).join("|");
|
|
49
|
-
const PseudoClassesRE = new RegExp(`^(${PseudoClassesStr})[:-]`);
|
|
50
|
-
const PseudoClassesNotRE = new RegExp(`^not-(${PseudoClassesStr})[:-]`);
|
|
51
|
-
const PseudoClassesGroupRE = new RegExp(`^group-(${PseudoClassesStr})[:-]`);
|
|
52
|
-
const PseudoClassesPeerRE = new RegExp(`^peer-(${PseudoClassesStr})[:-]`);
|
|
53
|
-
const variantPseudoElements = (input) => {
|
|
54
|
-
const match = input.match(PseudoElementsRE);
|
|
55
|
-
if (match) {
|
|
56
|
-
return {
|
|
57
|
-
matcher: input.slice(match[1].length + 1),
|
|
58
|
-
selector: (s, body) => shouldAdd(body) && `${s}::${match[1]}`
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
function shouldAdd(entires) {
|
|
63
|
-
return !entires.find((i) => i[0] === CONTROL_BYPASS_PSEUDO) || void 0;
|
|
64
|
-
}
|
|
65
|
-
const variantPseudoClasses = {
|
|
66
|
-
match: (input) => {
|
|
67
|
-
let match = input.match(PseudoClassesRE);
|
|
68
|
-
if (match) {
|
|
69
|
-
const pseudo = PseudoClasses[match[1]] || match[1];
|
|
70
|
-
return {
|
|
71
|
-
matcher: input.slice(match[1].length + 1),
|
|
72
|
-
selector: (s, body) => shouldAdd(body) && `${s}:${pseudo}`
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
match = input.match(PseudoClassesNotRE);
|
|
76
|
-
if (match) {
|
|
77
|
-
const pseudo = PseudoClasses[match[1]] || match[1];
|
|
78
|
-
return {
|
|
79
|
-
matcher: input.slice(match[1].length + 5),
|
|
80
|
-
selector: (s, body) => shouldAdd(body) && `${s}:not(:${pseudo})`
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
match = input.match(PseudoClassesGroupRE);
|
|
84
|
-
if (match) {
|
|
85
|
-
const pseudo = PseudoClasses[match[1]] || match[1];
|
|
86
|
-
return {
|
|
87
|
-
matcher: input.slice(match[1].length + 7),
|
|
88
|
-
selector: (s, body) => shouldAdd(body) && s.includes(".group:") ? s.replace(/\.group:/, `.group:${pseudo}:`) : `.group:${pseudo} ${s}`
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
match = input.match(PseudoClassesPeerRE);
|
|
92
|
-
if (match) {
|
|
93
|
-
const pseudo = PseudoClasses[match[1]] || match[1];
|
|
94
|
-
return {
|
|
95
|
-
matcher: input.slice(match[1].length + 6),
|
|
96
|
-
selector: (s, body) => shouldAdd(body) && s.includes(".peer:") ? s.replace(/\.peer:/, `.peer:${pseudo}:`) : `.peer:${pseudo} ~ ${s}`
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
multiPass: true
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
exports.CONTROL_BYPASS_PSEUDO = CONTROL_BYPASS_PSEUDO;
|
|
104
|
-
exports.PseudoClasses = PseudoClasses;
|
|
105
|
-
exports.variantPseudoClasses = variantPseudoClasses;
|
|
106
|
-
exports.variantPseudoElements = variantPseudoElements;
|
package/dist/chunks/pseudo.mjs
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { toArray } from '@unocss/core';
|
|
2
|
-
|
|
3
|
-
const CONTROL_BYPASS_PSEUDO = "$$no-pseudo";
|
|
4
|
-
const PseudoClasses = Object.fromEntries([
|
|
5
|
-
"active",
|
|
6
|
-
"checked",
|
|
7
|
-
"default",
|
|
8
|
-
"empty",
|
|
9
|
-
"enabled",
|
|
10
|
-
"disabled",
|
|
11
|
-
"first-of-type",
|
|
12
|
-
["first", "first-child"],
|
|
13
|
-
"focus-visible",
|
|
14
|
-
"focus-within",
|
|
15
|
-
"focus",
|
|
16
|
-
"hover",
|
|
17
|
-
"indeterminate",
|
|
18
|
-
"invalid",
|
|
19
|
-
"last-of-type",
|
|
20
|
-
["last", "last-child"],
|
|
21
|
-
"link",
|
|
22
|
-
"only-child",
|
|
23
|
-
"only-of-type",
|
|
24
|
-
"optional",
|
|
25
|
-
"placeholder-shown",
|
|
26
|
-
"read-only",
|
|
27
|
-
"read-write",
|
|
28
|
-
"required",
|
|
29
|
-
"root",
|
|
30
|
-
"target",
|
|
31
|
-
"valid",
|
|
32
|
-
"visited",
|
|
33
|
-
["even-of-type", "nth-of-type(even)"],
|
|
34
|
-
["even", "nth-child(even)"],
|
|
35
|
-
["odd-of-type", "nth-of-type(odd)"],
|
|
36
|
-
["odd", "nth-child(odd)"]
|
|
37
|
-
].map(toArray));
|
|
38
|
-
const PseudoElements = [
|
|
39
|
-
"before",
|
|
40
|
-
"after",
|
|
41
|
-
"first-letter",
|
|
42
|
-
"first-line",
|
|
43
|
-
"selection"
|
|
44
|
-
];
|
|
45
|
-
const PseudoElementsRE = new RegExp(`^(${PseudoElements.join("|")})[:-]`);
|
|
46
|
-
const PseudoClassesStr = Object.keys(PseudoClasses).join("|");
|
|
47
|
-
const PseudoClassesRE = new RegExp(`^(${PseudoClassesStr})[:-]`);
|
|
48
|
-
const PseudoClassesNotRE = new RegExp(`^not-(${PseudoClassesStr})[:-]`);
|
|
49
|
-
const PseudoClassesGroupRE = new RegExp(`^group-(${PseudoClassesStr})[:-]`);
|
|
50
|
-
const PseudoClassesPeerRE = new RegExp(`^peer-(${PseudoClassesStr})[:-]`);
|
|
51
|
-
const variantPseudoElements = (input) => {
|
|
52
|
-
const match = input.match(PseudoElementsRE);
|
|
53
|
-
if (match) {
|
|
54
|
-
return {
|
|
55
|
-
matcher: input.slice(match[1].length + 1),
|
|
56
|
-
selector: (s, body) => shouldAdd(body) && `${s}::${match[1]}`
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
function shouldAdd(entires) {
|
|
61
|
-
return !entires.find((i) => i[0] === CONTROL_BYPASS_PSEUDO) || void 0;
|
|
62
|
-
}
|
|
63
|
-
const variantPseudoClasses = {
|
|
64
|
-
match: (input) => {
|
|
65
|
-
let match = input.match(PseudoClassesRE);
|
|
66
|
-
if (match) {
|
|
67
|
-
const pseudo = PseudoClasses[match[1]] || match[1];
|
|
68
|
-
return {
|
|
69
|
-
matcher: input.slice(match[1].length + 1),
|
|
70
|
-
selector: (s, body) => shouldAdd(body) && `${s}:${pseudo}`
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
match = input.match(PseudoClassesNotRE);
|
|
74
|
-
if (match) {
|
|
75
|
-
const pseudo = PseudoClasses[match[1]] || match[1];
|
|
76
|
-
return {
|
|
77
|
-
matcher: input.slice(match[1].length + 5),
|
|
78
|
-
selector: (s, body) => shouldAdd(body) && `${s}:not(:${pseudo})`
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
match = input.match(PseudoClassesGroupRE);
|
|
82
|
-
if (match) {
|
|
83
|
-
const pseudo = PseudoClasses[match[1]] || match[1];
|
|
84
|
-
return {
|
|
85
|
-
matcher: input.slice(match[1].length + 7),
|
|
86
|
-
selector: (s, body) => shouldAdd(body) && s.includes(".group:") ? s.replace(/\.group:/, `.group:${pseudo}:`) : `.group:${pseudo} ${s}`
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
match = input.match(PseudoClassesPeerRE);
|
|
90
|
-
if (match) {
|
|
91
|
-
const pseudo = PseudoClasses[match[1]] || match[1];
|
|
92
|
-
return {
|
|
93
|
-
matcher: input.slice(match[1].length + 6),
|
|
94
|
-
selector: (s, body) => shouldAdd(body) && s.includes(".peer:") ? s.replace(/\.peer:/, `.peer:${pseudo}:`) : `.peer:${pseudo} ~ ${s}`
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
multiPass: true
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
export { CONTROL_BYPASS_PSEUDO as C, PseudoClasses as P, variantPseudoElements as a, variantPseudoClasses as v };
|
package/dist/chunks/variants.cjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const variantMatcher = (name, selector) => {
|
|
4
|
-
const length = name.length + 1;
|
|
5
|
-
const re = new RegExp(`^${name}[:-]`);
|
|
6
|
-
return (input) => {
|
|
7
|
-
return input.match(re) ? {
|
|
8
|
-
matcher: input.slice(length),
|
|
9
|
-
selector
|
|
10
|
-
} : void 0;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
exports.variantMatcher = variantMatcher;
|
package/dist/chunks/variants.mjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const variantMatcher = (name, selector) => {
|
|
2
|
-
const length = name.length + 1;
|
|
3
|
-
const re = new RegExp(`^${name}[:-]`);
|
|
4
|
-
return (input) => {
|
|
5
|
-
return input.match(re) ? {
|
|
6
|
-
matcher: input.slice(length),
|
|
7
|
-
selector
|
|
8
|
-
} : void 0;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export { variantMatcher as v };
|
package/dist/rules.cjs
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const _default = require('./chunks/default.cjs');
|
|
6
|
-
require('@unocss/core');
|
|
7
|
-
require('./chunks/index.cjs');
|
|
8
|
-
require('./chunks/pseudo.cjs');
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
exports.alignContents = _default.alignContents;
|
|
13
|
-
exports.alignItems = _default.alignItems;
|
|
14
|
-
exports.alignSelfs = _default.alignSelfs;
|
|
15
|
-
exports.animations = _default.animations;
|
|
16
|
-
exports.appearance = _default.appearance;
|
|
17
|
-
exports.appearances = _default.appearances;
|
|
18
|
-
exports.aspectRatio = _default.aspectRatio;
|
|
19
|
-
exports.bgAttachments = _default.bgAttachments;
|
|
20
|
-
exports.bgBlendModes = _default.bgBlendModes;
|
|
21
|
-
exports.bgClips = _default.bgClips;
|
|
22
|
-
exports.bgColors = _default.bgColors;
|
|
23
|
-
exports.bgGradients = _default.bgGradients;
|
|
24
|
-
exports.bgImages = _default.bgImages;
|
|
25
|
-
exports.bgOrigins = _default.bgOrigins;
|
|
26
|
-
exports.bgPositions = _default.bgPositions;
|
|
27
|
-
exports.bgRepeats = _default.bgRepeats;
|
|
28
|
-
exports.bgSizes = _default.bgSizes;
|
|
29
|
-
exports.borderColors = _default.borderColors;
|
|
30
|
-
exports.borderRadius = _default.borderRadius;
|
|
31
|
-
exports.borderSizes = _default.borderSizes;
|
|
32
|
-
exports.borderStyles = _default.borderStyles;
|
|
33
|
-
exports.borders = _default.borders;
|
|
34
|
-
exports.boxDecorationBreaks = _default.boxDecorationBreaks;
|
|
35
|
-
exports.boxShadows = _default.boxShadows;
|
|
36
|
-
exports.boxSizing = _default.boxSizing;
|
|
37
|
-
exports.breaks = _default.breaks;
|
|
38
|
-
exports.caretColors = _default.caretColors;
|
|
39
|
-
exports.caretOpacity = _default.caretOpacity;
|
|
40
|
-
exports.colorResolver = _default.colorResolver;
|
|
41
|
-
exports.container = _default.container;
|
|
42
|
-
exports.containerShortcuts = _default.containerShortcuts;
|
|
43
|
-
exports.contents = _default.contents;
|
|
44
|
-
exports.cssVariables = _default.cssVariables;
|
|
45
|
-
exports.cursors = _default.cursors;
|
|
46
|
-
exports.displays = _default.displays;
|
|
47
|
-
exports.divideColors = _default.divideColors;
|
|
48
|
-
exports.divideSizes = _default.divideSizes;
|
|
49
|
-
exports.divideStyles = _default.divideStyles;
|
|
50
|
-
exports.divides = _default.divides;
|
|
51
|
-
exports.fillColors = _default.fillColors;
|
|
52
|
-
exports.filters = _default.filters;
|
|
53
|
-
exports.flex = _default.flex;
|
|
54
|
-
exports.floats = _default.floats;
|
|
55
|
-
exports.fontSizes = _default.fontSizes;
|
|
56
|
-
exports.fontSmoothings = _default.fontSmoothings;
|
|
57
|
-
exports.fontStyles = _default.fontStyles;
|
|
58
|
-
exports.fontVariantNumeric = _default.fontVariantNumeric;
|
|
59
|
-
exports.fontWeights = _default.fontWeights;
|
|
60
|
-
exports.fonts = _default.fonts;
|
|
61
|
-
exports.fontsFamilies = _default.fontsFamilies;
|
|
62
|
-
exports.gaps = _default.gaps;
|
|
63
|
-
exports.grids = _default.grids;
|
|
64
|
-
exports.hyphens = _default.hyphens;
|
|
65
|
-
exports.imageRenderings = _default.imageRenderings;
|
|
66
|
-
exports.insets = _default.insets;
|
|
67
|
-
exports.isolations = _default.isolations;
|
|
68
|
-
exports.justifies = _default.justifies;
|
|
69
|
-
exports.justifyItems = _default.justifyItems;
|
|
70
|
-
exports.justifySelfs = _default.justifySelfs;
|
|
71
|
-
exports.leadings = _default.leadings;
|
|
72
|
-
exports.lineClamps = _default.lineClamps;
|
|
73
|
-
exports.listStyle = _default.listStyle;
|
|
74
|
-
exports.margins = _default.margins;
|
|
75
|
-
exports.mixBlendModes = _default.mixBlendModes;
|
|
76
|
-
exports.objectPositions = _default.objectPositions;
|
|
77
|
-
exports.opacity = _default.opacity;
|
|
78
|
-
exports.orders = _default.orders;
|
|
79
|
-
exports.outline = _default.outline;
|
|
80
|
-
exports.overflows = _default.overflows;
|
|
81
|
-
exports.overscrolls = _default.overscrolls;
|
|
82
|
-
exports.paddings = _default.paddings;
|
|
83
|
-
exports.parseColorUtil = _default.parseColorUtil;
|
|
84
|
-
exports.placeContents = _default.placeContents;
|
|
85
|
-
exports.placeItems = _default.placeItems;
|
|
86
|
-
exports.placeSelfs = _default.placeSelfs;
|
|
87
|
-
exports.placeholder = _default.placeholder;
|
|
88
|
-
exports.pointerEvents = _default.pointerEvents;
|
|
89
|
-
exports.positions = _default.positions;
|
|
90
|
-
exports.questionMark = _default.questionMark;
|
|
91
|
-
exports.resizes = _default.resizes;
|
|
92
|
-
exports.ringColors = _default.ringColors;
|
|
93
|
-
exports.ringOffsetColors = _default.ringOffsetColors;
|
|
94
|
-
exports.rings = _default.rings;
|
|
95
|
-
exports.rules = _default.rules;
|
|
96
|
-
exports.screenReadersAccess = _default.screenReadersAccess;
|
|
97
|
-
exports.sizes = _default.sizes;
|
|
98
|
-
exports.tabSizes = _default.tabSizes;
|
|
99
|
-
exports.tables = _default.tables;
|
|
100
|
-
exports.textAligns = _default.textAligns;
|
|
101
|
-
exports.textColors = _default.textColors;
|
|
102
|
-
exports.textDecorationColors = _default.textDecorationColors;
|
|
103
|
-
exports.textDecorationLengths = _default.textDecorationLengths;
|
|
104
|
-
exports.textDecorationOffsets = _default.textDecorationOffsets;
|
|
105
|
-
exports.textDecorationStyles = _default.textDecorationStyles;
|
|
106
|
-
exports.textDecorations = _default.textDecorations;
|
|
107
|
-
exports.textIndents = _default.textIndents;
|
|
108
|
-
exports.textOverflows = _default.textOverflows;
|
|
109
|
-
exports.textShadows = _default.textShadows;
|
|
110
|
-
exports.textStrokeColors = _default.textStrokeColors;
|
|
111
|
-
exports.textStrokeWidths = _default.textStrokeWidths;
|
|
112
|
-
exports.textTransforms = _default.textTransforms;
|
|
113
|
-
exports.trackings = _default.trackings;
|
|
114
|
-
exports.transforms = _default.transforms;
|
|
115
|
-
exports.transitions = _default.transitions;
|
|
116
|
-
exports.userSelects = _default.userSelects;
|
|
117
|
-
exports.varEmpty = _default.varEmpty;
|
|
118
|
-
exports.verticalAligns = _default.verticalAligns;
|
|
119
|
-
exports.whitespaces = _default.whitespaces;
|
|
120
|
-
exports.wordSpacings = _default.wordSpacings;
|
|
121
|
-
exports.writingModes = _default.writingModes;
|
|
122
|
-
exports.writingOrientations = _default.writingOrientations;
|
|
123
|
-
exports.zIndexes = _default.zIndexes;
|