@unocss/preset-mini 0.18.0 → 0.18.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/default2.cjs +1 -1
- package/dist/chunks/default2.mjs +1 -1
- package/dist/chunks/default3.cjs +1 -0
- package/dist/chunks/default3.mjs +2 -1
- package/dist/chunks/pseudo.cjs +24 -11
- package/dist/chunks/pseudo.mjs +24 -11
- package/dist/{colors-d6b5a5b4.d.ts → colors-6d634692.d.ts} +1 -1
- package/dist/colors.d.ts +2 -2
- package/dist/{default-c7c67d23.d.ts → default-958434b6.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/rules.d.ts +1 -1
- package/dist/theme.d.ts +4 -4
- package/dist/{types-7963d0b3.d.ts → types-a2d2b52f.d.ts} +8 -1
- package/dist/utils.d.ts +1 -1
- package/dist/variants.cjs +1 -1
- package/dist/variants.d.ts +5 -5
- package/dist/variants.mjs +1 -1
- package/package.json +2 -2
package/dist/chunks/default2.cjs
CHANGED
|
@@ -173,7 +173,7 @@ const flex = [
|
|
|
173
173
|
["flex-auto", { flex: "1 1 auto" }],
|
|
174
174
|
["flex-initial", { flex: "0 1 auto" }],
|
|
175
175
|
["flex-none", { flex: "none" }],
|
|
176
|
-
[/^flex
|
|
176
|
+
[/^flex-(\[.+\])$/, ([, d]) => ({ flex: utilities.handler.bracket(d).replace(/\d+\/\d+/, ($1) => utilities.handler.fraction($1)) })],
|
|
177
177
|
["flex-shrink", { "flex-shrink": 1 }],
|
|
178
178
|
["flex-shrink-0", { "flex-shrink": 0 }],
|
|
179
179
|
["flex-grow", { "flex-grow": 1 }],
|
package/dist/chunks/default2.mjs
CHANGED
|
@@ -171,7 +171,7 @@ const flex = [
|
|
|
171
171
|
["flex-auto", { flex: "1 1 auto" }],
|
|
172
172
|
["flex-initial", { flex: "0 1 auto" }],
|
|
173
173
|
["flex-none", { flex: "none" }],
|
|
174
|
-
[/^flex
|
|
174
|
+
[/^flex-(\[.+\])$/, ([, d]) => ({ flex: handler.bracket(d).replace(/\d+\/\d+/, ($1) => handler.fraction($1)) })],
|
|
175
175
|
["flex-shrink", { "flex-shrink": 1 }],
|
|
176
176
|
["flex-shrink-0", { "flex-shrink": 0 }],
|
|
177
177
|
["flex-grow", { "flex-grow": 1 }],
|
package/dist/chunks/default3.cjs
CHANGED
|
@@ -120,6 +120,7 @@ const variants = (options) => [
|
|
|
120
120
|
variantBreakpoints,
|
|
121
121
|
...variantCombinators,
|
|
122
122
|
pseudo.variantPseudoClasses,
|
|
123
|
+
pseudo.variantPseudoClassFunctions,
|
|
123
124
|
pseudo.variantTaggedPseudoClasses(options),
|
|
124
125
|
pseudo.variantPseudoElements,
|
|
125
126
|
pseudo.partClasses,
|
package/dist/chunks/default3.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v as variantMatcher } from './variants.mjs';
|
|
2
|
-
import { v as variantPseudoClasses, a as
|
|
2
|
+
import { v as variantPseudoClasses, a as variantPseudoClassFunctions, b as variantTaggedPseudoClasses, c as variantPseudoElements, p as partClasses } from './pseudo.mjs';
|
|
3
3
|
|
|
4
4
|
const regexCache = {};
|
|
5
5
|
const variantBreakpoints = (matcher, _, theme) => {
|
|
@@ -118,6 +118,7 @@ const variants = (options) => [
|
|
|
118
118
|
variantBreakpoints,
|
|
119
119
|
...variantCombinators,
|
|
120
120
|
variantPseudoClasses,
|
|
121
|
+
variantPseudoClassFunctions,
|
|
121
122
|
variantTaggedPseudoClasses(options),
|
|
122
123
|
variantPseudoElements,
|
|
123
124
|
partClasses,
|
package/dist/chunks/pseudo.cjs
CHANGED
|
@@ -47,23 +47,30 @@ const PseudoElements = [
|
|
|
47
47
|
"first-line",
|
|
48
48
|
"selection"
|
|
49
49
|
];
|
|
50
|
+
const PseudoClassFunctions = [
|
|
51
|
+
"not",
|
|
52
|
+
"is",
|
|
53
|
+
"where",
|
|
54
|
+
"has"
|
|
55
|
+
];
|
|
50
56
|
const PartClassesRE = /(part-\[(.+)]:)(.+)/;
|
|
51
57
|
const PseudoElementsRE = new RegExp(`^(${PseudoElements.join("|")})[:-]`);
|
|
52
58
|
const PseudoClassesStr = Object.keys(PseudoClasses).join("|");
|
|
59
|
+
const PseudoClassFunctionsStr = PseudoClassFunctions.join("|");
|
|
53
60
|
const PseudoClassesRE = new RegExp(`^(${PseudoClassesStr})[:-]`);
|
|
54
|
-
const
|
|
61
|
+
const PseudoClassFunctionsRE = new RegExp(`^(${PseudoClassFunctionsStr})-(${PseudoClassesStr})[:-]`);
|
|
55
62
|
function shouldAdd(entires) {
|
|
56
63
|
return !entires.find((i) => i[0] === CONTROL_BYPASS_PSEUDO_CLASS) || void 0;
|
|
57
64
|
}
|
|
58
|
-
|
|
59
|
-
const re = new RegExp(`^${tag}-((
|
|
65
|
+
const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
66
|
+
const re = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))[:-]`);
|
|
60
67
|
const rawRe = new RegExp(`^${core.escapeRegExp(parent)}:`);
|
|
61
68
|
return (input) => {
|
|
62
69
|
const match = input.match(re);
|
|
63
70
|
if (match) {
|
|
64
71
|
let pseudo = PseudoClasses[match[3]] || match[3];
|
|
65
72
|
if (match[2])
|
|
66
|
-
pseudo =
|
|
73
|
+
pseudo = `${match[2]}(:${pseudo})`;
|
|
67
74
|
return {
|
|
68
75
|
matcher: input.slice(match[1].length + tag.length + 2),
|
|
69
76
|
selector: (s, body) => {
|
|
@@ -72,7 +79,7 @@ function taggedPseudoClassMatcher(tag, parent, combinator) {
|
|
|
72
79
|
};
|
|
73
80
|
}
|
|
74
81
|
};
|
|
75
|
-
}
|
|
82
|
+
};
|
|
76
83
|
const variantPseudoElements = (input) => {
|
|
77
84
|
const match = input.match(PseudoElementsRE);
|
|
78
85
|
if (match) {
|
|
@@ -84,7 +91,7 @@ const variantPseudoElements = (input) => {
|
|
|
84
91
|
};
|
|
85
92
|
const variantPseudoClasses = {
|
|
86
93
|
match: (input) => {
|
|
87
|
-
|
|
94
|
+
const match = input.match(PseudoClassesRE);
|
|
88
95
|
if (match) {
|
|
89
96
|
const pseudo = PseudoClasses[match[1]] || match[1];
|
|
90
97
|
return {
|
|
@@ -92,12 +99,18 @@ const variantPseudoClasses = {
|
|
|
92
99
|
selector: (s, body) => shouldAdd(body) && `${s}:${pseudo}`
|
|
93
100
|
};
|
|
94
101
|
}
|
|
95
|
-
|
|
102
|
+
},
|
|
103
|
+
multiPass: true
|
|
104
|
+
};
|
|
105
|
+
const variantPseudoClassFunctions = {
|
|
106
|
+
match: (input) => {
|
|
107
|
+
const match = input.match(PseudoClassFunctionsRE);
|
|
96
108
|
if (match) {
|
|
97
|
-
const
|
|
109
|
+
const fn = match[1];
|
|
110
|
+
const pseudo = PseudoClasses[match[2]] || match[2];
|
|
98
111
|
return {
|
|
99
|
-
matcher: input.slice(match[1].length +
|
|
100
|
-
selector: (s, body) => shouldAdd(body) && `${s}
|
|
112
|
+
matcher: input.slice(match[1].length + match[2].length + 2),
|
|
113
|
+
selector: (s, body) => shouldAdd(body) && `${s}:${fn}(:${pseudo})`
|
|
101
114
|
};
|
|
102
115
|
}
|
|
103
116
|
},
|
|
@@ -132,8 +145,8 @@ const partClasses = {
|
|
|
132
145
|
};
|
|
133
146
|
|
|
134
147
|
exports.CONTROL_BYPASS_PSEUDO_CLASS = CONTROL_BYPASS_PSEUDO_CLASS;
|
|
135
|
-
exports.PseudoClasses = PseudoClasses;
|
|
136
148
|
exports.partClasses = partClasses;
|
|
149
|
+
exports.variantPseudoClassFunctions = variantPseudoClassFunctions;
|
|
137
150
|
exports.variantPseudoClasses = variantPseudoClasses;
|
|
138
151
|
exports.variantPseudoElements = variantPseudoElements;
|
|
139
152
|
exports.variantTaggedPseudoClasses = variantTaggedPseudoClasses;
|
package/dist/chunks/pseudo.mjs
CHANGED
|
@@ -45,23 +45,30 @@ const PseudoElements = [
|
|
|
45
45
|
"first-line",
|
|
46
46
|
"selection"
|
|
47
47
|
];
|
|
48
|
+
const PseudoClassFunctions = [
|
|
49
|
+
"not",
|
|
50
|
+
"is",
|
|
51
|
+
"where",
|
|
52
|
+
"has"
|
|
53
|
+
];
|
|
48
54
|
const PartClassesRE = /(part-\[(.+)]:)(.+)/;
|
|
49
55
|
const PseudoElementsRE = new RegExp(`^(${PseudoElements.join("|")})[:-]`);
|
|
50
56
|
const PseudoClassesStr = Object.keys(PseudoClasses).join("|");
|
|
57
|
+
const PseudoClassFunctionsStr = PseudoClassFunctions.join("|");
|
|
51
58
|
const PseudoClassesRE = new RegExp(`^(${PseudoClassesStr})[:-]`);
|
|
52
|
-
const
|
|
59
|
+
const PseudoClassFunctionsRE = new RegExp(`^(${PseudoClassFunctionsStr})-(${PseudoClassesStr})[:-]`);
|
|
53
60
|
function shouldAdd(entires) {
|
|
54
61
|
return !entires.find((i) => i[0] === CONTROL_BYPASS_PSEUDO_CLASS) || void 0;
|
|
55
62
|
}
|
|
56
|
-
|
|
57
|
-
const re = new RegExp(`^${tag}-((
|
|
63
|
+
const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
64
|
+
const re = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))[:-]`);
|
|
58
65
|
const rawRe = new RegExp(`^${escapeRegExp(parent)}:`);
|
|
59
66
|
return (input) => {
|
|
60
67
|
const match = input.match(re);
|
|
61
68
|
if (match) {
|
|
62
69
|
let pseudo = PseudoClasses[match[3]] || match[3];
|
|
63
70
|
if (match[2])
|
|
64
|
-
pseudo =
|
|
71
|
+
pseudo = `${match[2]}(:${pseudo})`;
|
|
65
72
|
return {
|
|
66
73
|
matcher: input.slice(match[1].length + tag.length + 2),
|
|
67
74
|
selector: (s, body) => {
|
|
@@ -70,7 +77,7 @@ function taggedPseudoClassMatcher(tag, parent, combinator) {
|
|
|
70
77
|
};
|
|
71
78
|
}
|
|
72
79
|
};
|
|
73
|
-
}
|
|
80
|
+
};
|
|
74
81
|
const variantPseudoElements = (input) => {
|
|
75
82
|
const match = input.match(PseudoElementsRE);
|
|
76
83
|
if (match) {
|
|
@@ -82,7 +89,7 @@ const variantPseudoElements = (input) => {
|
|
|
82
89
|
};
|
|
83
90
|
const variantPseudoClasses = {
|
|
84
91
|
match: (input) => {
|
|
85
|
-
|
|
92
|
+
const match = input.match(PseudoClassesRE);
|
|
86
93
|
if (match) {
|
|
87
94
|
const pseudo = PseudoClasses[match[1]] || match[1];
|
|
88
95
|
return {
|
|
@@ -90,12 +97,18 @@ const variantPseudoClasses = {
|
|
|
90
97
|
selector: (s, body) => shouldAdd(body) && `${s}:${pseudo}`
|
|
91
98
|
};
|
|
92
99
|
}
|
|
93
|
-
|
|
100
|
+
},
|
|
101
|
+
multiPass: true
|
|
102
|
+
};
|
|
103
|
+
const variantPseudoClassFunctions = {
|
|
104
|
+
match: (input) => {
|
|
105
|
+
const match = input.match(PseudoClassFunctionsRE);
|
|
94
106
|
if (match) {
|
|
95
|
-
const
|
|
107
|
+
const fn = match[1];
|
|
108
|
+
const pseudo = PseudoClasses[match[2]] || match[2];
|
|
96
109
|
return {
|
|
97
|
-
matcher: input.slice(match[1].length +
|
|
98
|
-
selector: (s, body) => shouldAdd(body) && `${s}
|
|
110
|
+
matcher: input.slice(match[1].length + match[2].length + 2),
|
|
111
|
+
selector: (s, body) => shouldAdd(body) && `${s}:${fn}(:${pseudo})`
|
|
99
112
|
};
|
|
100
113
|
}
|
|
101
114
|
},
|
|
@@ -129,4 +142,4 @@ const partClasses = {
|
|
|
129
142
|
multiPass: true
|
|
130
143
|
};
|
|
131
144
|
|
|
132
|
-
export { CONTROL_BYPASS_PSEUDO_CLASS as C,
|
|
145
|
+
export { CONTROL_BYPASS_PSEUDO_CLASS as C, variantPseudoClassFunctions as a, variantTaggedPseudoClasses as b, variantPseudoElements as c, partClasses as p, variantPseudoClasses as v };
|
package/dist/colors.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { c as colors } from './colors-
|
|
2
|
-
import './types-
|
|
1
|
+
export { c as colors } from './colors-6d634692';
|
|
2
|
+
import './types-a2d2b52f';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Preset } from '@unocss/core';
|
|
2
|
-
import { T as Theme } from './types-
|
|
3
|
-
export { T as Theme } from './types-
|
|
4
|
-
export { t as theme } from './default-
|
|
5
|
-
export { c as colors } from './colors-
|
|
2
|
+
import { T as Theme } from './types-a2d2b52f';
|
|
3
|
+
export { T as Theme, a as ThemeAnimation } from './types-a2d2b52f';
|
|
4
|
+
export { t as theme } from './default-958434b6';
|
|
5
|
+
export { c as colors } from './colors-6d634692';
|
|
6
6
|
|
|
7
7
|
interface PresetMiniOptions {
|
|
8
8
|
/**
|
package/dist/rules.d.ts
CHANGED
package/dist/theme.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { c as colors } from './colors-
|
|
2
|
-
export { t as theme } from './default-
|
|
3
|
-
import { T as Theme } from './types-
|
|
4
|
-
export { T as Theme } from './types-
|
|
1
|
+
export { c as colors } from './colors-6d634692';
|
|
2
|
+
export { t as theme } from './default-958434b6';
|
|
3
|
+
import { T as Theme } from './types-a2d2b52f';
|
|
4
|
+
export { T as Theme, a as ThemeAnimation } from './types-a2d2b52f';
|
|
5
5
|
|
|
6
6
|
declare const blur: {
|
|
7
7
|
DEFAULT: string;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
interface ThemeAnimation {
|
|
2
|
+
keyframes?: Record<string, string>;
|
|
3
|
+
durations?: Record<string, string>;
|
|
4
|
+
timingFns?: Record<string, string>;
|
|
5
|
+
properties?: Record<string, object>;
|
|
6
|
+
}
|
|
1
7
|
interface Theme {
|
|
2
8
|
width?: Record<string, string>;
|
|
3
9
|
height?: Record<string, string>;
|
|
@@ -19,6 +25,7 @@ interface Theme {
|
|
|
19
25
|
textStrokeWidth?: Record<string, string>;
|
|
20
26
|
blur?: Record<string, string>;
|
|
21
27
|
dropShadow?: Record<string, string | string[]>;
|
|
28
|
+
animation?: ThemeAnimation;
|
|
22
29
|
}
|
|
23
30
|
|
|
24
|
-
export { Theme as T };
|
|
31
|
+
export { Theme as T, ThemeAnimation as a };
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _unocss_core from '@unocss/core';
|
|
2
2
|
import { VariantHandler, DynamicMatcher, ParsedColorValue } from '@unocss/core';
|
|
3
|
-
import { T as Theme } from './types-
|
|
3
|
+
import { T as Theme } from './types-a2d2b52f';
|
|
4
4
|
|
|
5
5
|
declare const directionMap: Record<string, string[]>;
|
|
6
6
|
declare const cornerMap: Record<string, string[]>;
|
package/dist/variants.cjs
CHANGED
|
@@ -18,8 +18,8 @@ exports.variantNegative = _default.variantNegative;
|
|
|
18
18
|
exports.variantSpace = _default.variantSpace;
|
|
19
19
|
exports.variants = _default.variants;
|
|
20
20
|
exports.CONTROL_BYPASS_PSEUDO_CLASS = pseudo.CONTROL_BYPASS_PSEUDO_CLASS;
|
|
21
|
-
exports.PseudoClasses = pseudo.PseudoClasses;
|
|
22
21
|
exports.partClasses = pseudo.partClasses;
|
|
22
|
+
exports.variantPseudoClassFunctions = pseudo.variantPseudoClassFunctions;
|
|
23
23
|
exports.variantPseudoClasses = pseudo.variantPseudoClasses;
|
|
24
24
|
exports.variantPseudoElements = pseudo.variantPseudoElements;
|
|
25
25
|
exports.variantTaggedPseudoClasses = pseudo.variantTaggedPseudoClasses;
|
package/dist/variants.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Variant, VariantFunction, VariantObject } from '@unocss/core';
|
|
2
|
-
import { T as Theme } from './types-
|
|
2
|
+
import { T as Theme } from './types-a2d2b52f';
|
|
3
3
|
import { PresetMiniOptions } from './index';
|
|
4
|
-
import './default-
|
|
5
|
-
import './colors-
|
|
4
|
+
import './default-958434b6';
|
|
5
|
+
import './colors-6d634692';
|
|
6
6
|
|
|
7
7
|
declare const variantBreakpoints: Variant<Theme>;
|
|
8
8
|
|
|
@@ -18,10 +18,10 @@ declare const variantNegative: Variant;
|
|
|
18
18
|
declare const variantSpace: Variant;
|
|
19
19
|
|
|
20
20
|
declare const CONTROL_BYPASS_PSEUDO_CLASS = "$$no-pseudo";
|
|
21
|
-
declare const PseudoClasses: Record<string, string | undefined>;
|
|
22
21
|
declare const variantPseudoElements: VariantFunction;
|
|
23
22
|
declare const variantPseudoClasses: VariantObject;
|
|
23
|
+
declare const variantPseudoClassFunctions: VariantObject;
|
|
24
24
|
declare const variantTaggedPseudoClasses: (options?: PresetMiniOptions) => VariantObject;
|
|
25
25
|
declare const partClasses: VariantObject;
|
|
26
26
|
|
|
27
|
-
export { CONTROL_BYPASS_PSEUDO_CLASS,
|
|
27
|
+
export { CONTROL_BYPASS_PSEUDO_CLASS, partClasses, variantBreakpoints, variantColorsClass, variantColorsMedia, variantCombinators, variantImportant, variantNegative, variantPseudoClassFunctions, variantPseudoClasses, variantPseudoElements, variantSpace, variantTaggedPseudoClasses, variants };
|
package/dist/variants.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { a as variantBreakpoints, c as variantColorsClass, d as variantColorsMedia, b as variantCombinators, e as variantImportant, f as variantNegative, g as variantSpace, v as variants } from './chunks/default3.mjs';
|
|
2
|
-
export { C as CONTROL_BYPASS_PSEUDO_CLASS,
|
|
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';
|
|
3
3
|
import './chunks/variants.mjs';
|
|
4
4
|
import '@unocss/core';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-mini",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.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.18.
|
|
64
|
+
"@unocss/core": "0.18.1"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "unbuild",
|