@unocss/preset-mini 0.21.0 → 0.22.1
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/default.cjs +25 -19
- package/dist/chunks/default.mjs +25 -19
- package/dist/chunks/default2.cjs +210 -78
- package/dist/chunks/default2.mjs +211 -81
- package/dist/chunks/default3.cjs +162 -6
- package/dist/chunks/default3.mjs +152 -2
- package/dist/chunks/utilities.cjs +31 -4
- package/dist/chunks/utilities.mjs +31 -5
- package/dist/{colors-6d634692.d.ts → colors-338f482c.d.ts} +1 -1
- package/dist/colors.d.ts +2 -2
- package/dist/{default-958434b6.d.ts → default-17948303.d.ts} +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +5 -4
- package/dist/index.mjs +1 -2
- package/dist/rules.cjs +2 -1
- package/dist/rules.d.ts +11 -2
- package/dist/rules.mjs +1 -2
- package/dist/theme.d.ts +8 -8
- package/dist/{types-a2d2b52f.d.ts → types-c14b808b.d.ts} +8 -2
- package/dist/utilities-13c33ba5.d.ts +56 -0
- package/dist/utils.cjs +1 -0
- package/dist/utils.d.ts +5 -55
- package/dist/utils.mjs +1 -1
- package/dist/variants.cjs +6 -7
- package/dist/variants.d.ts +4 -3
- package/dist/variants.mjs +1 -2
- package/package.json +2 -2
- package/dist/chunks/pseudo.cjs +0 -160
- package/dist/chunks/pseudo.mjs +0 -153
package/dist/variants.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as _unocss_core from '@unocss/core';
|
|
2
2
|
import { Variant, VariantFunction, VariantObject } from '@unocss/core';
|
|
3
|
-
import { T as Theme } from './types-
|
|
3
|
+
import { T as Theme } from './types-c14b808b';
|
|
4
4
|
import { PresetMiniOptions } from './index';
|
|
5
|
-
import './default-
|
|
6
|
-
import './colors-
|
|
5
|
+
import './default-17948303';
|
|
6
|
+
import './colors-338f482c';
|
|
7
|
+
import './utilities-13c33ba5';
|
|
7
8
|
|
|
8
9
|
declare const variantBreakpoints: Variant<Theme>;
|
|
9
10
|
|
package/dist/variants.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { a as variantBreakpoints, c as variantColorsMediaOrClass, b as variantCombinators, e as variantImportant, d as variantLanguageDirections, g as variantMotions, f as variantNegative, h as variantOrientations, i as variantPrint, v as variants } from './chunks/default3.mjs';
|
|
2
|
-
export { C as CONTROL_BYPASS_PSEUDO_CLASS, p as partClasses, a as variantPseudoClassFunctions, v as variantPseudoClasses, c as variantPseudoElements, b as variantTaggedPseudoClasses } from './chunks/pseudo.mjs';
|
|
1
|
+
export { C as CONTROL_BYPASS_PSEUDO_CLASS, p as partClasses, a as variantBreakpoints, c as variantColorsMediaOrClass, b as variantCombinators, e as variantImportant, d as variantLanguageDirections, g as variantMotions, f as variantNegative, h as variantOrientations, i as variantPrint, l as variantPseudoClassFunctions, k as variantPseudoClasses, j as variantPseudoElements, m as variantTaggedPseudoClasses, v as variants } from './chunks/default3.mjs';
|
|
3
2
|
import './chunks/variants.mjs';
|
|
4
3
|
import '@unocss/core';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-mini",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.1",
|
|
4
4
|
"description": "The minimal preset for UnoCSS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unocss",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"*.css"
|
|
62
62
|
],
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@unocss/core": "0.
|
|
64
|
+
"@unocss/core": "0.22.1"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "unbuild",
|
package/dist/chunks/pseudo.cjs
DELETED
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const core = require('@unocss/core');
|
|
4
|
-
|
|
5
|
-
const CONTROL_BYPASS_PSEUDO_CLASS = "$$no-pseudo";
|
|
6
|
-
const PseudoClasses = Object.fromEntries([
|
|
7
|
-
"any-link",
|
|
8
|
-
"link",
|
|
9
|
-
"visited",
|
|
10
|
-
"target",
|
|
11
|
-
["open", "[open]"],
|
|
12
|
-
"hover",
|
|
13
|
-
"active",
|
|
14
|
-
"focus-visible",
|
|
15
|
-
"focus-within",
|
|
16
|
-
"focus",
|
|
17
|
-
"autofill",
|
|
18
|
-
"enabled",
|
|
19
|
-
"disabled",
|
|
20
|
-
"read-only",
|
|
21
|
-
"read-write",
|
|
22
|
-
"placeholder-shown",
|
|
23
|
-
"default",
|
|
24
|
-
"checked",
|
|
25
|
-
"indeterminate",
|
|
26
|
-
"valid",
|
|
27
|
-
"invalid",
|
|
28
|
-
"in-range",
|
|
29
|
-
"out-of-range",
|
|
30
|
-
"required",
|
|
31
|
-
"optional",
|
|
32
|
-
"root",
|
|
33
|
-
"empty",
|
|
34
|
-
["even-of-type", ":nth-of-type(even)"],
|
|
35
|
-
["even", ":nth-child(even)"],
|
|
36
|
-
["odd-of-type", ":nth-of-type(odd)"],
|
|
37
|
-
["odd", ":nth-child(odd)"],
|
|
38
|
-
"first-of-type",
|
|
39
|
-
["first", ":first-child"],
|
|
40
|
-
"last-of-type",
|
|
41
|
-
["last", ":last-child"],
|
|
42
|
-
"only-child",
|
|
43
|
-
"only-of-type"
|
|
44
|
-
].map(core.toArray));
|
|
45
|
-
const PseudoElements = Object.fromEntries([
|
|
46
|
-
"placeholder",
|
|
47
|
-
"before",
|
|
48
|
-
"after",
|
|
49
|
-
"first-letter",
|
|
50
|
-
"first-line",
|
|
51
|
-
"selection",
|
|
52
|
-
"marker",
|
|
53
|
-
["file", "::file-selector-button"]
|
|
54
|
-
].map(core.toArray));
|
|
55
|
-
const PseudoClassFunctions = [
|
|
56
|
-
"not",
|
|
57
|
-
"is",
|
|
58
|
-
"where",
|
|
59
|
-
"has"
|
|
60
|
-
];
|
|
61
|
-
const PseudoElementsStr = Object.keys(PseudoElements).join("|");
|
|
62
|
-
const PseudoClassesStr = Object.keys(PseudoClasses).join("|");
|
|
63
|
-
const PseudoClassFunctionsStr = PseudoClassFunctions.join("|");
|
|
64
|
-
const PartClassesRE = /(part-\[(.+)]:)(.+)/;
|
|
65
|
-
const PseudoElementsRE = new RegExp(`^(${PseudoElementsStr})[:-]`);
|
|
66
|
-
const PseudoClassesRE = new RegExp(`^(${PseudoClassesStr})[:-]`);
|
|
67
|
-
const PseudoClassFunctionsRE = new RegExp(`^(${PseudoClassFunctionsStr})-(${PseudoClassesStr})[:-]`);
|
|
68
|
-
function shouldAdd(entires) {
|
|
69
|
-
return !entires.find((i) => i[0] === CONTROL_BYPASS_PSEUDO_CLASS) || void 0;
|
|
70
|
-
}
|
|
71
|
-
const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
72
|
-
const re = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))[:-]`);
|
|
73
|
-
const rawRe = new RegExp(`^${core.escapeRegExp(parent)}:`);
|
|
74
|
-
return (input) => {
|
|
75
|
-
const match = input.match(re);
|
|
76
|
-
if (match) {
|
|
77
|
-
let pseudo = PseudoClasses[match[3]] || `:${match[3]}`;
|
|
78
|
-
if (match[2])
|
|
79
|
-
pseudo = `:${match[2]}(${pseudo})`;
|
|
80
|
-
return {
|
|
81
|
-
matcher: input.slice(match[1].length + tag.length + 2),
|
|
82
|
-
selector: (s, body) => {
|
|
83
|
-
return shouldAdd(body) && rawRe.test(s) ? s.replace(rawRe, `${parent}${pseudo}:`) : `${parent}${pseudo}${combinator}${s}`;
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
const variantPseudoElements = (input) => {
|
|
90
|
-
const match = input.match(PseudoElementsRE);
|
|
91
|
-
if (match) {
|
|
92
|
-
const pseudo = PseudoElements[match[1]] || `::${match[1]}`;
|
|
93
|
-
return {
|
|
94
|
-
matcher: input.slice(match[1].length + 1),
|
|
95
|
-
selector: (s) => `${s}${pseudo}`
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
const variantPseudoClasses = {
|
|
100
|
-
match: (input) => {
|
|
101
|
-
const match = input.match(PseudoClassesRE);
|
|
102
|
-
if (match) {
|
|
103
|
-
const pseudo = PseudoClasses[match[1]] || `:${match[1]}`;
|
|
104
|
-
return {
|
|
105
|
-
matcher: input.slice(match[1].length + 1),
|
|
106
|
-
selector: (s, body) => shouldAdd(body) && `${s}${pseudo}`
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
multiPass: true
|
|
111
|
-
};
|
|
112
|
-
const variantPseudoClassFunctions = {
|
|
113
|
-
match: (input) => {
|
|
114
|
-
const match = input.match(PseudoClassFunctionsRE);
|
|
115
|
-
if (match) {
|
|
116
|
-
const fn = match[1];
|
|
117
|
-
const pseudo = PseudoClasses[match[2]] || `:${match[2]}`;
|
|
118
|
-
return {
|
|
119
|
-
matcher: input.slice(match[1].length + match[2].length + 2),
|
|
120
|
-
selector: (s, body) => shouldAdd(body) && `${s}:${fn}(${pseudo})`
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
multiPass: true
|
|
125
|
-
};
|
|
126
|
-
const variantTaggedPseudoClasses = (options = {}) => {
|
|
127
|
-
const attributify = !!options?.attributifyPseudo;
|
|
128
|
-
return [
|
|
129
|
-
{
|
|
130
|
-
match: taggedPseudoClassMatcher("group", attributify ? '[group=""]' : ".group", " "),
|
|
131
|
-
multiPass: true
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
match: taggedPseudoClassMatcher("peer", attributify ? '[peer=""]' : ".peer", "~"),
|
|
135
|
-
multiPass: true
|
|
136
|
-
}
|
|
137
|
-
];
|
|
138
|
-
};
|
|
139
|
-
const partClasses = {
|
|
140
|
-
match: (input) => {
|
|
141
|
-
const match = input.match(PartClassesRE);
|
|
142
|
-
if (match) {
|
|
143
|
-
const part = `part(${match[2]})`;
|
|
144
|
-
return {
|
|
145
|
-
matcher: input.slice(match[1].length),
|
|
146
|
-
selector: (s, body) => {
|
|
147
|
-
return shouldAdd(body) && `${s}::${part}`;
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
multiPass: true
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
exports.CONTROL_BYPASS_PSEUDO_CLASS = CONTROL_BYPASS_PSEUDO_CLASS;
|
|
156
|
-
exports.partClasses = partClasses;
|
|
157
|
-
exports.variantPseudoClassFunctions = variantPseudoClassFunctions;
|
|
158
|
-
exports.variantPseudoClasses = variantPseudoClasses;
|
|
159
|
-
exports.variantPseudoElements = variantPseudoElements;
|
|
160
|
-
exports.variantTaggedPseudoClasses = variantTaggedPseudoClasses;
|
package/dist/chunks/pseudo.mjs
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { toArray, escapeRegExp } from '@unocss/core';
|
|
2
|
-
|
|
3
|
-
const CONTROL_BYPASS_PSEUDO_CLASS = "$$no-pseudo";
|
|
4
|
-
const PseudoClasses = Object.fromEntries([
|
|
5
|
-
"any-link",
|
|
6
|
-
"link",
|
|
7
|
-
"visited",
|
|
8
|
-
"target",
|
|
9
|
-
["open", "[open]"],
|
|
10
|
-
"hover",
|
|
11
|
-
"active",
|
|
12
|
-
"focus-visible",
|
|
13
|
-
"focus-within",
|
|
14
|
-
"focus",
|
|
15
|
-
"autofill",
|
|
16
|
-
"enabled",
|
|
17
|
-
"disabled",
|
|
18
|
-
"read-only",
|
|
19
|
-
"read-write",
|
|
20
|
-
"placeholder-shown",
|
|
21
|
-
"default",
|
|
22
|
-
"checked",
|
|
23
|
-
"indeterminate",
|
|
24
|
-
"valid",
|
|
25
|
-
"invalid",
|
|
26
|
-
"in-range",
|
|
27
|
-
"out-of-range",
|
|
28
|
-
"required",
|
|
29
|
-
"optional",
|
|
30
|
-
"root",
|
|
31
|
-
"empty",
|
|
32
|
-
["even-of-type", ":nth-of-type(even)"],
|
|
33
|
-
["even", ":nth-child(even)"],
|
|
34
|
-
["odd-of-type", ":nth-of-type(odd)"],
|
|
35
|
-
["odd", ":nth-child(odd)"],
|
|
36
|
-
"first-of-type",
|
|
37
|
-
["first", ":first-child"],
|
|
38
|
-
"last-of-type",
|
|
39
|
-
["last", ":last-child"],
|
|
40
|
-
"only-child",
|
|
41
|
-
"only-of-type"
|
|
42
|
-
].map(toArray));
|
|
43
|
-
const PseudoElements = Object.fromEntries([
|
|
44
|
-
"placeholder",
|
|
45
|
-
"before",
|
|
46
|
-
"after",
|
|
47
|
-
"first-letter",
|
|
48
|
-
"first-line",
|
|
49
|
-
"selection",
|
|
50
|
-
"marker",
|
|
51
|
-
["file", "::file-selector-button"]
|
|
52
|
-
].map(toArray));
|
|
53
|
-
const PseudoClassFunctions = [
|
|
54
|
-
"not",
|
|
55
|
-
"is",
|
|
56
|
-
"where",
|
|
57
|
-
"has"
|
|
58
|
-
];
|
|
59
|
-
const PseudoElementsStr = Object.keys(PseudoElements).join("|");
|
|
60
|
-
const PseudoClassesStr = Object.keys(PseudoClasses).join("|");
|
|
61
|
-
const PseudoClassFunctionsStr = PseudoClassFunctions.join("|");
|
|
62
|
-
const PartClassesRE = /(part-\[(.+)]:)(.+)/;
|
|
63
|
-
const PseudoElementsRE = new RegExp(`^(${PseudoElementsStr})[:-]`);
|
|
64
|
-
const PseudoClassesRE = new RegExp(`^(${PseudoClassesStr})[:-]`);
|
|
65
|
-
const PseudoClassFunctionsRE = new RegExp(`^(${PseudoClassFunctionsStr})-(${PseudoClassesStr})[:-]`);
|
|
66
|
-
function shouldAdd(entires) {
|
|
67
|
-
return !entires.find((i) => i[0] === CONTROL_BYPASS_PSEUDO_CLASS) || void 0;
|
|
68
|
-
}
|
|
69
|
-
const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
70
|
-
const re = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))[:-]`);
|
|
71
|
-
const rawRe = new RegExp(`^${escapeRegExp(parent)}:`);
|
|
72
|
-
return (input) => {
|
|
73
|
-
const match = input.match(re);
|
|
74
|
-
if (match) {
|
|
75
|
-
let pseudo = PseudoClasses[match[3]] || `:${match[3]}`;
|
|
76
|
-
if (match[2])
|
|
77
|
-
pseudo = `:${match[2]}(${pseudo})`;
|
|
78
|
-
return {
|
|
79
|
-
matcher: input.slice(match[1].length + tag.length + 2),
|
|
80
|
-
selector: (s, body) => {
|
|
81
|
-
return shouldAdd(body) && rawRe.test(s) ? s.replace(rawRe, `${parent}${pseudo}:`) : `${parent}${pseudo}${combinator}${s}`;
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
const variantPseudoElements = (input) => {
|
|
88
|
-
const match = input.match(PseudoElementsRE);
|
|
89
|
-
if (match) {
|
|
90
|
-
const pseudo = PseudoElements[match[1]] || `::${match[1]}`;
|
|
91
|
-
return {
|
|
92
|
-
matcher: input.slice(match[1].length + 1),
|
|
93
|
-
selector: (s) => `${s}${pseudo}`
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
const variantPseudoClasses = {
|
|
98
|
-
match: (input) => {
|
|
99
|
-
const match = input.match(PseudoClassesRE);
|
|
100
|
-
if (match) {
|
|
101
|
-
const pseudo = PseudoClasses[match[1]] || `:${match[1]}`;
|
|
102
|
-
return {
|
|
103
|
-
matcher: input.slice(match[1].length + 1),
|
|
104
|
-
selector: (s, body) => shouldAdd(body) && `${s}${pseudo}`
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
multiPass: true
|
|
109
|
-
};
|
|
110
|
-
const variantPseudoClassFunctions = {
|
|
111
|
-
match: (input) => {
|
|
112
|
-
const match = input.match(PseudoClassFunctionsRE);
|
|
113
|
-
if (match) {
|
|
114
|
-
const fn = match[1];
|
|
115
|
-
const pseudo = PseudoClasses[match[2]] || `:${match[2]}`;
|
|
116
|
-
return {
|
|
117
|
-
matcher: input.slice(match[1].length + match[2].length + 2),
|
|
118
|
-
selector: (s, body) => shouldAdd(body) && `${s}:${fn}(${pseudo})`
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
multiPass: true
|
|
123
|
-
};
|
|
124
|
-
const variantTaggedPseudoClasses = (options = {}) => {
|
|
125
|
-
const attributify = !!options?.attributifyPseudo;
|
|
126
|
-
return [
|
|
127
|
-
{
|
|
128
|
-
match: taggedPseudoClassMatcher("group", attributify ? '[group=""]' : ".group", " "),
|
|
129
|
-
multiPass: true
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
match: taggedPseudoClassMatcher("peer", attributify ? '[peer=""]' : ".peer", "~"),
|
|
133
|
-
multiPass: true
|
|
134
|
-
}
|
|
135
|
-
];
|
|
136
|
-
};
|
|
137
|
-
const partClasses = {
|
|
138
|
-
match: (input) => {
|
|
139
|
-
const match = input.match(PartClassesRE);
|
|
140
|
-
if (match) {
|
|
141
|
-
const part = `part(${match[2]})`;
|
|
142
|
-
return {
|
|
143
|
-
matcher: input.slice(match[1].length),
|
|
144
|
-
selector: (s, body) => {
|
|
145
|
-
return shouldAdd(body) && `${s}::${part}`;
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
multiPass: true
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
export { CONTROL_BYPASS_PSEUDO_CLASS as C, variantPseudoClassFunctions as a, variantTaggedPseudoClasses as b, variantPseudoElements as c, partClasses as p, variantPseudoClasses as v };
|