@unocss/preset-mini 0.32.1 → 0.32.9
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/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/chunks/default2.cjs +2 -2
- package/dist/chunks/default2.mjs +3 -3
- package/dist/chunks/default3.cjs +49 -31
- package/dist/chunks/default3.mjs +50 -32
- package/dist/chunks/utilities.cjs +2 -0
- package/dist/chunks/utilities.mjs +2 -1
- package/dist/chunks/variants.cjs +2 -0
- package/dist/chunks/variants.mjs +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/{utilities-a7351781.d.ts → utilities-e7a7f845.d.ts} +2 -1
- package/dist/utils.cjs +1 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.mjs +1 -1
- package/dist/variants.d.ts +3 -3
- package/package.json +3 -4
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2021 Anthony Fu <https://github.com/antfu>
|
|
3
|
+
Copyright (c) 2021-PRESENT Anthony Fu <https://github.com/antfu>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
package/dist/chunks/default2.cjs
CHANGED
|
@@ -758,7 +758,8 @@ const transformBase = {
|
|
|
758
758
|
"--un-translate-y": 0,
|
|
759
759
|
"--un-translate-z": 0,
|
|
760
760
|
...transformCpu,
|
|
761
|
-
[core.CONTROL_SHORTCUT_NO_MERGE]: ""
|
|
761
|
+
[core.CONTROL_SHORTCUT_NO_MERGE]: "",
|
|
762
|
+
[utilities.CONTROL_MINI_NO_NEGATIVE]: ""
|
|
762
763
|
};
|
|
763
764
|
const transforms = [
|
|
764
765
|
[/^(?:transform-)?origin-(.+)$/, ([, s]) => ({ "transform-origin": utilities.positionMap[s] ?? utilities.handler.bracket.cssvar(s) }), { autocomplete: [`transform-origin-(${Object.keys(utilities.positionMap).join("|")})`, `origin-(${Object.keys(utilities.positionMap).join("|")})`] }],
|
|
@@ -979,7 +980,6 @@ const rules = [
|
|
|
979
980
|
overflows,
|
|
980
981
|
outline,
|
|
981
982
|
appearance,
|
|
982
|
-
positions,
|
|
983
983
|
orders,
|
|
984
984
|
justifies,
|
|
985
985
|
alignments,
|
package/dist/chunks/default2.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as handler, c as colorResolver, d as directionMap, a as hasParseableColor, p as parseColor, b as colorToString, e as cornerMap, f as colorableShadows, i as insetMap, r as resolveVerticalBreakpoints, g as resolveBreakpoints, j as directionSize, k as positionMap, x as xyzMap } from './utilities.mjs';
|
|
1
|
+
import { h as handler, c as colorResolver, d as directionMap, a as hasParseableColor, p as parseColor, b as colorToString, e as cornerMap, f as colorableShadows, i as insetMap, r as resolveVerticalBreakpoints, g as resolveBreakpoints, j as directionSize, C as CONTROL_MINI_NO_NEGATIVE, k as positionMap, x as xyzMap } from './utilities.mjs';
|
|
2
2
|
import { toArray, CONTROL_SHORTCUT_NO_MERGE } from '@unocss/core';
|
|
3
3
|
|
|
4
4
|
const verticalAlignAlias = {
|
|
@@ -756,7 +756,8 @@ const transformBase = {
|
|
|
756
756
|
"--un-translate-y": 0,
|
|
757
757
|
"--un-translate-z": 0,
|
|
758
758
|
...transformCpu,
|
|
759
|
-
[CONTROL_SHORTCUT_NO_MERGE]: ""
|
|
759
|
+
[CONTROL_SHORTCUT_NO_MERGE]: "",
|
|
760
|
+
[CONTROL_MINI_NO_NEGATIVE]: ""
|
|
760
761
|
};
|
|
761
762
|
const transforms = [
|
|
762
763
|
[/^(?:transform-)?origin-(.+)$/, ([, s]) => ({ "transform-origin": positionMap[s] ?? handler.bracket.cssvar(s) }), { autocomplete: [`transform-origin-(${Object.keys(positionMap).join("|")})`, `origin-(${Object.keys(positionMap).join("|")})`] }],
|
|
@@ -977,7 +978,6 @@ const rules = [
|
|
|
977
978
|
overflows,
|
|
978
979
|
outline,
|
|
979
980
|
appearance,
|
|
980
|
-
positions,
|
|
981
981
|
orders,
|
|
982
982
|
justifies,
|
|
983
983
|
alignments,
|
package/dist/chunks/default3.cjs
CHANGED
|
@@ -12,6 +12,7 @@ const calcMaxWidthBySize = (size) => {
|
|
|
12
12
|
return Number.isNaN(maxWidth) ? size : `${maxWidth}${unit}`;
|
|
13
13
|
};
|
|
14
14
|
const variantBreakpoints = {
|
|
15
|
+
name: "breakpoints",
|
|
15
16
|
match(matcher, context) {
|
|
16
17
|
const variantEntries = Object.entries(utilities.resolveBreakpoints(context) ?? {}).map(([point, size], idx) => [point, size, idx]);
|
|
17
18
|
for (const [point, size, idx] of variantEntries) {
|
|
@@ -52,13 +53,16 @@ const variantBreakpoints = {
|
|
|
52
53
|
|
|
53
54
|
const scopeMatcher = (strict, name, template) => {
|
|
54
55
|
const re = strict ? new RegExp(`^${name}(?:-\\[(.+?)\\])[:-]`) : new RegExp(`^${name}(?:-\\[(.+?)\\])?[:-]`);
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
return {
|
|
57
|
+
name: `combinator:${name}`,
|
|
58
|
+
match: (matcher) => {
|
|
59
|
+
const match = matcher.match(re);
|
|
60
|
+
if (match) {
|
|
61
|
+
return {
|
|
62
|
+
matcher: matcher.slice(match[0].length),
|
|
63
|
+
selector: (s) => template.replace("&&-s", s).replace("&&-c", match[1] ?? "*")
|
|
64
|
+
};
|
|
65
|
+
}
|
|
62
66
|
}
|
|
63
67
|
};
|
|
64
68
|
};
|
|
@@ -75,14 +79,17 @@ const variantCombinators = [
|
|
|
75
79
|
];
|
|
76
80
|
|
|
77
81
|
const variantPrint = variants$1.variantParentMatcher("print", "@media print");
|
|
78
|
-
const variantCustomMedia =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
const variantCustomMedia = {
|
|
83
|
+
name: "media",
|
|
84
|
+
match(matcher, { theme }) {
|
|
85
|
+
const match = matcher.match(/^media-([_\d\w]+)[:-]/);
|
|
86
|
+
if (match) {
|
|
87
|
+
const media = theme.media?.[match[1]] ?? `(--${match[1]})`;
|
|
88
|
+
return {
|
|
89
|
+
matcher: matcher.slice(match[0].length),
|
|
90
|
+
parent: `@media ${media}`
|
|
91
|
+
};
|
|
92
|
+
}
|
|
86
93
|
}
|
|
87
94
|
};
|
|
88
95
|
|
|
@@ -105,6 +112,7 @@ const variantLanguageDirections = [
|
|
|
105
112
|
];
|
|
106
113
|
|
|
107
114
|
const variantSelector = {
|
|
115
|
+
name: "selector",
|
|
108
116
|
match(matcher) {
|
|
109
117
|
const match = matcher.match(/^selector-\[(.+?)\][:-]/);
|
|
110
118
|
if (match) {
|
|
@@ -116,6 +124,7 @@ const variantSelector = {
|
|
|
116
124
|
}
|
|
117
125
|
};
|
|
118
126
|
const variantLayer = {
|
|
127
|
+
name: "layer",
|
|
119
128
|
match(matcher) {
|
|
120
129
|
const match = matcher.match(/^layer-([_\d\w]+)[:-]/);
|
|
121
130
|
if (match) {
|
|
@@ -127,6 +136,7 @@ const variantLayer = {
|
|
|
127
136
|
}
|
|
128
137
|
};
|
|
129
138
|
const variantScope = {
|
|
139
|
+
name: "scope",
|
|
130
140
|
match(matcher) {
|
|
131
141
|
const match = matcher.match(/^scope-([_\d\w]+)[:-]/);
|
|
132
142
|
if (match) {
|
|
@@ -138,6 +148,7 @@ const variantScope = {
|
|
|
138
148
|
}
|
|
139
149
|
};
|
|
140
150
|
const variantImportant = {
|
|
151
|
+
name: "important",
|
|
141
152
|
match(matcher) {
|
|
142
153
|
const match = matcher.match(/^(important[:-]|!)/);
|
|
143
154
|
if (match) {
|
|
@@ -157,16 +168,19 @@ const variantImportant = {
|
|
|
157
168
|
};
|
|
158
169
|
const numberRE = /[0-9.]+(?:[a-z]+|%)?/;
|
|
159
170
|
const variantNegative = {
|
|
171
|
+
name: "negative",
|
|
160
172
|
match(matcher) {
|
|
161
173
|
if (!matcher.startsWith("-") || !matcher.match(/\d|-px|-full/))
|
|
162
174
|
return;
|
|
163
175
|
return {
|
|
164
176
|
matcher: matcher.slice(1),
|
|
165
177
|
body: (body) => {
|
|
178
|
+
if (body.find((v) => v[0] === utilities.CONTROL_MINI_NO_NEGATIVE))
|
|
179
|
+
return;
|
|
166
180
|
let changed = false;
|
|
167
181
|
body.forEach((v) => {
|
|
168
182
|
const value = v[1]?.toString();
|
|
169
|
-
if (!value ||
|
|
183
|
+
if (!value || value === "0")
|
|
170
184
|
return;
|
|
171
185
|
if (numberRE.test(value)) {
|
|
172
186
|
v[1] = value.replace(numberRE, (i) => `-${i}`);
|
|
@@ -242,23 +256,27 @@ const sortValue = (pseudo) => {
|
|
|
242
256
|
const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
243
257
|
const re = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))[:-]`);
|
|
244
258
|
const rawRe = new RegExp(`^${core.escapeRegExp(parent)}:`);
|
|
245
|
-
return
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
if (match
|
|
250
|
-
pseudo = `:${match[
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
259
|
+
return {
|
|
260
|
+
name: `pseudo:${tag}`,
|
|
261
|
+
match(input) {
|
|
262
|
+
const match = input.match(re);
|
|
263
|
+
if (match) {
|
|
264
|
+
let pseudo = PseudoClasses[match[3]] || `:${match[3]}`;
|
|
265
|
+
if (match[2])
|
|
266
|
+
pseudo = `:${match[2]}(${pseudo})`;
|
|
267
|
+
return {
|
|
268
|
+
matcher: input.slice(match[0].length),
|
|
269
|
+
selector: (s) => rawRe.test(s) ? s.replace(rawRe, `${parent}${pseudo}:`) : `${parent}${pseudo}${combinator}${s}`,
|
|
270
|
+
sort: sortValue(match[3])
|
|
271
|
+
};
|
|
272
|
+
}
|
|
256
273
|
}
|
|
257
274
|
};
|
|
258
275
|
};
|
|
259
276
|
const PseudoClassesAndElementsStr = Object.entries(PseudoClasses).map(([key]) => key).join("|");
|
|
260
277
|
const PseudoClassesAndElementsRE = new RegExp(`^(${PseudoClassesAndElementsStr})[:-]`);
|
|
261
278
|
const variantPseudoClassesAndElements = {
|
|
279
|
+
name: "pseudo",
|
|
262
280
|
match: (input) => {
|
|
263
281
|
const match = input.match(PseudoClassesAndElementsRE);
|
|
264
282
|
if (match) {
|
|
@@ -293,19 +311,19 @@ const variantTaggedPseudoClasses = (options = {}) => {
|
|
|
293
311
|
const attributify = !!options?.attributifyPseudo;
|
|
294
312
|
return [
|
|
295
313
|
{
|
|
296
|
-
|
|
314
|
+
...taggedPseudoClassMatcher("group", attributify ? '[group=""]' : ".group", " "),
|
|
297
315
|
multiPass: true
|
|
298
316
|
},
|
|
299
317
|
{
|
|
300
|
-
|
|
318
|
+
...taggedPseudoClassMatcher("peer", attributify ? '[peer=""]' : ".peer", "~"),
|
|
301
319
|
multiPass: true
|
|
302
320
|
},
|
|
303
321
|
{
|
|
304
|
-
|
|
322
|
+
...taggedPseudoClassMatcher("parent", attributify ? '[parent=""]' : ".parent", ">"),
|
|
305
323
|
multiPass: true
|
|
306
324
|
},
|
|
307
325
|
{
|
|
308
|
-
|
|
326
|
+
...taggedPseudoClassMatcher("previous", attributify ? '[previous=""]' : ".previous", "+"),
|
|
309
327
|
multiPass: true
|
|
310
328
|
}
|
|
311
329
|
];
|
package/dist/chunks/default3.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as resolveBreakpoints } from './utilities.mjs';
|
|
1
|
+
import { g as resolveBreakpoints, C as CONTROL_MINI_NO_NEGATIVE } from './utilities.mjs';
|
|
2
2
|
import { v as variantParentMatcher, a as variantMatcher } from './variants.mjs';
|
|
3
3
|
import { escapeRegExp } from '@unocss/core';
|
|
4
4
|
|
|
@@ -10,6 +10,7 @@ const calcMaxWidthBySize = (size) => {
|
|
|
10
10
|
return Number.isNaN(maxWidth) ? size : `${maxWidth}${unit}`;
|
|
11
11
|
};
|
|
12
12
|
const variantBreakpoints = {
|
|
13
|
+
name: "breakpoints",
|
|
13
14
|
match(matcher, context) {
|
|
14
15
|
const variantEntries = Object.entries(resolveBreakpoints(context) ?? {}).map(([point, size], idx) => [point, size, idx]);
|
|
15
16
|
for (const [point, size, idx] of variantEntries) {
|
|
@@ -50,13 +51,16 @@ const variantBreakpoints = {
|
|
|
50
51
|
|
|
51
52
|
const scopeMatcher = (strict, name, template) => {
|
|
52
53
|
const re = strict ? new RegExp(`^${name}(?:-\\[(.+?)\\])[:-]`) : new RegExp(`^${name}(?:-\\[(.+?)\\])?[:-]`);
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
return {
|
|
55
|
+
name: `combinator:${name}`,
|
|
56
|
+
match: (matcher) => {
|
|
57
|
+
const match = matcher.match(re);
|
|
58
|
+
if (match) {
|
|
59
|
+
return {
|
|
60
|
+
matcher: matcher.slice(match[0].length),
|
|
61
|
+
selector: (s) => template.replace("&&-s", s).replace("&&-c", match[1] ?? "*")
|
|
62
|
+
};
|
|
63
|
+
}
|
|
60
64
|
}
|
|
61
65
|
};
|
|
62
66
|
};
|
|
@@ -73,14 +77,17 @@ const variantCombinators = [
|
|
|
73
77
|
];
|
|
74
78
|
|
|
75
79
|
const variantPrint = variantParentMatcher("print", "@media print");
|
|
76
|
-
const variantCustomMedia =
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
const variantCustomMedia = {
|
|
81
|
+
name: "media",
|
|
82
|
+
match(matcher, { theme }) {
|
|
83
|
+
const match = matcher.match(/^media-([_\d\w]+)[:-]/);
|
|
84
|
+
if (match) {
|
|
85
|
+
const media = theme.media?.[match[1]] ?? `(--${match[1]})`;
|
|
86
|
+
return {
|
|
87
|
+
matcher: matcher.slice(match[0].length),
|
|
88
|
+
parent: `@media ${media}`
|
|
89
|
+
};
|
|
90
|
+
}
|
|
84
91
|
}
|
|
85
92
|
};
|
|
86
93
|
|
|
@@ -103,6 +110,7 @@ const variantLanguageDirections = [
|
|
|
103
110
|
];
|
|
104
111
|
|
|
105
112
|
const variantSelector = {
|
|
113
|
+
name: "selector",
|
|
106
114
|
match(matcher) {
|
|
107
115
|
const match = matcher.match(/^selector-\[(.+?)\][:-]/);
|
|
108
116
|
if (match) {
|
|
@@ -114,6 +122,7 @@ const variantSelector = {
|
|
|
114
122
|
}
|
|
115
123
|
};
|
|
116
124
|
const variantLayer = {
|
|
125
|
+
name: "layer",
|
|
117
126
|
match(matcher) {
|
|
118
127
|
const match = matcher.match(/^layer-([_\d\w]+)[:-]/);
|
|
119
128
|
if (match) {
|
|
@@ -125,6 +134,7 @@ const variantLayer = {
|
|
|
125
134
|
}
|
|
126
135
|
};
|
|
127
136
|
const variantScope = {
|
|
137
|
+
name: "scope",
|
|
128
138
|
match(matcher) {
|
|
129
139
|
const match = matcher.match(/^scope-([_\d\w]+)[:-]/);
|
|
130
140
|
if (match) {
|
|
@@ -136,6 +146,7 @@ const variantScope = {
|
|
|
136
146
|
}
|
|
137
147
|
};
|
|
138
148
|
const variantImportant = {
|
|
149
|
+
name: "important",
|
|
139
150
|
match(matcher) {
|
|
140
151
|
const match = matcher.match(/^(important[:-]|!)/);
|
|
141
152
|
if (match) {
|
|
@@ -155,16 +166,19 @@ const variantImportant = {
|
|
|
155
166
|
};
|
|
156
167
|
const numberRE = /[0-9.]+(?:[a-z]+|%)?/;
|
|
157
168
|
const variantNegative = {
|
|
169
|
+
name: "negative",
|
|
158
170
|
match(matcher) {
|
|
159
171
|
if (!matcher.startsWith("-") || !matcher.match(/\d|-px|-full/))
|
|
160
172
|
return;
|
|
161
173
|
return {
|
|
162
174
|
matcher: matcher.slice(1),
|
|
163
175
|
body: (body) => {
|
|
176
|
+
if (body.find((v) => v[0] === CONTROL_MINI_NO_NEGATIVE))
|
|
177
|
+
return;
|
|
164
178
|
let changed = false;
|
|
165
179
|
body.forEach((v) => {
|
|
166
180
|
const value = v[1]?.toString();
|
|
167
|
-
if (!value ||
|
|
181
|
+
if (!value || value === "0")
|
|
168
182
|
return;
|
|
169
183
|
if (numberRE.test(value)) {
|
|
170
184
|
v[1] = value.replace(numberRE, (i) => `-${i}`);
|
|
@@ -240,23 +254,27 @@ const sortValue = (pseudo) => {
|
|
|
240
254
|
const taggedPseudoClassMatcher = (tag, parent, combinator) => {
|
|
241
255
|
const re = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))[:-]`);
|
|
242
256
|
const rawRe = new RegExp(`^${escapeRegExp(parent)}:`);
|
|
243
|
-
return
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
if (match
|
|
248
|
-
pseudo = `:${match[
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
257
|
+
return {
|
|
258
|
+
name: `pseudo:${tag}`,
|
|
259
|
+
match(input) {
|
|
260
|
+
const match = input.match(re);
|
|
261
|
+
if (match) {
|
|
262
|
+
let pseudo = PseudoClasses[match[3]] || `:${match[3]}`;
|
|
263
|
+
if (match[2])
|
|
264
|
+
pseudo = `:${match[2]}(${pseudo})`;
|
|
265
|
+
return {
|
|
266
|
+
matcher: input.slice(match[0].length),
|
|
267
|
+
selector: (s) => rawRe.test(s) ? s.replace(rawRe, `${parent}${pseudo}:`) : `${parent}${pseudo}${combinator}${s}`,
|
|
268
|
+
sort: sortValue(match[3])
|
|
269
|
+
};
|
|
270
|
+
}
|
|
254
271
|
}
|
|
255
272
|
};
|
|
256
273
|
};
|
|
257
274
|
const PseudoClassesAndElementsStr = Object.entries(PseudoClasses).map(([key]) => key).join("|");
|
|
258
275
|
const PseudoClassesAndElementsRE = new RegExp(`^(${PseudoClassesAndElementsStr})[:-]`);
|
|
259
276
|
const variantPseudoClassesAndElements = {
|
|
277
|
+
name: "pseudo",
|
|
260
278
|
match: (input) => {
|
|
261
279
|
const match = input.match(PseudoClassesAndElementsRE);
|
|
262
280
|
if (match) {
|
|
@@ -291,19 +309,19 @@ const variantTaggedPseudoClasses = (options = {}) => {
|
|
|
291
309
|
const attributify = !!options?.attributifyPseudo;
|
|
292
310
|
return [
|
|
293
311
|
{
|
|
294
|
-
|
|
312
|
+
...taggedPseudoClassMatcher("group", attributify ? '[group=""]' : ".group", " "),
|
|
295
313
|
multiPass: true
|
|
296
314
|
},
|
|
297
315
|
{
|
|
298
|
-
|
|
316
|
+
...taggedPseudoClassMatcher("peer", attributify ? '[peer=""]' : ".peer", "~"),
|
|
299
317
|
multiPass: true
|
|
300
318
|
},
|
|
301
319
|
{
|
|
302
|
-
|
|
320
|
+
...taggedPseudoClassMatcher("parent", attributify ? '[parent=""]' : ".parent", ">"),
|
|
303
321
|
multiPass: true
|
|
304
322
|
},
|
|
305
323
|
{
|
|
306
|
-
|
|
324
|
+
...taggedPseudoClassMatcher("previous", attributify ? '[previous=""]' : ".previous", "+"),
|
|
307
325
|
multiPass: true
|
|
308
326
|
}
|
|
309
327
|
];
|
|
@@ -501,6 +501,7 @@ const valueHandlers = {
|
|
|
501
501
|
const handler = core.createValueHandler(valueHandlers);
|
|
502
502
|
const h = handler;
|
|
503
503
|
|
|
504
|
+
const CONTROL_MINI_NO_NEGATIVE = "$$mini-no-negative";
|
|
504
505
|
const directionSize = (propertyPrefix) => ([_, direction, size], { theme }) => {
|
|
505
506
|
const v = theme.spacing?.[size || "DEFAULT"] ?? handler.bracket.cssvar.auto.fraction.rem(size);
|
|
506
507
|
if (v != null)
|
|
@@ -614,6 +615,7 @@ const resolveVerticalBreakpoints = ({ theme, generator }) => {
|
|
|
614
615
|
return verticalBreakpoints;
|
|
615
616
|
};
|
|
616
617
|
|
|
618
|
+
exports.CONTROL_MINI_NO_NEGATIVE = CONTROL_MINI_NO_NEGATIVE;
|
|
617
619
|
exports.colorResolver = colorResolver;
|
|
618
620
|
exports.colorToString = colorToString;
|
|
619
621
|
exports.colorableShadows = colorableShadows;
|
|
@@ -499,6 +499,7 @@ const valueHandlers = {
|
|
|
499
499
|
const handler = createValueHandler(valueHandlers);
|
|
500
500
|
const h = handler;
|
|
501
501
|
|
|
502
|
+
const CONTROL_MINI_NO_NEGATIVE = "$$mini-no-negative";
|
|
502
503
|
const directionSize = (propertyPrefix) => ([_, direction, size], { theme }) => {
|
|
503
504
|
const v = theme.spacing?.[size || "DEFAULT"] ?? handler.bracket.cssvar.auto.fraction.rem(size);
|
|
504
505
|
if (v != null)
|
|
@@ -612,4 +613,4 @@ const resolveVerticalBreakpoints = ({ theme, generator }) => {
|
|
|
612
613
|
return verticalBreakpoints;
|
|
613
614
|
};
|
|
614
615
|
|
|
615
|
-
export { hasParseableColor as a, colorToString as b, colorResolver as c, directionMap as d, cornerMap as e, colorableShadows as f, resolveBreakpoints as g, handler as h, insetMap as i, directionSize as j, positionMap as k, hex2rgba as l, parseCssColor as m, getComponents as n, h as o, parseColor as p, resolveVerticalBreakpoints as r, valueHandlers as v, xyzMap as x };
|
|
616
|
+
export { CONTROL_MINI_NO_NEGATIVE as C, hasParseableColor as a, colorToString as b, colorResolver as c, directionMap as d, cornerMap as e, colorableShadows as f, resolveBreakpoints as g, handler as h, insetMap as i, directionSize as j, positionMap as k, hex2rgba as l, parseCssColor as m, getComponents as n, h as o, parseColor as p, resolveVerticalBreakpoints as r, valueHandlers as v, xyzMap as x };
|
package/dist/chunks/variants.cjs
CHANGED
|
@@ -5,6 +5,7 @@ const core = require('@unocss/core');
|
|
|
5
5
|
const variantMatcher = (name, selector) => {
|
|
6
6
|
const re = new RegExp(`^${core.escapeRegExp(name)}[:-]`);
|
|
7
7
|
return {
|
|
8
|
+
name,
|
|
8
9
|
match: (input) => {
|
|
9
10
|
const match = input.match(re);
|
|
10
11
|
if (match) {
|
|
@@ -20,6 +21,7 @@ const variantMatcher = (name, selector) => {
|
|
|
20
21
|
const variantParentMatcher = (name, parent) => {
|
|
21
22
|
const re = new RegExp(`^${core.escapeRegExp(name)}[:-]`);
|
|
22
23
|
return {
|
|
24
|
+
name,
|
|
23
25
|
match: (input) => {
|
|
24
26
|
const match = input.match(re);
|
|
25
27
|
if (match) {
|
package/dist/chunks/variants.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { escapeRegExp } from '@unocss/core';
|
|
|
3
3
|
const variantMatcher = (name, selector) => {
|
|
4
4
|
const re = new RegExp(`^${escapeRegExp(name)}[:-]`);
|
|
5
5
|
return {
|
|
6
|
+
name,
|
|
6
7
|
match: (input) => {
|
|
7
8
|
const match = input.match(re);
|
|
8
9
|
if (match) {
|
|
@@ -18,6 +19,7 @@ const variantMatcher = (name, selector) => {
|
|
|
18
19
|
const variantParentMatcher = (name, parent) => {
|
|
19
20
|
const re = new RegExp(`^${escapeRegExp(name)}[:-]`);
|
|
20
21
|
return {
|
|
22
|
+
name,
|
|
21
23
|
match: (input) => {
|
|
22
24
|
const match = input.match(re);
|
|
23
25
|
if (match) {
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { T as Theme } from './types-f7b2c653.js';
|
|
|
3
3
|
export { T as Theme, a as ThemeAnimation } from './types-f7b2c653.js';
|
|
4
4
|
export { t as theme } from './default-e6d1b2e8.js';
|
|
5
5
|
export { c as colors } from './colors-ce2fecb8.js';
|
|
6
|
-
export { p as parseColor } from './utilities-
|
|
6
|
+
export { p as parseColor } from './utilities-e7a7f845.js';
|
|
7
7
|
|
|
8
8
|
interface PresetMiniOptions extends PresetOptions {
|
|
9
9
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RuleContext, CSSEntries, ParsedColorValue, CSSObject, VariantContext } from '@unocss/core';
|
|
2
2
|
import { T as Theme } from './types-f7b2c653.js';
|
|
3
3
|
|
|
4
|
+
declare const CONTROL_MINI_NO_NEGATIVE = "$$mini-no-negative";
|
|
4
5
|
/**
|
|
5
6
|
* Provide {@link DynamicMatcher} function returning spacing definition. See spacing rules.
|
|
6
7
|
*
|
|
@@ -55,4 +56,4 @@ declare const hasParseableColor: (color: string | undefined, theme: Theme) => bo
|
|
|
55
56
|
declare const resolveBreakpoints: ({ theme, generator }: Readonly<VariantContext<Theme>>) => Record<string, string> | undefined;
|
|
56
57
|
declare const resolveVerticalBreakpoints: ({ theme, generator }: Readonly<VariantContext<Theme>>) => Record<string, string> | undefined;
|
|
57
58
|
|
|
58
|
-
export { colorableShadows as a, resolveVerticalBreakpoints as b, colorResolver as c, directionSize as d, hasParseableColor as h, parseColor as p, resolveBreakpoints as r };
|
|
59
|
+
export { CONTROL_MINI_NO_NEGATIVE as C, colorableShadows as a, resolveVerticalBreakpoints as b, colorResolver as c, directionSize as d, hasParseableColor as h, parseColor as p, resolveBreakpoints as r };
|
package/dist/utils.cjs
CHANGED
|
@@ -8,6 +8,7 @@ require('@unocss/core');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
exports.CONTROL_MINI_NO_NEGATIVE = utilities.CONTROL_MINI_NO_NEGATIVE;
|
|
11
12
|
exports.colorResolver = utilities.colorResolver;
|
|
12
13
|
exports.colorToString = utilities.colorToString;
|
|
13
14
|
exports.colorableShadows = utilities.colorableShadows;
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _unocss_core from '@unocss/core';
|
|
2
2
|
import { RGBAColorValue, CSSColorValue, VariantObject } from '@unocss/core';
|
|
3
|
-
export { c as colorResolver, a as colorableShadows, d as directionSize, h as hasParseableColor, p as parseColor, r as resolveBreakpoints, b as resolveVerticalBreakpoints } from './utilities-
|
|
3
|
+
export { C as CONTROL_MINI_NO_NEGATIVE, c as colorResolver, a as colorableShadows, d as directionSize, h as hasParseableColor, p as parseColor, r as resolveBreakpoints, b as resolveVerticalBreakpoints } from './utilities-e7a7f845.js';
|
|
4
4
|
import './types-f7b2c653.js';
|
|
5
5
|
|
|
6
6
|
declare function hex2rgba(hex?: string): RGBAColorValue | undefined;
|
package/dist/utils.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { c as colorResolver, b as colorToString, f as colorableShadows, e as cornerMap, d as directionMap, j as directionSize, n as getComponents, o as h, h as handler, a as hasParseableColor, l as hex2rgba, i as insetMap, p as parseColor, m as parseCssColor, k as positionMap, g as resolveBreakpoints, r as resolveVerticalBreakpoints, v as valueHandlers, x as xyzMap } from './chunks/utilities.mjs';
|
|
1
|
+
export { C as CONTROL_MINI_NO_NEGATIVE, c as colorResolver, b as colorToString, f as colorableShadows, e as cornerMap, d as directionMap, j as directionSize, n as getComponents, o as h, h as handler, a as hasParseableColor, l as hex2rgba, i as insetMap, p as parseColor, m as parseCssColor, k as positionMap, g as resolveBreakpoints, r as resolveVerticalBreakpoints, v as valueHandlers, x as xyzMap } from './chunks/utilities.mjs';
|
|
2
2
|
export { a as variantMatcher, v as variantParentMatcher } from './chunks/variants.mjs';
|
|
3
3
|
import '@unocss/core';
|
package/dist/variants.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Variant,
|
|
1
|
+
import { Variant, VariantObject } from '@unocss/core';
|
|
2
2
|
import { T as Theme } from './types-f7b2c653.js';
|
|
3
3
|
import { PresetMiniOptions } from './index.js';
|
|
4
4
|
import './default-e6d1b2e8.js';
|
|
5
5
|
import './colors-ce2fecb8.js';
|
|
6
|
-
import './utilities-
|
|
6
|
+
import './utilities-e7a7f845.js';
|
|
7
7
|
|
|
8
8
|
declare const variantBreakpoints: Variant<Theme>;
|
|
9
9
|
|
|
10
10
|
declare const variantCombinators: Variant[];
|
|
11
11
|
|
|
12
12
|
declare const variantPrint: Variant;
|
|
13
|
-
declare const variantCustomMedia:
|
|
13
|
+
declare const variantCustomMedia: VariantObject;
|
|
14
14
|
|
|
15
15
|
declare const variantColorsMediaOrClass: (options?: PresetMiniOptions) => Variant[];
|
|
16
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-mini",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.9",
|
|
4
4
|
"description": "The minimal preset for UnoCSS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unocss",
|
|
@@ -61,11 +61,10 @@
|
|
|
61
61
|
],
|
|
62
62
|
"sideEffects": false,
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@unocss/core": "0.32.
|
|
64
|
+
"@unocss/core": "0.32.9"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "unbuild",
|
|
68
68
|
"stub": "unbuild --stub"
|
|
69
|
-
}
|
|
70
|
-
"readme": "# @unocss/preset-mini\n\nThe minimal preset for [UnoCSS](https://github.com/unocss/unocss).\n\n## Installation\n\n```bash\nnpm i -D @unocss/preset-mini\n```\n\n```ts\nimport presetMini from '@unocss/preset-mini'\n\nUnocss({\n presets: [\n presetMini(),\n ],\n})\n```\n\n## License\n\nMIT License © 2021-PRESENT [Anthony Fu](https://github.com/antfu)\n"
|
|
69
|
+
}
|
|
71
70
|
}
|