@unocss/preset-uno 0.3.0 → 0.4.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/{chunk-AMSMQAHK.js → chunk-54CWTYJQ.js} +50 -18
- package/dist/{chunk-7Y7AX4FR.mjs → chunk-VZLJK4OI.mjs} +51 -19
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/dist/variants.d.ts +6 -8
- package/dist/variants.js +2 -4
- package/dist/variants.mjs +3 -5
- package/package.json +2 -2
|
@@ -62,17 +62,7 @@ var variantColorsMedia = [
|
|
|
62
62
|
|
|
63
63
|
// src/variants/pseudo.ts
|
|
64
64
|
var _core = require('@unocss/core');
|
|
65
|
-
|
|
66
|
-
return [
|
|
67
|
-
variantMatcher(name, (input) => `${input}:${pseudo}`),
|
|
68
|
-
variantMatcher(`not-${name}`, (input) => `${input}:not(:${pseudo})`),
|
|
69
|
-
variantMatcher(`group-${name}`, (input) => `.group:${pseudo} ${input}`)
|
|
70
|
-
];
|
|
71
|
-
}
|
|
72
|
-
function createPseudoElementVariant(name) {
|
|
73
|
-
return variantMatcher(name, (input) => `${input}::${name}`);
|
|
74
|
-
}
|
|
75
|
-
var variantPseudoClasses = [
|
|
65
|
+
var PseudoClasses = Object.fromEntries([
|
|
76
66
|
"active",
|
|
77
67
|
"checked",
|
|
78
68
|
"default",
|
|
@@ -104,14 +94,57 @@ var variantPseudoClasses = [
|
|
|
104
94
|
["even", "nth-child(even)"],
|
|
105
95
|
["odd-of-type", "nth-of-type(odd)"],
|
|
106
96
|
["odd", "nth-child(odd)"]
|
|
107
|
-
].
|
|
108
|
-
var
|
|
97
|
+
].map(_core.toArray));
|
|
98
|
+
var PseudoElements = [
|
|
109
99
|
"before",
|
|
110
100
|
"after",
|
|
111
101
|
"first-letter",
|
|
112
102
|
"first-line",
|
|
113
103
|
"selection"
|
|
114
|
-
]
|
|
104
|
+
];
|
|
105
|
+
var PseudoElementsRE = new RegExp(`^(${PseudoElements.join("|")})[:-]`);
|
|
106
|
+
var PseudoClassesStr = Object.keys(PseudoClasses).join("|");
|
|
107
|
+
var PseudoClassesRE = new RegExp(`^(${PseudoClassesStr})[:-]`);
|
|
108
|
+
var PseudoClassesNotRE = new RegExp(`^not-(${PseudoClassesStr})[:-]`);
|
|
109
|
+
var PseudoClassesGroupRE = new RegExp(`^group-(${PseudoClassesStr})[:-]`);
|
|
110
|
+
var variantPseudoElements = (input) => {
|
|
111
|
+
const match = input.match(PseudoElementsRE);
|
|
112
|
+
if (match) {
|
|
113
|
+
return {
|
|
114
|
+
matcher: input.slice(match[1].length + 1),
|
|
115
|
+
selector: (input2) => `${input2}::${match[1]}`
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
var variantPseudoClasses = {
|
|
120
|
+
match: (input) => {
|
|
121
|
+
let match = input.match(PseudoClassesRE);
|
|
122
|
+
if (match) {
|
|
123
|
+
const pseudo = PseudoClasses[match[1]] || match[1];
|
|
124
|
+
return {
|
|
125
|
+
matcher: input.slice(match[1].length + 1),
|
|
126
|
+
selector: (input2) => `${input2}:${pseudo}`
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
match = input.match(PseudoClassesNotRE);
|
|
130
|
+
if (match) {
|
|
131
|
+
const pseudo = PseudoClasses[match[1]] || match[1];
|
|
132
|
+
return {
|
|
133
|
+
matcher: input.slice(match[1].length + 5),
|
|
134
|
+
selector: (input2) => `${input2}:not(:${pseudo})`
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
match = input.match(PseudoClassesGroupRE);
|
|
138
|
+
if (match) {
|
|
139
|
+
const pseudo = PseudoClasses[match[1]] || match[1];
|
|
140
|
+
return {
|
|
141
|
+
matcher: input.slice(match[1].length + 7),
|
|
142
|
+
selector: (input2) => `.group:${pseudo} ${input2}`
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
multiPass: true
|
|
147
|
+
};
|
|
115
148
|
|
|
116
149
|
// src/variants/index.ts
|
|
117
150
|
var variantImportant = {
|
|
@@ -153,8 +186,8 @@ var variants = [
|
|
|
153
186
|
variantBreakpoints,
|
|
154
187
|
...variantChildren,
|
|
155
188
|
...variantColorsClass,
|
|
156
|
-
|
|
157
|
-
|
|
189
|
+
variantPseudoClasses,
|
|
190
|
+
variantPseudoElements
|
|
158
191
|
];
|
|
159
192
|
|
|
160
193
|
|
|
@@ -168,5 +201,4 @@ var variants = [
|
|
|
168
201
|
|
|
169
202
|
|
|
170
203
|
|
|
171
|
-
|
|
172
|
-
exports.variantBreakpoints = variantBreakpoints; exports.variantChildren = variantChildren; exports.variantColorsClass = variantColorsClass; exports.variantColorsMedia = variantColorsMedia; exports.createPseudoClassVariant = createPseudoClassVariant; exports.createPseudoElementVariant = createPseudoElementVariant; exports.variantPseudoClasses = variantPseudoClasses; exports.variantPseudoElements = variantPseudoElements; exports.variantImportant = variantImportant; exports.variantNegative = variantNegative; exports.variants = variants;
|
|
204
|
+
exports.variantBreakpoints = variantBreakpoints; exports.variantChildren = variantChildren; exports.variantColorsClass = variantColorsClass; exports.variantColorsMedia = variantColorsMedia; exports.PseudoClasses = PseudoClasses; exports.variantPseudoElements = variantPseudoElements; exports.variantPseudoClasses = variantPseudoClasses; exports.variantImportant = variantImportant; exports.variantNegative = variantNegative; exports.variants = variants;
|
|
@@ -62,17 +62,7 @@ var variantColorsMedia = [
|
|
|
62
62
|
|
|
63
63
|
// src/variants/pseudo.ts
|
|
64
64
|
import { toArray } from "@unocss/core";
|
|
65
|
-
|
|
66
|
-
return [
|
|
67
|
-
variantMatcher(name, (input) => `${input}:${pseudo}`),
|
|
68
|
-
variantMatcher(`not-${name}`, (input) => `${input}:not(:${pseudo})`),
|
|
69
|
-
variantMatcher(`group-${name}`, (input) => `.group:${pseudo} ${input}`)
|
|
70
|
-
];
|
|
71
|
-
}
|
|
72
|
-
function createPseudoElementVariant(name) {
|
|
73
|
-
return variantMatcher(name, (input) => `${input}::${name}`);
|
|
74
|
-
}
|
|
75
|
-
var variantPseudoClasses = [
|
|
65
|
+
var PseudoClasses = Object.fromEntries([
|
|
76
66
|
"active",
|
|
77
67
|
"checked",
|
|
78
68
|
"default",
|
|
@@ -104,14 +94,57 @@ var variantPseudoClasses = [
|
|
|
104
94
|
["even", "nth-child(even)"],
|
|
105
95
|
["odd-of-type", "nth-of-type(odd)"],
|
|
106
96
|
["odd", "nth-child(odd)"]
|
|
107
|
-
].
|
|
108
|
-
var
|
|
97
|
+
].map(toArray));
|
|
98
|
+
var PseudoElements = [
|
|
109
99
|
"before",
|
|
110
100
|
"after",
|
|
111
101
|
"first-letter",
|
|
112
102
|
"first-line",
|
|
113
103
|
"selection"
|
|
114
|
-
]
|
|
104
|
+
];
|
|
105
|
+
var PseudoElementsRE = new RegExp(`^(${PseudoElements.join("|")})[:-]`);
|
|
106
|
+
var PseudoClassesStr = Object.keys(PseudoClasses).join("|");
|
|
107
|
+
var PseudoClassesRE = new RegExp(`^(${PseudoClassesStr})[:-]`);
|
|
108
|
+
var PseudoClassesNotRE = new RegExp(`^not-(${PseudoClassesStr})[:-]`);
|
|
109
|
+
var PseudoClassesGroupRE = new RegExp(`^group-(${PseudoClassesStr})[:-]`);
|
|
110
|
+
var variantPseudoElements = (input) => {
|
|
111
|
+
const match = input.match(PseudoElementsRE);
|
|
112
|
+
if (match) {
|
|
113
|
+
return {
|
|
114
|
+
matcher: input.slice(match[1].length + 1),
|
|
115
|
+
selector: (input2) => `${input2}::${match[1]}`
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
var variantPseudoClasses = {
|
|
120
|
+
match: (input) => {
|
|
121
|
+
let match = input.match(PseudoClassesRE);
|
|
122
|
+
if (match) {
|
|
123
|
+
const pseudo = PseudoClasses[match[1]] || match[1];
|
|
124
|
+
return {
|
|
125
|
+
matcher: input.slice(match[1].length + 1),
|
|
126
|
+
selector: (input2) => `${input2}:${pseudo}`
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
match = input.match(PseudoClassesNotRE);
|
|
130
|
+
if (match) {
|
|
131
|
+
const pseudo = PseudoClasses[match[1]] || match[1];
|
|
132
|
+
return {
|
|
133
|
+
matcher: input.slice(match[1].length + 5),
|
|
134
|
+
selector: (input2) => `${input2}:not(:${pseudo})`
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
match = input.match(PseudoClassesGroupRE);
|
|
138
|
+
if (match) {
|
|
139
|
+
const pseudo = PseudoClasses[match[1]] || match[1];
|
|
140
|
+
return {
|
|
141
|
+
matcher: input.slice(match[1].length + 7),
|
|
142
|
+
selector: (input2) => `.group:${pseudo} ${input2}`
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
multiPass: true
|
|
147
|
+
};
|
|
115
148
|
|
|
116
149
|
// src/variants/index.ts
|
|
117
150
|
var variantImportant = {
|
|
@@ -153,8 +186,8 @@ var variants = [
|
|
|
153
186
|
variantBreakpoints,
|
|
154
187
|
...variantChildren,
|
|
155
188
|
...variantColorsClass,
|
|
156
|
-
|
|
157
|
-
|
|
189
|
+
variantPseudoClasses,
|
|
190
|
+
variantPseudoElements
|
|
158
191
|
];
|
|
159
192
|
|
|
160
193
|
export {
|
|
@@ -162,10 +195,9 @@ export {
|
|
|
162
195
|
variantChildren,
|
|
163
196
|
variantColorsClass,
|
|
164
197
|
variantColorsMedia,
|
|
165
|
-
|
|
166
|
-
createPseudoElementVariant,
|
|
167
|
-
variantPseudoClasses,
|
|
198
|
+
PseudoClasses,
|
|
168
199
|
variantPseudoElements,
|
|
200
|
+
variantPseudoClasses,
|
|
169
201
|
variantImportant,
|
|
170
202
|
variantNegative,
|
|
171
203
|
variants
|
package/dist/index.js
CHANGED
|
@@ -7,14 +7,14 @@ var _chunkNYCCT2OFjs = require('./chunk-NYCCT2OF.js');
|
|
|
7
7
|
var _chunkPZ7CZSZDjs = require('./chunk-PZ7CZSZD.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk54CWTYJQjs = require('./chunk-54CWTYJQ.js');
|
|
11
11
|
require('./chunk-OFR2H3GI.js');
|
|
12
12
|
|
|
13
13
|
// src/index.ts
|
|
14
14
|
var preset = () => ({
|
|
15
15
|
theme: _chunkPZ7CZSZDjs.theme,
|
|
16
16
|
rules: _chunkNYCCT2OFjs.rules,
|
|
17
|
-
variants:
|
|
17
|
+
variants: _chunk54CWTYJQjs.variants
|
|
18
18
|
});
|
|
19
19
|
var src_default = preset;
|
|
20
20
|
|
package/dist/index.mjs
CHANGED
package/dist/variants.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Variant } from '@unocss/core';
|
|
1
|
+
import { Variant, VariantFunction, VariantObject } from '@unocss/core';
|
|
3
2
|
import { T as Theme } from './index-3b695534';
|
|
4
3
|
|
|
5
4
|
declare const variantBreakpoints: Variant<Theme>;
|
|
@@ -9,13 +8,12 @@ declare const variantColorsMedia: Variant[];
|
|
|
9
8
|
|
|
10
9
|
declare const variantChildren: Variant[];
|
|
11
10
|
|
|
12
|
-
declare
|
|
13
|
-
declare
|
|
14
|
-
declare const variantPseudoClasses:
|
|
15
|
-
declare const variantPseudoElements: Variant<{}>[];
|
|
11
|
+
declare const PseudoClasses: Record<string, string | undefined>;
|
|
12
|
+
declare const variantPseudoElements: VariantFunction;
|
|
13
|
+
declare const variantPseudoClasses: VariantObject;
|
|
16
14
|
|
|
17
15
|
declare const variantImportant: Variant;
|
|
18
16
|
declare const variantNegative: Variant;
|
|
19
|
-
declare const variants:
|
|
17
|
+
declare const variants: Variant<Theme>[];
|
|
20
18
|
|
|
21
|
-
export {
|
|
19
|
+
export { PseudoClasses, variantBreakpoints, variantChildren, variantColorsClass, variantColorsMedia, variantImportant, variantNegative, variantPseudoClasses, variantPseudoElements, variants };
|
package/dist/variants.js
CHANGED
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
var _chunkAMSMQAHKjs = require('./chunk-AMSMQAHK.js');
|
|
12
|
+
var _chunk54CWTYJQjs = require('./chunk-54CWTYJQ.js');
|
|
14
13
|
require('./chunk-OFR2H3GI.js');
|
|
15
14
|
|
|
16
15
|
|
|
@@ -23,5 +22,4 @@ require('./chunk-OFR2H3GI.js');
|
|
|
23
22
|
|
|
24
23
|
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
exports.createPseudoClassVariant = _chunkAMSMQAHKjs.createPseudoClassVariant; exports.createPseudoElementVariant = _chunkAMSMQAHKjs.createPseudoElementVariant; exports.variantBreakpoints = _chunkAMSMQAHKjs.variantBreakpoints; exports.variantChildren = _chunkAMSMQAHKjs.variantChildren; exports.variantColorsClass = _chunkAMSMQAHKjs.variantColorsClass; exports.variantColorsMedia = _chunkAMSMQAHKjs.variantColorsMedia; exports.variantImportant = _chunkAMSMQAHKjs.variantImportant; exports.variantNegative = _chunkAMSMQAHKjs.variantNegative; exports.variantPseudoClasses = _chunkAMSMQAHKjs.variantPseudoClasses; exports.variantPseudoElements = _chunkAMSMQAHKjs.variantPseudoElements; exports.variants = _chunkAMSMQAHKjs.variants;
|
|
25
|
+
exports.PseudoClasses = _chunk54CWTYJQjs.PseudoClasses; exports.variantBreakpoints = _chunk54CWTYJQjs.variantBreakpoints; exports.variantChildren = _chunk54CWTYJQjs.variantChildren; exports.variantColorsClass = _chunk54CWTYJQjs.variantColorsClass; exports.variantColorsMedia = _chunk54CWTYJQjs.variantColorsMedia; exports.variantImportant = _chunk54CWTYJQjs.variantImportant; exports.variantNegative = _chunk54CWTYJQjs.variantNegative; exports.variantPseudoClasses = _chunk54CWTYJQjs.variantPseudoClasses; exports.variantPseudoElements = _chunk54CWTYJQjs.variantPseudoElements; exports.variants = _chunk54CWTYJQjs.variants;
|
package/dist/variants.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
createPseudoElementVariant,
|
|
2
|
+
PseudoClasses,
|
|
4
3
|
variantBreakpoints,
|
|
5
4
|
variantChildren,
|
|
6
5
|
variantColorsClass,
|
|
@@ -10,11 +9,10 @@ import {
|
|
|
10
9
|
variantPseudoClasses,
|
|
11
10
|
variantPseudoElements,
|
|
12
11
|
variants
|
|
13
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VZLJK4OI.mjs";
|
|
14
13
|
import "./chunk-YI4MPAID.mjs";
|
|
15
14
|
export {
|
|
16
|
-
|
|
17
|
-
createPseudoElementVariant,
|
|
15
|
+
PseudoClasses,
|
|
18
16
|
variantBreakpoints,
|
|
19
17
|
variantChildren,
|
|
20
18
|
variantColorsClass,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-uno",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"homepage": "https://github.com/antfu/unocss#readme",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"*.css"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@unocss/core": "0.
|
|
44
|
+
"@unocss/core": "0.4.0"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "tsup",
|