@unocss/preset-mini 0.42.0 → 0.43.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/README.md +48 -0
- package/dist/chunks/{utilities.cjs → colors2.cjs} +233 -231
- package/dist/chunks/{utilities.mjs → colors2.mjs} +233 -232
- package/dist/chunks/default.cjs +3 -3
- package/dist/chunks/default.mjs +3 -3
- package/dist/chunks/default2.cjs +141 -143
- package/dist/chunks/default2.mjs +26 -28
- package/dist/chunks/default3.cjs +25 -21
- package/dist/chunks/default3.mjs +23 -19
- package/dist/chunks/transform.cjs +46 -39
- package/dist/chunks/transform.mjs +18 -11
- package/dist/index.cjs +4 -3
- package/dist/index.d.ts +7 -1
- package/dist/index.mjs +3 -2
- package/dist/rules.cjs +1 -1
- package/dist/rules.d.ts +1 -1
- package/dist/rules.mjs +1 -1
- package/dist/theme.cjs +1 -1
- package/dist/theme.mjs +1 -1
- package/dist/{utilities-654ad3bd.d.ts → utilities-b44b330d.d.ts} +3 -1
- package/dist/utils.cjs +25 -24
- package/dist/utils.d.ts +2 -3
- package/dist/utils.mjs +1 -1
- package/dist/variants.cjs +1 -1
- package/dist/variants.d.ts +1 -1
- package/dist/variants.mjs +1 -1
- package/package.json +2 -2
package/dist/chunks/default2.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as globalKeywords, h as handler, c as colorResolver, d as directionMap, a as hasParseableColor, p as parseColor, b as colorToString, e as colorOpacityToString, f as cornerMap, m as makeGlobalStaticRules, i as colorableShadows, j as insetMap, r as resolveVerticalBreakpoints, k as resolveBreakpoints, l as directionSize } from './
|
|
1
|
+
import { g as globalKeywords, h as handler, c as colorResolver, d as directionMap, a as hasParseableColor, p as parseColor, b as colorToString, e as colorOpacityToString, f as cornerMap, m as makeGlobalStaticRules, i as colorableShadows, j as insetMap, r as resolveVerticalBreakpoints, k as resolveBreakpoints, l as directionSize } from './colors2.mjs';
|
|
2
2
|
import { toArray } from '@unocss/core';
|
|
3
3
|
import { d as displays, c as contents, a as textOverflows, e as textTransforms, f as fontStyles, g as fontSmoothings, h as boxShadows, i as rings, j as cursors, k as appearances, p as pointerEvents, l as resizes, u as userSelects, w as whitespaces, m as breaks, n as transforms } from './transform.mjs';
|
|
4
4
|
|
|
@@ -372,15 +372,15 @@ const grids = [
|
|
|
372
372
|
return { [`grid-${rowCol(c)}`]: `span ${v}/span ${v}` };
|
|
373
373
|
}, { autocomplete: ["grid-(row|col)-span-<num>", "(row|col)-span-<num>"] }],
|
|
374
374
|
[/^(?:grid-)?(row|col)-start-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-start`]: handler.bracket.cssvar(v) ?? v })],
|
|
375
|
-
[/^(?:grid-)?(row|col)-end-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]: handler.bracket.cssvar(v) ?? v })],
|
|
376
|
-
[/^(?:grid-)?auto-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({ [`grid-auto-${rowCol(c)}`]: autoDirection(c, theme, v) })],
|
|
375
|
+
[/^(?:grid-)?(row|col)-end-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]: handler.bracket.cssvar(v) ?? v }), { autocomplete: ["grid-(row|col)-(start|end)-<num>"] }],
|
|
376
|
+
[/^(?:grid-)?auto-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({ [`grid-auto-${rowCol(c)}`]: autoDirection(c, theme, v) }), { autocomplete: ["grid-auto-(rows|cols)-<num>"] }],
|
|
377
377
|
[/^(?:grid-auto-flow|auto-flow|grid-flow)-(.+)$/, ([, v]) => ({ "grid-auto-flow": handler.bracket.cssvar(v) })],
|
|
378
|
-
[/^(?:grid-auto-flow|auto-flow|grid-flow)-(row|col|dense|row-dense|col-dense)$/, ([, v]) => ({ "grid-auto-flow": rowCol(v).replace("-", " ") })],
|
|
378
|
+
[/^(?:grid-auto-flow|auto-flow|grid-flow)-(row|col|dense|row-dense|col-dense)$/, ([, v]) => ({ "grid-auto-flow": rowCol(v).replace("-", " ") }), { autocomplete: ["(grid-auto-flow|auto-flow|grid-flow)-(row|col|dense|row-dense|col-dense)"] }],
|
|
379
379
|
[/^grid-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({
|
|
380
380
|
[`grid-template-${rowCol(c)}`]: theme[`gridTemplate${rowColTheme(c)}`]?.[v] ?? handler.bracket.cssvar(v)
|
|
381
381
|
})],
|
|
382
382
|
[/^grid-(rows|cols)-minmax-([\w.-]+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(auto-fill,minmax(${d},1fr))` })],
|
|
383
|
-
[/^grid-(rows|cols)-(\d+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(${d},minmax(0,1fr))` })],
|
|
383
|
+
[/^grid-(rows|cols)-(\d+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(${d},minmax(0,1fr))` }), { autocomplete: ["grid-(rows|cols)-<num>", "grid-(rows|cols)-none"] }],
|
|
384
384
|
["grid-rows-none", { "grid-template-rows": "none" }],
|
|
385
385
|
["grid-cols-none", { "grid-template-columns": "none" }]
|
|
386
386
|
];
|
|
@@ -543,28 +543,26 @@ function getSizeValue(minmax, hw, theme, prop) {
|
|
|
543
543
|
return handler.bracket.cssvar.global.auto.fraction.rem(prop);
|
|
544
544
|
}
|
|
545
545
|
const sizes = [
|
|
546
|
-
[
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
],
|
|
556
|
-
[
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
]
|
|
566
|
-
[/^(min-|max-)?(h)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]: resolveVerticalBreakpoints(context)?.[s] }), { autocomplete: ["h-screen-$verticalBreakpoints", "(min|max)-h-screen-$verticalBreakpoints"] }],
|
|
567
|
-
[/^(min-|max-)?(w)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]: resolveBreakpoints(context)?.[s] }), { autocomplete: ["w-screen-$breakpoints", "(min|max)-w-screen-$breakpoints"] }]
|
|
546
|
+
[/^(min-|max-)?([wh])-?(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
|
|
547
|
+
[/^(min-|max-)?(block|inline)-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) }), {
|
|
548
|
+
autocomplete: [
|
|
549
|
+
"(w|h)-$width|height|maxWidth|maxHeight|minWidth|minHeight|inlineSize|blockSize|maxInlineSize|maxBlockSize|minInlineSize|minBlockSize",
|
|
550
|
+
"(block|inline)-$width|height|maxWidth|maxHeight|minWidth|minHeight|inlineSize|blockSize|maxInlineSize|maxBlockSize|minInlineSize|minBlockSize",
|
|
551
|
+
"(max|min)-(w|h|block|inline)",
|
|
552
|
+
"(max|min)-(w|h|block|inline)-$width|height|maxWidth|maxHeight|minWidth|minHeight|inlineSize|blockSize|maxInlineSize|maxBlockSize|minInlineSize|minBlockSize"
|
|
553
|
+
]
|
|
554
|
+
}],
|
|
555
|
+
[/^(min-|max-)?(h)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]: resolveVerticalBreakpoints(context)?.[s] })],
|
|
556
|
+
[/^(min-|max-)?(w)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]: resolveBreakpoints(context)?.[s] }), {
|
|
557
|
+
autocomplete: [
|
|
558
|
+
"(w|h)-screen",
|
|
559
|
+
"(min|max)-(w|h)-screen",
|
|
560
|
+
"h-screen-$verticalBreakpoints",
|
|
561
|
+
"(min|max)-h-screen-$verticalBreakpoints",
|
|
562
|
+
"w-screen-$breakpoints",
|
|
563
|
+
"(min|max)-w-screen-$breakpoints"
|
|
564
|
+
]
|
|
565
|
+
}]
|
|
568
566
|
];
|
|
569
567
|
function getAspectRatio(prop) {
|
|
570
568
|
if (/^\d+\/\d+$/.test(prop))
|
|
@@ -578,7 +576,7 @@ function getAspectRatio(prop) {
|
|
|
578
576
|
return handler.bracket.cssvar.global.auto.number(prop);
|
|
579
577
|
}
|
|
580
578
|
const aspectRatio = [
|
|
581
|
-
[/^aspect-(?:ratio-)?(.+)$/, ([, d]) => ({ "aspect-ratio": getAspectRatio(d) }), { autocomplete: ["aspect-(square|video)", "aspect-ratio-(square|video)"] }]
|
|
579
|
+
[/^aspect-(?:ratio-)?(.+)$/, ([, d]) => ({ "aspect-ratio": getAspectRatio(d) }), { autocomplete: ["aspect-(square|video|ratio)", "aspect-ratio-(square|video)"] }]
|
|
582
580
|
];
|
|
583
581
|
|
|
584
582
|
const paddings = [
|
package/dist/chunks/default3.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const colors = require('./colors2.cjs');
|
|
4
4
|
const variants$1 = require('./variants.cjs');
|
|
5
5
|
const core = require('@unocss/core');
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ const calcMaxWidthBySize = (size) => {
|
|
|
14
14
|
const variantBreakpoints = {
|
|
15
15
|
name: "breakpoints",
|
|
16
16
|
match(matcher, context) {
|
|
17
|
-
const variantEntries = Object.entries(
|
|
17
|
+
const variantEntries = Object.entries(colors.resolveBreakpoints(context) ?? {}).map(([point, size], idx) => [point, size, idx]);
|
|
18
18
|
for (const [point, size, idx] of variantEntries) {
|
|
19
19
|
if (!regexCache[point])
|
|
20
20
|
regexCache[point] = new RegExp(`^((?:[al]t-)?${point}[:-])`);
|
|
@@ -183,24 +183,28 @@ const variantScope = {
|
|
|
183
183
|
const variantVariables = {
|
|
184
184
|
name: "variables",
|
|
185
185
|
match(matcher) {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
|
|
186
|
+
if (!matcher.startsWith("["))
|
|
187
|
+
return;
|
|
188
|
+
const [match, rest] = colors.getComponent(matcher, "[", "]", ":") ?? [];
|
|
189
|
+
if (!(match && rest && rest !== ""))
|
|
190
|
+
return;
|
|
191
|
+
const variant = colors.handler.bracket(match) ?? "";
|
|
192
|
+
if (!(variant.startsWith("@") || variant.includes("&")))
|
|
193
|
+
return;
|
|
194
|
+
return {
|
|
195
|
+
matcher: rest,
|
|
196
|
+
handle(input, next) {
|
|
197
|
+
const updates = variant.startsWith("@") ? {
|
|
198
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}${variant}`
|
|
199
|
+
} : {
|
|
200
|
+
selector: variant.replace(/&/g, input.selector)
|
|
201
|
+
};
|
|
202
|
+
return next({
|
|
203
|
+
...input,
|
|
204
|
+
...updates
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
};
|
|
204
208
|
},
|
|
205
209
|
multiPass: true
|
|
206
210
|
};
|
|
@@ -217,7 +221,7 @@ const variantNegative = {
|
|
|
217
221
|
return {
|
|
218
222
|
matcher: matcher.slice(1),
|
|
219
223
|
body: (body) => {
|
|
220
|
-
if (body.find((v) => v[0] ===
|
|
224
|
+
if (body.find((v) => v[0] === colors.CONTROL_MINI_NO_NEGATIVE))
|
|
221
225
|
return;
|
|
222
226
|
let changed = false;
|
|
223
227
|
body.forEach((v) => {
|
package/dist/chunks/default3.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as resolveBreakpoints, h as handler, C as CONTROL_MINI_NO_NEGATIVE } from './
|
|
1
|
+
import { k as resolveBreakpoints, n as getComponent, h as handler, C as CONTROL_MINI_NO_NEGATIVE } from './colors2.mjs';
|
|
2
2
|
import { v as variantParentMatcher, a as variantMatcher } from './variants.mjs';
|
|
3
3
|
import { escapeRegExp } from '@unocss/core';
|
|
4
4
|
|
|
@@ -181,24 +181,28 @@ const variantScope = {
|
|
|
181
181
|
const variantVariables = {
|
|
182
182
|
name: "variables",
|
|
183
183
|
match(matcher) {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
|
|
184
|
+
if (!matcher.startsWith("["))
|
|
185
|
+
return;
|
|
186
|
+
const [match, rest] = getComponent(matcher, "[", "]", ":") ?? [];
|
|
187
|
+
if (!(match && rest && rest !== ""))
|
|
188
|
+
return;
|
|
189
|
+
const variant = handler.bracket(match) ?? "";
|
|
190
|
+
if (!(variant.startsWith("@") || variant.includes("&")))
|
|
191
|
+
return;
|
|
192
|
+
return {
|
|
193
|
+
matcher: rest,
|
|
194
|
+
handle(input, next) {
|
|
195
|
+
const updates = variant.startsWith("@") ? {
|
|
196
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}${variant}`
|
|
197
|
+
} : {
|
|
198
|
+
selector: variant.replace(/&/g, input.selector)
|
|
199
|
+
};
|
|
200
|
+
return next({
|
|
201
|
+
...input,
|
|
202
|
+
...updates
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
};
|
|
202
206
|
},
|
|
203
207
|
multiPass: true
|
|
204
208
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const colors = require('./colors2.cjs');
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const cursorValues = ["auto", "default", "none", "context-menu", "help", "pointer", "progress", "wait", "cell", "crosshair", "text", "vertical-text", "alias", "copy", "move", "no-drop", "not-allowed", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out"];
|
|
6
|
+
const varEmpty = " ";
|
|
6
7
|
const displays = [
|
|
7
8
|
["inline", { display: "inline" }],
|
|
8
9
|
["block", { display: "block" }],
|
|
@@ -11,47 +12,48 @@ const displays = [
|
|
|
11
12
|
["flow-root", { display: "flow-root" }],
|
|
12
13
|
["list-item", { display: "list-item" }],
|
|
13
14
|
["hidden", { display: "none" }],
|
|
14
|
-
[/^display-(.+)$/, ([, c]) => ({ display:
|
|
15
|
+
[/^display-(.+)$/, ([, c]) => ({ display: colors.handler.bracket.cssvar.global(c) || c })]
|
|
15
16
|
];
|
|
16
17
|
const appearances = [
|
|
17
18
|
["visible", { visibility: "visible" }],
|
|
18
19
|
["invisible", { visibility: "hidden" }],
|
|
19
20
|
["backface-visible", { "backface-visibility": "visible" }],
|
|
20
21
|
["backface-hidden", { "backface-visibility": "hidden" }],
|
|
21
|
-
...
|
|
22
|
+
...colors.makeGlobalStaticRules("backface", "backface-visibility")
|
|
22
23
|
];
|
|
23
24
|
const cursors = [
|
|
24
|
-
[/^cursor-(.+)$/, ([, c]) => ({ cursor:
|
|
25
|
+
[/^cursor-(.+)$/, ([, c]) => ({ cursor: colors.handler.bracket.cssvar.global(c) })],
|
|
26
|
+
...cursorValues.map((v) => [`cursor-${v}`, { cursor: v }])
|
|
25
27
|
];
|
|
26
28
|
const pointerEvents = [
|
|
27
29
|
["pointer-events-auto", { "pointer-events": "auto" }],
|
|
28
30
|
["pointer-events-none", { "pointer-events": "none" }],
|
|
29
|
-
...
|
|
31
|
+
...colors.makeGlobalStaticRules("pointer-events")
|
|
30
32
|
];
|
|
31
33
|
const resizes = [
|
|
32
34
|
["resize-x", { resize: "horizontal" }],
|
|
33
35
|
["resize-y", { resize: "vertical" }],
|
|
34
36
|
["resize", { resize: "both" }],
|
|
35
37
|
["resize-none", { resize: "none" }],
|
|
36
|
-
...
|
|
38
|
+
...colors.makeGlobalStaticRules("resize")
|
|
37
39
|
];
|
|
38
40
|
const userSelects = [
|
|
39
41
|
["select-auto", { "user-select": "auto" }],
|
|
40
42
|
["select-all", { "user-select": "all" }],
|
|
41
43
|
["select-text", { "user-select": "text" }],
|
|
42
44
|
["select-none", { "user-select": "none" }],
|
|
43
|
-
...
|
|
45
|
+
...colors.makeGlobalStaticRules("select", "user-select")
|
|
44
46
|
];
|
|
45
47
|
const whitespaces = [
|
|
46
48
|
[
|
|
47
49
|
/^(?:whitespace-|ws-)([-\w]+)$/,
|
|
48
|
-
([, v]) => ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces", ...
|
|
50
|
+
([, v]) => ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces", ...colors.globalKeywords].includes(v) ? { "white-space": v } : void 0,
|
|
49
51
|
{ autocomplete: "(whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap|break-spaces)" }
|
|
50
52
|
]
|
|
51
53
|
];
|
|
52
54
|
const contents = [
|
|
53
55
|
[/^content-\[(.+)\]$/, ([, v]) => ({ content: `"${v}"` })],
|
|
54
|
-
[/^content-(\$.+)]$/, ([, v]) => ({ content:
|
|
56
|
+
[/^content-(\$.+)]$/, ([, v]) => ({ content: colors.handler.cssvar(v) })],
|
|
55
57
|
["content-empty", { content: '""' }],
|
|
56
58
|
["content-none", { content: '""' }]
|
|
57
59
|
];
|
|
@@ -70,7 +72,7 @@ const textTransforms = [
|
|
|
70
72
|
["case-lower", { "text-transform": "lowercase" }],
|
|
71
73
|
["case-capital", { "text-transform": "capitalize" }],
|
|
72
74
|
["case-normal", { "text-transform": "none" }],
|
|
73
|
-
...
|
|
75
|
+
...colors.makeGlobalStaticRules("case", "text-transform")
|
|
74
76
|
];
|
|
75
77
|
const fontStyles = [
|
|
76
78
|
["italic", { "font-style": "italic" }],
|
|
@@ -101,51 +103,56 @@ const ringBase = {
|
|
|
101
103
|
"--un-ring-offset-color": "#fff",
|
|
102
104
|
"--un-ring-width": "0px",
|
|
103
105
|
"--un-ring-color": "rgba(147,197,253,0.5)",
|
|
104
|
-
"--un-shadow": "0 0
|
|
106
|
+
"--un-shadow": "0 0 rgba(0,0,0,0)"
|
|
105
107
|
};
|
|
106
108
|
const rings = [
|
|
107
109
|
[/^ring(?:-(.+))?$/, ([, d], { theme }) => {
|
|
108
|
-
const value = theme.ringWidth?.[d || "DEFAULT"] ??
|
|
110
|
+
const value = theme.ringWidth?.[d || "DEFAULT"] ?? colors.handler.px(d || "1");
|
|
109
111
|
if (value) {
|
|
110
112
|
return {
|
|
111
113
|
"--un-ring-width": value,
|
|
112
114
|
"--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)",
|
|
113
115
|
"--un-ring-shadow": "var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color)",
|
|
114
|
-
"box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow
|
|
116
|
+
"box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)"
|
|
115
117
|
};
|
|
116
118
|
}
|
|
117
119
|
}, { autocomplete: "ring-$ringWidth" }],
|
|
118
|
-
[/^ring-(?:width-|size-)(.+)$/, ([, d], { theme }) => ({ "--un-ring-width": theme.lineWidth?.[d] ??
|
|
120
|
+
[/^ring-(?:width-|size-)(.+)$/, ([, d], { theme }) => ({ "--un-ring-width": theme.lineWidth?.[d] ?? colors.handler.bracket.cssvar.px(d) }), { autocomplete: "ring-(width|size)-$lineWidth" }],
|
|
119
121
|
["ring-offset", { "--un-ring-offset-width": "1px" }],
|
|
120
|
-
[/^ring-offset-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "--un-ring-offset-width": theme.lineWidth?.[d] ??
|
|
121
|
-
[/^ring-(.+)$/,
|
|
122
|
-
[/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity":
|
|
123
|
-
[/^ring-offset-(.+)$/,
|
|
124
|
-
[/^ring-offset-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-offset-opacity":
|
|
122
|
+
[/^ring-offset-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "--un-ring-offset-width": theme.lineWidth?.[d] ?? colors.handler.bracket.cssvar.px(d) }), { autocomplete: "ring-offset-(width|size)-$lineWidth" }],
|
|
123
|
+
[/^ring-(.+)$/, colors.colorResolver("--un-ring-color", "ring"), { autocomplete: "ring-$colors" }],
|
|
124
|
+
[/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "ring-(op|opacity)-<percent>" }],
|
|
125
|
+
[/^ring-offset-(.+)$/, colors.colorResolver("--un-ring-offset-color", "ring-offset"), { autocomplete: "ring-offset-$colors" }],
|
|
126
|
+
[/^ring-offset-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-offset-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "ring-offset-(op|opacity)-<percent>" }],
|
|
125
127
|
["ring-inset", { "--un-ring-inset": "inset" }]
|
|
126
128
|
];
|
|
127
129
|
|
|
128
130
|
const boxShadowsBase = {
|
|
129
|
-
"--un-ring-offset-shadow": "0 0
|
|
130
|
-
"--un-ring-shadow": "0 0
|
|
131
|
+
"--un-ring-offset-shadow": "0 0 rgba(0,0,0,0)",
|
|
132
|
+
"--un-ring-shadow": "0 0 rgba(0,0,0,0)",
|
|
131
133
|
"--un-shadow-inset": varEmpty,
|
|
132
|
-
"--un-shadow": "0 0
|
|
134
|
+
"--un-shadow": "0 0 rgba(0,0,0,0)"
|
|
133
135
|
};
|
|
134
136
|
const boxShadows = [
|
|
135
137
|
[/^shadow(?:-(.+))?$/, ([, d], { theme }) => {
|
|
136
138
|
const v = theme.boxShadow?.[d || "DEFAULT"];
|
|
137
139
|
if (v) {
|
|
138
140
|
return {
|
|
139
|
-
"--un-shadow":
|
|
140
|
-
"box-shadow": "var(--un-ring-offset-shadow
|
|
141
|
+
"--un-shadow": colors.colorableShadows(v, "--un-shadow-color").join(","),
|
|
142
|
+
"box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)"
|
|
141
143
|
};
|
|
142
144
|
}
|
|
143
145
|
}, { autocomplete: "shadow-$boxShadow" }],
|
|
144
|
-
[/^shadow-(.+)$/,
|
|
145
|
-
[/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity":
|
|
146
|
+
[/^shadow-(.+)$/, colors.colorResolver("--un-shadow-color", "shadow"), { autocomplete: "shadow-$colors" }],
|
|
147
|
+
[/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "shadow-(op|opacity)-<percent>" }],
|
|
146
148
|
["shadow-inset", { "--un-shadow-inset": "inset" }]
|
|
147
149
|
];
|
|
148
150
|
|
|
151
|
+
const transformValues = [
|
|
152
|
+
"translate",
|
|
153
|
+
"rotate",
|
|
154
|
+
"scale"
|
|
155
|
+
];
|
|
149
156
|
const transformCpu = [
|
|
150
157
|
"translateX(var(--un-translate-x))",
|
|
151
158
|
"translateY(var(--un-translate-y))",
|
|
@@ -187,9 +194,9 @@ const transformBase = {
|
|
|
187
194
|
"--un-translate-z": 0
|
|
188
195
|
};
|
|
189
196
|
const transforms = [
|
|
190
|
-
[/^(?:transform-)?origin-(.+)$/, ([, s]) => ({ "transform-origin":
|
|
197
|
+
[/^(?:transform-)?origin-(.+)$/, ([, s]) => ({ "transform-origin": colors.positionMap[s] ?? colors.handler.bracket.cssvar(s) }), { autocomplete: [`transform-origin-(${Object.keys(colors.positionMap).join("|")})`, `origin-(${Object.keys(colors.positionMap).join("|")})`] }],
|
|
191
198
|
[/^(?:transform-)?perspect(?:ive)?-(.+)$/, ([, s]) => {
|
|
192
|
-
const v =
|
|
199
|
+
const v = colors.handler.bracket.cssvar.px.numberWithUnit(s);
|
|
193
200
|
if (v != null) {
|
|
194
201
|
return {
|
|
195
202
|
"-webkit-perspective": v,
|
|
@@ -198,7 +205,7 @@ const transforms = [
|
|
|
198
205
|
}
|
|
199
206
|
}],
|
|
200
207
|
[/^(?:transform-)?perspect(?:ive)?-origin-(.+)$/, ([, s]) => {
|
|
201
|
-
const v =
|
|
208
|
+
const v = colors.handler.bracket.cssvar(s) ?? (s.length >= 3 ? colors.positionMap[s] : void 0);
|
|
202
209
|
if (v != null) {
|
|
203
210
|
return {
|
|
204
211
|
"-webkit-perspective-origin": v,
|
|
@@ -210,37 +217,37 @@ const transforms = [
|
|
|
210
217
|
[/^(?:transform-)?translate-([xyz])-(.+)$/, handleTranslate],
|
|
211
218
|
[/^(?:transform-)?rotate-()(.+)$/, handleRotate],
|
|
212
219
|
[/^(?:transform-)?rotate-([xyz])-(.+)$/, handleRotate],
|
|
213
|
-
[/^(?:transform-)?skew-([xy])-(.+)$/, handleSkew],
|
|
220
|
+
[/^(?:transform-)?skew-([xy])-(.+)$/, handleSkew, { autocomplete: ["transform-skew-(x|y)-<percent>"] }],
|
|
214
221
|
[/^(?:transform-)?scale-()(.+)$/, handleScale],
|
|
215
|
-
[/^(?:transform-)?scale-([xyz])-(.+)$/, handleScale],
|
|
222
|
+
[/^(?:transform-)?scale-([xyz])-(.+)$/, handleScale, { autocomplete: [`transform-(${transformValues.join("|")})-<percent>`, `transform-(${transformValues.join("|")})-(x|y|z)-<percent>`] }],
|
|
216
223
|
[/^(?:transform-)?preserve-3d$/, () => ({ "transform-style": "preserve-3d" })],
|
|
217
224
|
[/^(?:transform-)?preserve-flat$/, () => ({ "transform-style": "flat" })],
|
|
218
225
|
["transform", { transform: transformCpu }],
|
|
219
226
|
["transform-cpu", { transform: transformCpu }],
|
|
220
227
|
["transform-gpu", { transform: transformGpu }],
|
|
221
228
|
["transform-none", { transform: "none" }],
|
|
222
|
-
...
|
|
229
|
+
...colors.makeGlobalStaticRules("transform")
|
|
223
230
|
];
|
|
224
231
|
function handleTranslate([, d, b], { theme }) {
|
|
225
|
-
const v = theme.spacing?.[b] ??
|
|
232
|
+
const v = theme.spacing?.[b] ?? colors.handler.bracket.cssvar.fraction.rem(b);
|
|
226
233
|
if (v != null) {
|
|
227
234
|
return [
|
|
228
|
-
...
|
|
235
|
+
...colors.xyzMap[d].map((i) => [`--un-translate${i}`, v]),
|
|
229
236
|
["transform", transformCpu]
|
|
230
237
|
];
|
|
231
238
|
}
|
|
232
239
|
}
|
|
233
240
|
function handleScale([, d, b]) {
|
|
234
|
-
const v =
|
|
241
|
+
const v = colors.handler.bracket.cssvar.fraction.percent(b);
|
|
235
242
|
if (v != null) {
|
|
236
243
|
return [
|
|
237
|
-
...
|
|
244
|
+
...colors.xyzMap[d].map((i) => [`--un-scale${i}`, v]),
|
|
238
245
|
["transform", transformCpu]
|
|
239
246
|
];
|
|
240
247
|
}
|
|
241
248
|
}
|
|
242
249
|
function handleRotate([, d = "", b]) {
|
|
243
|
-
const v =
|
|
250
|
+
const v = colors.handler.bracket.cssvar.degree(b);
|
|
244
251
|
if (v != null) {
|
|
245
252
|
if (d) {
|
|
246
253
|
return {
|
|
@@ -260,7 +267,7 @@ function handleRotate([, d = "", b]) {
|
|
|
260
267
|
}
|
|
261
268
|
}
|
|
262
269
|
function handleSkew([, d, b]) {
|
|
263
|
-
const v =
|
|
270
|
+
const v = colors.handler.bracket.cssvar.degree(b);
|
|
264
271
|
if (v != null) {
|
|
265
272
|
return {
|
|
266
273
|
[`--un-skew-${d}`]: v,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { h as handler, m as makeGlobalStaticRules, g as globalKeywords, c as colorResolver, i as colorableShadows,
|
|
1
|
+
import { h as handler, m as makeGlobalStaticRules, g as globalKeywords, c as colorResolver, i as colorableShadows, o as positionMap, x as xyzMap } from './colors2.mjs';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const cursorValues = ["auto", "default", "none", "context-menu", "help", "pointer", "progress", "wait", "cell", "crosshair", "text", "vertical-text", "alias", "copy", "move", "no-drop", "not-allowed", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out"];
|
|
4
|
+
const varEmpty = " ";
|
|
4
5
|
const displays = [
|
|
5
6
|
["inline", { display: "inline" }],
|
|
6
7
|
["block", { display: "block" }],
|
|
@@ -19,7 +20,8 @@ const appearances = [
|
|
|
19
20
|
...makeGlobalStaticRules("backface", "backface-visibility")
|
|
20
21
|
];
|
|
21
22
|
const cursors = [
|
|
22
|
-
[/^cursor-(.+)$/, ([, c]) => ({ cursor: handler.bracket.cssvar.global(c)
|
|
23
|
+
[/^cursor-(.+)$/, ([, c]) => ({ cursor: handler.bracket.cssvar.global(c) })],
|
|
24
|
+
...cursorValues.map((v) => [`cursor-${v}`, { cursor: v }])
|
|
23
25
|
];
|
|
24
26
|
const pointerEvents = [
|
|
25
27
|
["pointer-events-auto", { "pointer-events": "auto" }],
|
|
@@ -99,7 +101,7 @@ const ringBase = {
|
|
|
99
101
|
"--un-ring-offset-color": "#fff",
|
|
100
102
|
"--un-ring-width": "0px",
|
|
101
103
|
"--un-ring-color": "rgba(147,197,253,0.5)",
|
|
102
|
-
"--un-shadow": "0 0
|
|
104
|
+
"--un-shadow": "0 0 rgba(0,0,0,0)"
|
|
103
105
|
};
|
|
104
106
|
const rings = [
|
|
105
107
|
[/^ring(?:-(.+))?$/, ([, d], { theme }) => {
|
|
@@ -109,7 +111,7 @@ const rings = [
|
|
|
109
111
|
"--un-ring-width": value,
|
|
110
112
|
"--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)",
|
|
111
113
|
"--un-ring-shadow": "var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color)",
|
|
112
|
-
"box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow
|
|
114
|
+
"box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)"
|
|
113
115
|
};
|
|
114
116
|
}
|
|
115
117
|
}, { autocomplete: "ring-$ringWidth" }],
|
|
@@ -124,10 +126,10 @@ const rings = [
|
|
|
124
126
|
];
|
|
125
127
|
|
|
126
128
|
const boxShadowsBase = {
|
|
127
|
-
"--un-ring-offset-shadow": "0 0
|
|
128
|
-
"--un-ring-shadow": "0 0
|
|
129
|
+
"--un-ring-offset-shadow": "0 0 rgba(0,0,0,0)",
|
|
130
|
+
"--un-ring-shadow": "0 0 rgba(0,0,0,0)",
|
|
129
131
|
"--un-shadow-inset": varEmpty,
|
|
130
|
-
"--un-shadow": "0 0
|
|
132
|
+
"--un-shadow": "0 0 rgba(0,0,0,0)"
|
|
131
133
|
};
|
|
132
134
|
const boxShadows = [
|
|
133
135
|
[/^shadow(?:-(.+))?$/, ([, d], { theme }) => {
|
|
@@ -135,7 +137,7 @@ const boxShadows = [
|
|
|
135
137
|
if (v) {
|
|
136
138
|
return {
|
|
137
139
|
"--un-shadow": colorableShadows(v, "--un-shadow-color").join(","),
|
|
138
|
-
"box-shadow": "var(--un-ring-offset-shadow
|
|
140
|
+
"box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)"
|
|
139
141
|
};
|
|
140
142
|
}
|
|
141
143
|
}, { autocomplete: "shadow-$boxShadow" }],
|
|
@@ -144,6 +146,11 @@ const boxShadows = [
|
|
|
144
146
|
["shadow-inset", { "--un-shadow-inset": "inset" }]
|
|
145
147
|
];
|
|
146
148
|
|
|
149
|
+
const transformValues = [
|
|
150
|
+
"translate",
|
|
151
|
+
"rotate",
|
|
152
|
+
"scale"
|
|
153
|
+
];
|
|
147
154
|
const transformCpu = [
|
|
148
155
|
"translateX(var(--un-translate-x))",
|
|
149
156
|
"translateY(var(--un-translate-y))",
|
|
@@ -208,9 +215,9 @@ const transforms = [
|
|
|
208
215
|
[/^(?:transform-)?translate-([xyz])-(.+)$/, handleTranslate],
|
|
209
216
|
[/^(?:transform-)?rotate-()(.+)$/, handleRotate],
|
|
210
217
|
[/^(?:transform-)?rotate-([xyz])-(.+)$/, handleRotate],
|
|
211
|
-
[/^(?:transform-)?skew-([xy])-(.+)$/, handleSkew],
|
|
218
|
+
[/^(?:transform-)?skew-([xy])-(.+)$/, handleSkew, { autocomplete: ["transform-skew-(x|y)-<percent>"] }],
|
|
212
219
|
[/^(?:transform-)?scale-()(.+)$/, handleScale],
|
|
213
|
-
[/^(?:transform-)?scale-([xyz])-(.+)$/, handleScale],
|
|
220
|
+
[/^(?:transform-)?scale-([xyz])-(.+)$/, handleScale, { autocomplete: [`transform-(${transformValues.join("|")})-<percent>`, `transform-(${transformValues.join("|")})-(x|y|z)-<percent>`] }],
|
|
214
221
|
[/^(?:transform-)?preserve-3d$/, () => ({ "transform-style": "preserve-3d" })],
|
|
215
222
|
[/^(?:transform-)?preserve-flat$/, () => ({ "transform-style": "flat" })],
|
|
216
223
|
["transform", { transform: transformCpu }],
|
package/dist/index.cjs
CHANGED
|
@@ -7,7 +7,7 @@ const _default = require('./chunks/default.cjs');
|
|
|
7
7
|
const _default$1 = require('./chunks/default2.cjs');
|
|
8
8
|
const _default$2 = require('./chunks/default3.cjs');
|
|
9
9
|
const colors = require('./chunks/colors.cjs');
|
|
10
|
-
const
|
|
10
|
+
const colors$1 = require('./chunks/colors2.cjs');
|
|
11
11
|
require('./chunks/transform.cjs');
|
|
12
12
|
require('./chunks/variants.cjs');
|
|
13
13
|
|
|
@@ -33,7 +33,8 @@ const presetMini = (options = {}) => {
|
|
|
33
33
|
variants: _default$2.variants(options),
|
|
34
34
|
options,
|
|
35
35
|
postprocess: options.variablePrefix && options.variablePrefix !== "un-" ? VarPrefixPostprocessor(options.variablePrefix) : void 0,
|
|
36
|
-
preflights
|
|
36
|
+
preflights,
|
|
37
|
+
prefix: options.prefix
|
|
37
38
|
};
|
|
38
39
|
};
|
|
39
40
|
function VarPrefixPostprocessor(prefix) {
|
|
@@ -48,7 +49,7 @@ function VarPrefixPostprocessor(prefix) {
|
|
|
48
49
|
|
|
49
50
|
exports.theme = _default.theme;
|
|
50
51
|
exports.colors = colors.colors;
|
|
51
|
-
exports.parseColor =
|
|
52
|
+
exports.parseColor = colors$1.parseColor;
|
|
52
53
|
exports["default"] = presetMini;
|
|
53
54
|
exports.preflights = preflights;
|
|
54
55
|
exports.presetMini = presetMini;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { T as Theme } from './types-9e30040a.js';
|
|
|
3
3
|
export { T as Theme, a as ThemeAnimation } from './types-9e30040a.js';
|
|
4
4
|
export { t as theme } from './default-0fe8c7f8.js';
|
|
5
5
|
export { c as colors } from './colors-f2b5968c.js';
|
|
6
|
-
export { p as parseColor } from './utilities-
|
|
6
|
+
export { p as parseColor } from './utilities-b44b330d.js';
|
|
7
7
|
|
|
8
8
|
declare const preflights: Preflight[];
|
|
9
9
|
|
|
@@ -20,6 +20,12 @@ interface PresetMiniOptions extends PresetOptions {
|
|
|
20
20
|
* @default 'un-'
|
|
21
21
|
*/
|
|
22
22
|
variablePrefix?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Utils prefix
|
|
25
|
+
*
|
|
26
|
+
* @default undefined
|
|
27
|
+
*/
|
|
28
|
+
prefix?: string;
|
|
23
29
|
}
|
|
24
30
|
declare const presetMini: (options?: PresetMiniOptions) => Preset<Theme>;
|
|
25
31
|
|
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ export { t as theme } from './chunks/default.mjs';
|
|
|
4
4
|
import { r as rules } from './chunks/default2.mjs';
|
|
5
5
|
import { v as variants } from './chunks/default3.mjs';
|
|
6
6
|
export { c as colors } from './chunks/colors.mjs';
|
|
7
|
-
export { p as parseColor } from './chunks/
|
|
7
|
+
export { p as parseColor } from './chunks/colors2.mjs';
|
|
8
8
|
import './chunks/transform.mjs';
|
|
9
9
|
import './chunks/variants.mjs';
|
|
10
10
|
|
|
@@ -30,7 +30,8 @@ const presetMini = (options = {}) => {
|
|
|
30
30
|
variants: variants(options),
|
|
31
31
|
options,
|
|
32
32
|
postprocess: options.variablePrefix && options.variablePrefix !== "un-" ? VarPrefixPostprocessor(options.variablePrefix) : void 0,
|
|
33
|
-
preflights
|
|
33
|
+
preflights,
|
|
34
|
+
prefix: options.prefix
|
|
34
35
|
};
|
|
35
36
|
};
|
|
36
37
|
function VarPrefixPostprocessor(prefix) {
|
package/dist/rules.cjs
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const _default = require('./chunks/default2.cjs');
|
|
6
6
|
const transform = require('./chunks/transform.cjs');
|
|
7
|
-
require('./chunks/
|
|
7
|
+
require('./chunks/colors2.cjs');
|
|
8
8
|
require('@unocss/core');
|
|
9
9
|
|
|
10
10
|
|
package/dist/rules.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ declare const aspectRatio: Rule[];
|
|
|
72
72
|
declare const paddings: Rule[];
|
|
73
73
|
declare const margins: Rule[];
|
|
74
74
|
|
|
75
|
-
declare const varEmpty = "
|
|
75
|
+
declare const varEmpty = " ";
|
|
76
76
|
declare const displays: Rule[];
|
|
77
77
|
declare const appearances: Rule[];
|
|
78
78
|
declare const cursors: Rule[];
|
package/dist/rules.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { m as alignments, a as appearance, A as aspectRatio, f as bgColors, b as borderStyles, c as borders, u as boxSizing, L as cssProperty, K as cssVariables, g as flex, s as floats, F as fonts, h as gaps, i as grids, q as insets, k as justifies, C as margins, d as opacity, l as orders, o as outline, j as overflows, B as paddings, n as placements, p as positions, x as questionMark, r as rules, y as sizes, D as svgUtilities, G as tabSizes, t as textAligns, e as textColors, M as textDecorations, H as textIndents, J as textShadows, I as textStrokes, E as transitions, v as verticalAligns, w as willChange, z as zIndexes } from './chunks/default2.mjs';
|
|
2
2
|
export { k as appearances, h as boxShadows, b as boxShadowsBase, m as breaks, c as contents, j as cursors, d as displays, g as fontSmoothings, f as fontStyles, p as pointerEvents, l as resizes, r as ringBase, i as rings, a as textOverflows, e as textTransforms, t as transformBase, n as transforms, u as userSelects, v as varEmpty, w as whitespaces } from './chunks/transform.mjs';
|
|
3
|
-
import './chunks/
|
|
3
|
+
import './chunks/colors2.mjs';
|
|
4
4
|
import '@unocss/core';
|
package/dist/theme.cjs
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const colors = require('./chunks/colors.cjs');
|
|
6
6
|
const _default = require('./chunks/default.cjs');
|
|
7
7
|
require('./chunks/transform.cjs');
|
|
8
|
-
require('./chunks/
|
|
8
|
+
require('./chunks/colors2.cjs');
|
|
9
9
|
require('@unocss/core');
|
|
10
10
|
|
|
11
11
|
|