@unocss/preset-mini 0.48.5 → 0.49.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/index.cjs +18 -15
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +19 -16
- package/dist/rules.cjs +3 -3
- package/dist/rules.mjs +3 -3
- package/dist/shared/{preset-mini.43dfafb9.cjs → preset-mini.3a9c563b.cjs} +2 -2
- package/dist/shared/{preset-mini.8953ff1a.cjs → preset-mini.5d6b20c4.cjs} +5 -4
- package/dist/shared/{preset-mini.e54ce13d.cjs → preset-mini.65179802.cjs} +14 -2
- package/dist/shared/{preset-mini.89cb41ec.cjs → preset-mini.6f1356df.cjs} +172 -146
- package/dist/shared/{preset-mini.0a36abfc.mjs → preset-mini.708f19ca.mjs} +2 -2
- package/dist/shared/{preset-mini.435805c5.cjs → preset-mini.70cd3126.cjs} +3 -3
- package/dist/shared/{preset-mini.28b1d01c.cjs → preset-mini.77e00c7b.cjs} +9 -5
- package/dist/shared/{preset-mini.bd4c0c0c.mjs → preset-mini.816a9399.mjs} +9 -5
- package/dist/shared/{preset-mini.a6daaf18.mjs → preset-mini.8c7d231d.mjs} +5 -4
- package/dist/shared/{preset-mini.0d510914.mjs → preset-mini.aabbbe8d.mjs} +172 -146
- package/dist/shared/{preset-mini.6b96b995.mjs → preset-mini.c2430d65.mjs} +3 -3
- package/dist/shared/{preset-mini.ca595ab5.mjs → preset-mini.d9489281.mjs} +14 -2
- package/dist/theme.cjs +3 -3
- package/dist/theme.mjs +3 -3
- package/dist/utils.cjs +2 -2
- package/dist/utils.mjs +2 -2
- package/dist/variants.cjs +3 -3
- package/dist/variants.d.ts +6 -6
- package/dist/variants.mjs +3 -3
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const core = require('@unocss/core');
|
|
6
|
-
require('./shared/preset-mini.
|
|
7
|
-
const colors$1 = require('./shared/preset-mini.
|
|
8
|
-
const _default$1 = require('./shared/preset-mini.
|
|
6
|
+
require('./shared/preset-mini.5d6b20c4.cjs');
|
|
7
|
+
const colors$1 = require('./shared/preset-mini.65179802.cjs');
|
|
8
|
+
const _default$1 = require('./shared/preset-mini.70cd3126.cjs');
|
|
9
9
|
const colors = require('./shared/preset-mini.30606736.cjs');
|
|
10
|
-
const _default = require('./shared/preset-mini.
|
|
11
|
-
const _default$2 = require('./shared/preset-mini.
|
|
12
|
-
require('./shared/preset-mini.
|
|
10
|
+
const _default = require('./shared/preset-mini.3a9c563b.cjs');
|
|
11
|
+
const _default$2 = require('./shared/preset-mini.6f1356df.cjs');
|
|
12
|
+
require('./shared/preset-mini.77e00c7b.cjs');
|
|
13
13
|
|
|
14
14
|
const preflights = [
|
|
15
15
|
{
|
|
@@ -28,28 +28,31 @@ const presetMini = (options = {}) => {
|
|
|
28
28
|
options.dark = options.dark ?? "class";
|
|
29
29
|
options.attributifyPseudo = options.attributifyPseudo ?? false;
|
|
30
30
|
options.preflight = options.preflight ?? true;
|
|
31
|
+
options.variablePrefix = options.variablePrefix ?? "un-";
|
|
31
32
|
return {
|
|
32
33
|
name: "@unocss/preset-mini",
|
|
33
34
|
theme: _default.theme,
|
|
34
35
|
rules: _default$1.rules,
|
|
35
36
|
variants: _default$2.variants(options),
|
|
36
37
|
options,
|
|
37
|
-
postprocess:
|
|
38
|
+
postprocess: VarPrefixPostprocessor(options.variablePrefix),
|
|
38
39
|
preflights: options.preflight ? normalizePreflights(preflights, options.variablePrefix) : [],
|
|
39
40
|
prefix: options.prefix
|
|
40
41
|
};
|
|
41
42
|
};
|
|
42
43
|
function VarPrefixPostprocessor(prefix) {
|
|
43
|
-
|
|
44
|
-
obj
|
|
45
|
-
i
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
if (prefix !== "un-") {
|
|
45
|
+
return (obj) => {
|
|
46
|
+
obj.entries.forEach((i) => {
|
|
47
|
+
i[0] = i[0].replace(/^--un-/, `--${prefix}`);
|
|
48
|
+
if (typeof i[1] === "string")
|
|
49
|
+
i[1] = i[1].replace(/var\(--un-/g, `var(--${prefix}`);
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
}
|
|
50
53
|
}
|
|
51
54
|
function normalizePreflights(preflights3, variablePrefix) {
|
|
52
|
-
if (variablePrefix
|
|
55
|
+
if (variablePrefix !== "un-") {
|
|
53
56
|
return preflights3.map((p) => ({
|
|
54
57
|
...p,
|
|
55
58
|
getCSS: (() => async (ctx) => {
|
package/dist/index.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ interface PresetMiniOptions extends PresetOptions {
|
|
|
55
55
|
}
|
|
56
56
|
declare const presetMini: (options?: PresetMiniOptions) => Preset<Theme>;
|
|
57
57
|
|
|
58
|
-
declare function VarPrefixPostprocessor(prefix: string): Postprocessor;
|
|
59
|
-
declare function normalizePreflights(preflights: Preflight[], variablePrefix
|
|
58
|
+
declare function VarPrefixPostprocessor(prefix: string): Postprocessor | undefined;
|
|
59
|
+
declare function normalizePreflights(preflights: Preflight[], variablePrefix: string): Preflight<{}>[];
|
|
60
60
|
|
|
61
61
|
export { DarkModeSelectors, PresetMiniOptions, VarPrefixPostprocessor, presetMini as default, normalizePreflights, preflights, presetMini };
|
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { entriesToCss, toArray } from '@unocss/core';
|
|
2
|
-
import './shared/preset-mini.
|
|
3
|
-
export { p as parseColor } from './shared/preset-mini.
|
|
4
|
-
import { r as rules } from './shared/preset-mini.
|
|
2
|
+
import './shared/preset-mini.8c7d231d.mjs';
|
|
3
|
+
export { p as parseColor } from './shared/preset-mini.d9489281.mjs';
|
|
4
|
+
import { r as rules } from './shared/preset-mini.c2430d65.mjs';
|
|
5
5
|
export { c as colors } from './shared/preset-mini.65ac75be.mjs';
|
|
6
|
-
import { t as theme } from './shared/preset-mini.
|
|
7
|
-
export { t as theme } from './shared/preset-mini.
|
|
8
|
-
import { v as variants } from './shared/preset-mini.
|
|
9
|
-
import './shared/preset-mini.
|
|
6
|
+
import { t as theme } from './shared/preset-mini.708f19ca.mjs';
|
|
7
|
+
export { t as theme } from './shared/preset-mini.708f19ca.mjs';
|
|
8
|
+
import { v as variants } from './shared/preset-mini.aabbbe8d.mjs';
|
|
9
|
+
import './shared/preset-mini.816a9399.mjs';
|
|
10
10
|
|
|
11
11
|
const preflights = [
|
|
12
12
|
{
|
|
@@ -25,28 +25,31 @@ const presetMini = (options = {}) => {
|
|
|
25
25
|
options.dark = options.dark ?? "class";
|
|
26
26
|
options.attributifyPseudo = options.attributifyPseudo ?? false;
|
|
27
27
|
options.preflight = options.preflight ?? true;
|
|
28
|
+
options.variablePrefix = options.variablePrefix ?? "un-";
|
|
28
29
|
return {
|
|
29
30
|
name: "@unocss/preset-mini",
|
|
30
31
|
theme,
|
|
31
32
|
rules,
|
|
32
33
|
variants: variants(options),
|
|
33
34
|
options,
|
|
34
|
-
postprocess:
|
|
35
|
+
postprocess: VarPrefixPostprocessor(options.variablePrefix),
|
|
35
36
|
preflights: options.preflight ? normalizePreflights(preflights, options.variablePrefix) : [],
|
|
36
37
|
prefix: options.prefix
|
|
37
38
|
};
|
|
38
39
|
};
|
|
39
40
|
function VarPrefixPostprocessor(prefix) {
|
|
40
|
-
|
|
41
|
-
obj
|
|
42
|
-
i
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
if (prefix !== "un-") {
|
|
42
|
+
return (obj) => {
|
|
43
|
+
obj.entries.forEach((i) => {
|
|
44
|
+
i[0] = i[0].replace(/^--un-/, `--${prefix}`);
|
|
45
|
+
if (typeof i[1] === "string")
|
|
46
|
+
i[1] = i[1].replace(/var\(--un-/g, `var(--${prefix}`);
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
}
|
|
47
50
|
}
|
|
48
51
|
function normalizePreflights(preflights3, variablePrefix) {
|
|
49
|
-
if (variablePrefix
|
|
52
|
+
if (variablePrefix !== "un-") {
|
|
50
53
|
return preflights3.map((p) => ({
|
|
51
54
|
...p,
|
|
52
55
|
getCSS: (() => async (ctx) => {
|
package/dist/rules.cjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const decoration = require('./shared/preset-mini.
|
|
6
|
-
const _default = require('./shared/preset-mini.
|
|
7
|
-
require('./shared/preset-mini.
|
|
5
|
+
const decoration = require('./shared/preset-mini.5d6b20c4.cjs');
|
|
6
|
+
const _default = require('./shared/preset-mini.70cd3126.cjs');
|
|
7
|
+
require('./shared/preset-mini.65179802.cjs');
|
|
8
8
|
require('@unocss/core');
|
|
9
9
|
|
|
10
10
|
|
package/dist/rules.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { F as alignments, C as appearance, s as appearances, S as borderStyles, b as borders, o as boxShadows, Q as boxShadowsBase, K as boxSizing, z as breaks, O as contains, c as contentVisibility, a as contents, q as cursors, d as displays, I as floats, n as fontSmoothings, m as fontStyles, f as fonts, T as handlerBorderStyle, H as insets, E as justifies, D as orders, B as outline, A as overflows, G as placements, u as pointerEvents, p as positions, v as resizes, R as ringBase, r as rings, t as tabSizes, l as textAligns, h as textDecorations, e as textIndents, g as textOverflows, j as textShadows, i as textStrokes, k as textTransforms, P as transformBase, M as transforms, L as transitions, x as userSelects, U as varEmpty, w as verticalAligns, y as whitespaces, N as willChange, J as zIndexes } from './shared/preset-mini.
|
|
2
|
-
export { d as aspectRatio, b as bgColors, c as containerParent, i as cssProperty, h as cssVariables, f as flex, g as gaps, a as grids, m as margins, o as opacity, p as paddings, q as questionMark, r as rules, s as sizes, e as svgUtilities, t as textColors } from './shared/preset-mini.
|
|
3
|
-
import './shared/preset-mini.
|
|
1
|
+
export { F as alignments, C as appearance, s as appearances, S as borderStyles, b as borders, o as boxShadows, Q as boxShadowsBase, K as boxSizing, z as breaks, O as contains, c as contentVisibility, a as contents, q as cursors, d as displays, I as floats, n as fontSmoothings, m as fontStyles, f as fonts, T as handlerBorderStyle, H as insets, E as justifies, D as orders, B as outline, A as overflows, G as placements, u as pointerEvents, p as positions, v as resizes, R as ringBase, r as rings, t as tabSizes, l as textAligns, h as textDecorations, e as textIndents, g as textOverflows, j as textShadows, i as textStrokes, k as textTransforms, P as transformBase, M as transforms, L as transitions, x as userSelects, U as varEmpty, w as verticalAligns, y as whitespaces, N as willChange, J as zIndexes } from './shared/preset-mini.8c7d231d.mjs';
|
|
2
|
+
export { d as aspectRatio, b as bgColors, c as containerParent, i as cssProperty, h as cssVariables, f as flex, g as gaps, a as grids, m as margins, o as opacity, p as paddings, q as questionMark, r as rules, s as sizes, e as svgUtilities, t as textColors } from './shared/preset-mini.c2430d65.mjs';
|
|
3
|
+
import './shared/preset-mini.d9489281.mjs';
|
|
4
4
|
import '@unocss/core';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const colors = require('./preset-mini.30606736.cjs');
|
|
4
|
-
const decoration = require('./preset-mini.
|
|
5
|
-
require('./preset-mini.
|
|
4
|
+
const decoration = require('./preset-mini.5d6b20c4.cjs');
|
|
5
|
+
require('./preset-mini.65179802.cjs');
|
|
6
6
|
require('@unocss/core');
|
|
7
7
|
|
|
8
8
|
const fontFamily = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const colors = require('./preset-mini.
|
|
3
|
+
const colors = require('./preset-mini.65179802.cjs');
|
|
4
4
|
const core = require('@unocss/core');
|
|
5
5
|
|
|
6
6
|
const verticalAlignAlias = {
|
|
@@ -71,9 +71,9 @@ const borders = [
|
|
|
71
71
|
[/^(?:border|b)-(block|inline)-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
72
72
|
[/^(?:border|b)-([bi][se])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
|
|
73
73
|
[/^(?:border-|b-)?(?:rounded|rd)()(?:-(.+))?$/, handlerRounded, { autocomplete: ["(border|b)-(rounded|rd)", "(border|b)-(rounded|rd)-<num>", "(rounded|rd)", "(rounded|rd)-<num>"] }],
|
|
74
|
-
[/^(?:border-|b-)?(?:rounded|rd)-([
|
|
74
|
+
[/^(?:border-|b-)?(?:rounded|rd)-([rltbse])(?:-(.+))?$/, handlerRounded],
|
|
75
75
|
[/^(?:border-|b-)?(?:rounded|rd)-([rltb]{2})(?:-(.+))?$/, handlerRounded],
|
|
76
|
-
[/^(?:border-|b-)?(?:rounded|rd)-([
|
|
76
|
+
[/^(?:border-|b-)?(?:rounded|rd)-([bise][se])(?:-(.+))?$/, handlerRounded],
|
|
77
77
|
[/^(?:border-|b-)?(?:rounded|rd)-([bi][se]-[bi][se])(?:-(.+))?$/, handlerRounded],
|
|
78
78
|
[/^(?:border|b)-(?:style-)?()(.+)$/, handlerBorderStyle, { autocomplete: ["(border|b)-style", `(border|b)-(${borderStyles.join("|")})`, "(border|b)-<directions>-style", `(border|b)-<directions>-(${borderStyles.join("|")})`, `(border|b)-<directions>-style-(${borderStyles.join("|")})`, `(border|b)-style-(${borderStyles.join("|")})`] }],
|
|
79
79
|
[/^(?:border|b)-([xy])-(?:style-)?(.+)$/, handlerBorderStyle],
|
|
@@ -143,7 +143,7 @@ function handlerBorderStyle([, a = "", s]) {
|
|
|
143
143
|
|
|
144
144
|
const transitionPropertyGroup = {
|
|
145
145
|
all: "all",
|
|
146
|
-
colors: ["color", "background-color", "border-color", "text-decoration-color", "fill", "stroke"].join(","),
|
|
146
|
+
colors: ["color", "background-color", "border-color", "outline-color", "text-decoration-color", "fill", "stroke"].join(","),
|
|
147
147
|
none: "none",
|
|
148
148
|
opacity: "opacity",
|
|
149
149
|
shadow: "box-shadow",
|
|
@@ -407,6 +407,7 @@ const insets = [
|
|
|
407
407
|
]
|
|
408
408
|
}
|
|
409
409
|
],
|
|
410
|
+
[/^(?:position-|pos-)?(start|end)-(.+)$/, handleInsetValues],
|
|
410
411
|
[/^(?:position-|pos-)?inset-([xy])-(.+)$/, handleInsetValues],
|
|
411
412
|
[/^(?:position-|pos-)?inset-([rltbse])-(.+)$/, handleInsetValues],
|
|
412
413
|
[/^(?:position-|pos-)?inset-(block|inline)-(.+)$/, handleInsetValues],
|
|
@@ -22,7 +22,9 @@ const directionMap = {
|
|
|
22
22
|
const insetMap = {
|
|
23
23
|
...directionMap,
|
|
24
24
|
s: ["-inset-inline-start"],
|
|
25
|
+
start: ["-inset-inline-start"],
|
|
25
26
|
e: ["-inset-inline-end"],
|
|
27
|
+
end: ["-inset-inline-end"],
|
|
26
28
|
bs: ["-inset-block-start"],
|
|
27
29
|
be: ["-inset-block-end"],
|
|
28
30
|
is: ["-inset-inline-start"],
|
|
@@ -46,14 +48,20 @@ const cornerMap = {
|
|
|
46
48
|
"": [""],
|
|
47
49
|
"bs": ["-start-start", "-start-end"],
|
|
48
50
|
"be": ["-end-start", "-end-end"],
|
|
51
|
+
"s": ["-end-start", "-start-start"],
|
|
49
52
|
"is": ["-end-start", "-start-start"],
|
|
53
|
+
"e": ["-start-end", "-end-end"],
|
|
50
54
|
"ie": ["-start-end", "-end-end"],
|
|
55
|
+
"ss": ["-start-start"],
|
|
51
56
|
"bs-is": ["-start-start"],
|
|
52
57
|
"is-bs": ["-start-start"],
|
|
58
|
+
"se": ["-start-end"],
|
|
53
59
|
"bs-ie": ["-start-end"],
|
|
54
60
|
"ie-bs": ["-start-end"],
|
|
61
|
+
"es": ["-end-start"],
|
|
55
62
|
"be-is": ["-end-start"],
|
|
56
63
|
"is-be": ["-end-start"],
|
|
64
|
+
"ee": ["-end-end"],
|
|
57
65
|
"be-ie": ["-end-end"],
|
|
58
66
|
"ie-be": ["-end-end"]
|
|
59
67
|
};
|
|
@@ -250,8 +258,12 @@ function bracketWithType(str, requiredType) {
|
|
|
250
258
|
case "quoted":
|
|
251
259
|
return base.replace(/(^|[^\\])_/g, "$1 ").replace(/\\_/g, "_").replace(/(["\\])/g, "\\$1").replace(/^(.+)$/, '"$1"');
|
|
252
260
|
}
|
|
253
|
-
return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/(^|[^\\])_/g, "$1 ").replace(/\\_/g, "_").replace(/(?:calc|clamp|max|min)\((.*)/g, (
|
|
254
|
-
|
|
261
|
+
return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/(^|[^\\])_/g, "$1 ").replace(/\\_/g, "_").replace(/(?:calc|clamp|max|min)\((.*)/g, (match2) => {
|
|
262
|
+
const vars = [];
|
|
263
|
+
return match2.replace(/var\((--.+?)[,)]/g, (match3, g1) => {
|
|
264
|
+
vars.push(g1);
|
|
265
|
+
return match3.replace(g1, "--v");
|
|
266
|
+
}).replace(/(-?\d*\.?\d(?!\b-\d.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ").replace("--v", () => vars.shift());
|
|
255
267
|
});
|
|
256
268
|
}
|
|
257
269
|
}
|