@unocss/preset-wind3 66.0.0
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 +21 -0
- package/README.md +11 -0
- package/colors.d.ts +1 -0
- package/dist/colors.d.mts +2 -0
- package/dist/colors.d.ts +2 -0
- package/dist/colors.mjs +1 -0
- package/dist/index.d.mts +33 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.mjs +59 -0
- package/dist/rules.d.mts +95 -0
- package/dist/rules.d.ts +95 -0
- package/dist/rules.mjs +7 -0
- package/dist/shared/preset-wind3.BzmnsdqZ.mjs +67 -0
- package/dist/shared/preset-wind3.C-c8jDe5.mjs +634 -0
- package/dist/shared/preset-wind3.DIaVUBWk.mjs +149 -0
- package/dist/shared/preset-wind3.DRADYSMV.d.mts +6 -0
- package/dist/shared/preset-wind3.DRADYSMV.d.ts +6 -0
- package/dist/shared/preset-wind3.DjKJQ_OR.mjs +279 -0
- package/dist/shortcuts.d.mts +6 -0
- package/dist/shortcuts.d.ts +6 -0
- package/dist/shortcuts.mjs +9 -0
- package/dist/theme.d.mts +5 -0
- package/dist/theme.d.ts +5 -0
- package/dist/theme.mjs +315 -0
- package/dist/utils.d.mts +1 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.mjs +1 -0
- package/dist/variants.d.mts +28 -0
- package/dist/variants.d.ts +28 -0
- package/dist/variants.mjs +4 -0
- package/package.json +72 -0
- package/rules.d.ts +1 -0
- package/shortcuts.d.ts +1 -0
- package/theme.d.ts +1 -0
- package/utils.d.ts +1 -0
- package/variants.d.ts +1 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { variants as variants$1 } from '@unocss/preset-mini/variants';
|
|
2
|
+
import { variantMatcher, variantParentMatcher, hasParseableColor, h } from '@unocss/preset-mini/utils';
|
|
3
|
+
import { variantMatcher as variantMatcher$1, parseCssColor, colorToString } from '@unocss/rule-utils';
|
|
4
|
+
|
|
5
|
+
const variantCombinators = [
|
|
6
|
+
variantMatcher("svg", (input) => ({ selector: `${input.selector} svg` }))
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
const variantColorsScheme = [
|
|
10
|
+
variantMatcher(".dark", (input) => ({ prefix: `.dark $$ ${input.prefix}` })),
|
|
11
|
+
variantMatcher(".light", (input) => ({ prefix: `.light $$ ${input.prefix}` })),
|
|
12
|
+
variantParentMatcher("@dark", "@media (prefers-color-scheme: dark)"),
|
|
13
|
+
variantParentMatcher("@light", "@media (prefers-color-scheme: light)")
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
const variantContrasts = [
|
|
17
|
+
variantParentMatcher("contrast-more", "@media (prefers-contrast: more)"),
|
|
18
|
+
variantParentMatcher("contrast-less", "@media (prefers-contrast: less)")
|
|
19
|
+
];
|
|
20
|
+
const variantMotions = [
|
|
21
|
+
variantParentMatcher("motion-reduce", "@media (prefers-reduced-motion: reduce)"),
|
|
22
|
+
variantParentMatcher("motion-safe", "@media (prefers-reduced-motion: no-preference)")
|
|
23
|
+
];
|
|
24
|
+
const variantOrientations = [
|
|
25
|
+
variantParentMatcher("landscape", "@media (orientation: landscape)"),
|
|
26
|
+
variantParentMatcher("portrait", "@media (orientation: portrait)")
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
const variantSpaceAndDivide = (matcher) => {
|
|
30
|
+
if (matcher.startsWith("_"))
|
|
31
|
+
return;
|
|
32
|
+
if (/space-[xy]-.+$/.test(matcher) || /divide-/.test(matcher)) {
|
|
33
|
+
return {
|
|
34
|
+
matcher,
|
|
35
|
+
selector: (input) => {
|
|
36
|
+
const not = ">:not([hidden])~:not([hidden])";
|
|
37
|
+
return input.includes(not) ? input : `${input}${not}`;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const variantStickyHover = [
|
|
43
|
+
variantMatcher$1("@hover", (input) => ({
|
|
44
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (hover: hover) and (pointer: fine)`,
|
|
45
|
+
selector: `${input.selector || ""}:hover`
|
|
46
|
+
}))
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
function mixComponent(v1, v2, w) {
|
|
50
|
+
return `calc(${v2} + (${v1} - ${v2}) * ${w} / 100)`;
|
|
51
|
+
}
|
|
52
|
+
function mixColor(color1, color2, weight) {
|
|
53
|
+
const colors = [color1, color2];
|
|
54
|
+
const cssColors = [];
|
|
55
|
+
for (let c = 0; c < 2; c++) {
|
|
56
|
+
const color = typeof colors[c] === "string" ? parseCssColor(colors[c]) : colors[c];
|
|
57
|
+
if (!color || !["rgb", "rgba"].includes(color.type))
|
|
58
|
+
return;
|
|
59
|
+
cssColors.push(color);
|
|
60
|
+
}
|
|
61
|
+
const newComponents = [];
|
|
62
|
+
for (let x = 0; x < 3; x++)
|
|
63
|
+
newComponents.push(mixComponent(cssColors[0].components[x], cssColors[1].components[x], weight));
|
|
64
|
+
return {
|
|
65
|
+
type: "rgb",
|
|
66
|
+
components: newComponents,
|
|
67
|
+
alpha: mixComponent(cssColors[0].alpha ?? 1, cssColors[1].alpha ?? 1, weight)
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function tint(color, weight) {
|
|
71
|
+
return mixColor("#fff", color, weight);
|
|
72
|
+
}
|
|
73
|
+
function shade(color, weight) {
|
|
74
|
+
return mixColor("#000", color, weight);
|
|
75
|
+
}
|
|
76
|
+
function shift(color, weight) {
|
|
77
|
+
const num = Number.parseFloat(`${weight}`);
|
|
78
|
+
if (!Number.isNaN(num))
|
|
79
|
+
return num > 0 ? shade(color, weight) : tint(color, -num);
|
|
80
|
+
}
|
|
81
|
+
const fns = { tint, shade, shift };
|
|
82
|
+
function variantColorMix() {
|
|
83
|
+
let re;
|
|
84
|
+
return {
|
|
85
|
+
name: "mix",
|
|
86
|
+
match(matcher, ctx) {
|
|
87
|
+
if (!re)
|
|
88
|
+
re = new RegExp(`^mix-(tint|shade|shift)-(-?\\d{1,3})(?:${ctx.generator.config.separators.join("|")})`);
|
|
89
|
+
const m = matcher.match(re);
|
|
90
|
+
if (m) {
|
|
91
|
+
return {
|
|
92
|
+
matcher: matcher.slice(m[0].length),
|
|
93
|
+
body: (body) => {
|
|
94
|
+
body.forEach((v) => {
|
|
95
|
+
if (v[1]) {
|
|
96
|
+
const color = parseCssColor(`${v[1]}`);
|
|
97
|
+
if (color) {
|
|
98
|
+
const mixed = fns[m[1]](color, m[2]);
|
|
99
|
+
if (mixed)
|
|
100
|
+
v[1] = colorToString(mixed);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
return body;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const placeholderModifier = (input, { theme }) => {
|
|
113
|
+
const m = input.match(/^(.*)\b(placeholder-)(.+)$/);
|
|
114
|
+
if (m) {
|
|
115
|
+
const [, pre = "", p, body] = m;
|
|
116
|
+
if (hasParseableColor(body, theme, "accentColor") || hasOpacityValue(body)) {
|
|
117
|
+
return {
|
|
118
|
+
// Append `placeholder-$ ` (with space!) to the rule to be matched.
|
|
119
|
+
// The `placeholder-` is added for placeholder variant processing, and
|
|
120
|
+
// the `$ ` is added for rule matching after `placeholder-` is removed by the variant.
|
|
121
|
+
// See rules/placeholder.
|
|
122
|
+
matcher: `${pre}placeholder-$ ${p}${body}`
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
function hasOpacityValue(body) {
|
|
128
|
+
const match = body.match(/^op(?:acity)?-?(.+)$/);
|
|
129
|
+
if (match && match[1] != null)
|
|
130
|
+
return h.bracket.percent(match[1]) != null;
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function variants(options) {
|
|
135
|
+
return [
|
|
136
|
+
placeholderModifier,
|
|
137
|
+
variantSpaceAndDivide,
|
|
138
|
+
...variants$1(options),
|
|
139
|
+
...variantContrasts,
|
|
140
|
+
...variantOrientations,
|
|
141
|
+
...variantMotions,
|
|
142
|
+
...variantCombinators,
|
|
143
|
+
...variantColorsScheme,
|
|
144
|
+
...variantStickyHover,
|
|
145
|
+
variantColorMix()
|
|
146
|
+
];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export { variantColorsScheme as a, variants as b, variantContrasts as c, variantMotions as d, variantOrientations as e, variantSpaceAndDivide as f, variantStickyHover as g, variantColorMix as h, placeholderModifier as p, variantCombinators as v };
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { varEmpty } from '@unocss/preset-mini/rules';
|
|
2
|
+
import { colorResolver, h, globalKeywords, colorableShadows, directionSize, makeGlobalStaticRules } from '@unocss/preset-mini/utils';
|
|
3
|
+
|
|
4
|
+
const filterBase = {
|
|
5
|
+
"--un-blur": varEmpty,
|
|
6
|
+
"--un-brightness": varEmpty,
|
|
7
|
+
"--un-contrast": varEmpty,
|
|
8
|
+
"--un-drop-shadow": varEmpty,
|
|
9
|
+
"--un-grayscale": varEmpty,
|
|
10
|
+
"--un-hue-rotate": varEmpty,
|
|
11
|
+
"--un-invert": varEmpty,
|
|
12
|
+
"--un-saturate": varEmpty,
|
|
13
|
+
"--un-sepia": varEmpty
|
|
14
|
+
};
|
|
15
|
+
const filterBaseKeys = Object.keys(filterBase);
|
|
16
|
+
const filterMetaCustom = {
|
|
17
|
+
preflightKeys: filterBaseKeys
|
|
18
|
+
};
|
|
19
|
+
const filterProperty = "var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)";
|
|
20
|
+
const backdropFilterBase = {
|
|
21
|
+
"--un-backdrop-blur": varEmpty,
|
|
22
|
+
"--un-backdrop-brightness": varEmpty,
|
|
23
|
+
"--un-backdrop-contrast": varEmpty,
|
|
24
|
+
"--un-backdrop-grayscale": varEmpty,
|
|
25
|
+
"--un-backdrop-hue-rotate": varEmpty,
|
|
26
|
+
"--un-backdrop-invert": varEmpty,
|
|
27
|
+
"--un-backdrop-opacity": varEmpty,
|
|
28
|
+
"--un-backdrop-saturate": varEmpty,
|
|
29
|
+
"--un-backdrop-sepia": varEmpty
|
|
30
|
+
};
|
|
31
|
+
const backdropFilterBaseKeys = Object.keys(backdropFilterBase);
|
|
32
|
+
const backdropMetaCustom = {
|
|
33
|
+
preflightKeys: backdropFilterBaseKeys
|
|
34
|
+
};
|
|
35
|
+
const backdropFilterProperty = "var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)";
|
|
36
|
+
const composeMetaCustom = {
|
|
37
|
+
preflightKeys: [...filterBaseKeys, ...backdropFilterBaseKeys]
|
|
38
|
+
};
|
|
39
|
+
function percentWithDefault(str) {
|
|
40
|
+
let v = h.bracket.cssvar(str || "");
|
|
41
|
+
if (v != null)
|
|
42
|
+
return v;
|
|
43
|
+
v = str ? h.percent(str) : "1";
|
|
44
|
+
if (v != null && Number.parseFloat(v) <= 1)
|
|
45
|
+
return v;
|
|
46
|
+
}
|
|
47
|
+
function toFilter(varName, resolver) {
|
|
48
|
+
return ([, b, s], { theme }) => {
|
|
49
|
+
const value = resolver(s, theme) ?? (s === "none" ? "0" : "");
|
|
50
|
+
if (value !== "") {
|
|
51
|
+
if (b) {
|
|
52
|
+
return {
|
|
53
|
+
[`--un-${b}${varName}`]: `${varName}(${value})`,
|
|
54
|
+
"-webkit-backdrop-filter": backdropFilterProperty,
|
|
55
|
+
"backdrop-filter": backdropFilterProperty
|
|
56
|
+
};
|
|
57
|
+
} else {
|
|
58
|
+
return {
|
|
59
|
+
[`--un-${varName}`]: `${varName}(${value})`,
|
|
60
|
+
filter: filterProperty
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function dropShadowResolver([, s], { theme }) {
|
|
67
|
+
let v = theme.dropShadow?.[s || "DEFAULT"];
|
|
68
|
+
if (v != null) {
|
|
69
|
+
const shadows = colorableShadows(v, "--un-drop-shadow-color");
|
|
70
|
+
return {
|
|
71
|
+
"--un-drop-shadow": `drop-shadow(${shadows.join(") drop-shadow(")})`,
|
|
72
|
+
"filter": filterProperty
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
v = h.bracket.cssvar(s);
|
|
76
|
+
if (v != null) {
|
|
77
|
+
return {
|
|
78
|
+
"--un-drop-shadow": `drop-shadow(${v})`,
|
|
79
|
+
"filter": filterProperty
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const filters = [
|
|
84
|
+
// filters
|
|
85
|
+
[/^(?:(backdrop-)|filter-)?blur(?:-(.+))?$/, toFilter("blur", (s, theme) => theme.blur?.[s || "DEFAULT"] || h.bracket.cssvar.px(s)), { custom: composeMetaCustom, autocomplete: ["(backdrop|filter)-blur-$blur", "blur-$blur", "filter-blur"] }],
|
|
86
|
+
[/^(?:(backdrop-)|filter-)?brightness-(.+)$/, toFilter("brightness", (s) => h.bracket.cssvar.percent(s)), { custom: composeMetaCustom, autocomplete: ["(backdrop|filter)-brightness-<percent>", "brightness-<percent>"] }],
|
|
87
|
+
[/^(?:(backdrop-)|filter-)?contrast-(.+)$/, toFilter("contrast", (s) => h.bracket.cssvar.percent(s)), { custom: composeMetaCustom, autocomplete: ["(backdrop|filter)-contrast-<percent>", "contrast-<percent>"] }],
|
|
88
|
+
// drop-shadow only on filter
|
|
89
|
+
[/^(?:filter-)?drop-shadow(?:-(.+))?$/, dropShadowResolver, {
|
|
90
|
+
custom: filterMetaCustom,
|
|
91
|
+
autocomplete: [
|
|
92
|
+
"filter-drop",
|
|
93
|
+
"filter-drop-shadow",
|
|
94
|
+
"filter-drop-shadow-color",
|
|
95
|
+
"drop-shadow",
|
|
96
|
+
"drop-shadow-color",
|
|
97
|
+
"filter-drop-shadow-$dropShadow",
|
|
98
|
+
"drop-shadow-$dropShadow",
|
|
99
|
+
"filter-drop-shadow-color-$colors",
|
|
100
|
+
"drop-shadow-color-$colors",
|
|
101
|
+
"filter-drop-shadow-color-(op|opacity)",
|
|
102
|
+
"drop-shadow-color-(op|opacity)",
|
|
103
|
+
"filter-drop-shadow-color-(op|opacity)-<percent>",
|
|
104
|
+
"drop-shadow-color-(op|opacity)-<percent>"
|
|
105
|
+
]
|
|
106
|
+
}],
|
|
107
|
+
[/^(?:filter-)?drop-shadow-color-(.+)$/, colorResolver("--un-drop-shadow-color", "drop-shadow", "shadowColor")],
|
|
108
|
+
[/^(?:filter-)?drop-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-drop-shadow-opacity": h.bracket.percent(opacity) })],
|
|
109
|
+
[/^(?:(backdrop-)|filter-)?grayscale(?:-(.+))?$/, toFilter("grayscale", percentWithDefault), { custom: composeMetaCustom, autocomplete: ["(backdrop|filter)-grayscale", "(backdrop|filter)-grayscale-<percent>", "grayscale-<percent>"] }],
|
|
110
|
+
[/^(?:(backdrop-)|filter-)?hue-rotate-(.+)$/, toFilter("hue-rotate", (s) => h.bracket.cssvar.degree(s)), { custom: composeMetaCustom }],
|
|
111
|
+
[/^(?:(backdrop-)|filter-)?invert(?:-(.+))?$/, toFilter("invert", percentWithDefault), { custom: composeMetaCustom, autocomplete: ["(backdrop|filter)-invert", "(backdrop|filter)-invert-<percent>", "invert-<percent>"] }],
|
|
112
|
+
// opacity only on backdrop-filter
|
|
113
|
+
[/^(backdrop-)op(?:acity)?-(.+)$/, toFilter("opacity", (s) => h.bracket.cssvar.percent(s)), { custom: composeMetaCustom, autocomplete: ["backdrop-(op|opacity)", "backdrop-(op|opacity)-<percent>"] }],
|
|
114
|
+
[/^(?:(backdrop-)|filter-)?saturate-(.+)$/, toFilter("saturate", (s) => h.bracket.cssvar.percent(s)), { custom: composeMetaCustom, autocomplete: ["(backdrop|filter)-saturate", "(backdrop|filter)-saturate-<percent>", "saturate-<percent>"] }],
|
|
115
|
+
[/^(?:(backdrop-)|filter-)?sepia(?:-(.+))?$/, toFilter("sepia", percentWithDefault), { custom: composeMetaCustom, autocomplete: ["(backdrop|filter)-sepia", "(backdrop|filter)-sepia-<percent>", "sepia-<percent>"] }],
|
|
116
|
+
// base
|
|
117
|
+
["filter", { filter: filterProperty }, { custom: filterMetaCustom }],
|
|
118
|
+
["backdrop-filter", {
|
|
119
|
+
"-webkit-backdrop-filter": backdropFilterProperty,
|
|
120
|
+
"backdrop-filter": backdropFilterProperty
|
|
121
|
+
}, { custom: backdropMetaCustom }],
|
|
122
|
+
// nones
|
|
123
|
+
["filter-none", { filter: "none" }],
|
|
124
|
+
["backdrop-filter-none", {
|
|
125
|
+
"-webkit-backdrop-filter": "none",
|
|
126
|
+
"backdrop-filter": "none"
|
|
127
|
+
}],
|
|
128
|
+
...globalKeywords.map((keyword) => [`filter-${keyword}`, { filter: keyword }]),
|
|
129
|
+
...globalKeywords.map((keyword) => [`backdrop-filter-${keyword}`, {
|
|
130
|
+
"-webkit-backdrop-filter": keyword,
|
|
131
|
+
"backdrop-filter": keyword
|
|
132
|
+
}])
|
|
133
|
+
];
|
|
134
|
+
|
|
135
|
+
const scrollSnapTypeBase = {
|
|
136
|
+
"--un-scroll-snap-strictness": "proximity"
|
|
137
|
+
};
|
|
138
|
+
const custom$3 = { preflightKeys: Object.keys(scrollSnapTypeBase) };
|
|
139
|
+
const scrolls = [
|
|
140
|
+
// snap type
|
|
141
|
+
[/^snap-(x|y)$/, ([, d]) => ({
|
|
142
|
+
"scroll-snap-type": `${d} var(--un-scroll-snap-strictness)`
|
|
143
|
+
}), { custom: custom$3, autocomplete: "snap-(x|y|both)" }],
|
|
144
|
+
[/^snap-both$/, () => ({
|
|
145
|
+
"scroll-snap-type": "both var(--un-scroll-snap-strictness)"
|
|
146
|
+
}), { custom: custom$3 }],
|
|
147
|
+
["snap-mandatory", { "--un-scroll-snap-strictness": "mandatory" }],
|
|
148
|
+
["snap-proximity", { "--un-scroll-snap-strictness": "proximity" }],
|
|
149
|
+
["snap-none", { "scroll-snap-type": "none" }],
|
|
150
|
+
// snap align
|
|
151
|
+
["snap-start", { "scroll-snap-align": "start" }],
|
|
152
|
+
["snap-end", { "scroll-snap-align": "end" }],
|
|
153
|
+
["snap-center", { "scroll-snap-align": "center" }],
|
|
154
|
+
["snap-align-none", { "scroll-snap-align": "none" }],
|
|
155
|
+
// snap stop
|
|
156
|
+
["snap-normal", { "scroll-snap-stop": "normal" }],
|
|
157
|
+
["snap-always", { "scroll-snap-stop": "always" }],
|
|
158
|
+
// scroll margin
|
|
159
|
+
[/^scroll-ma?()-?(.+)$/, directionSize("scroll-margin"), {
|
|
160
|
+
autocomplete: [
|
|
161
|
+
"scroll-(m|p|ma|pa|block|inline)",
|
|
162
|
+
"scroll-(m|p|ma|pa|block|inline)-$spacing",
|
|
163
|
+
"scroll-(m|p|ma|pa|block|inline)-(x|y|r|l|t|b|bs|be|is|ie)",
|
|
164
|
+
"scroll-(m|p|ma|pa|block|inline)-(x|y|r|l|t|b|bs|be|is|ie)-$spacing"
|
|
165
|
+
]
|
|
166
|
+
}],
|
|
167
|
+
[/^scroll-m-?([xy])-?(.+)$/, directionSize("scroll-margin")],
|
|
168
|
+
[/^scroll-m-?([rltb])-?(.+)$/, directionSize("scroll-margin")],
|
|
169
|
+
[/^scroll-m-(block|inline)-(.+)$/, directionSize("scroll-margin")],
|
|
170
|
+
[/^scroll-m-?([bi][se])-?(.+)$/, directionSize("scroll-margin")],
|
|
171
|
+
// scroll padding
|
|
172
|
+
[/^scroll-pa?()-?(.+)$/, directionSize("scroll-padding")],
|
|
173
|
+
[/^scroll-p-?([xy])-?(.+)$/, directionSize("scroll-padding")],
|
|
174
|
+
[/^scroll-p-?([rltb])-?(.+)$/, directionSize("scroll-padding")],
|
|
175
|
+
[/^scroll-p-(block|inline)-(.+)$/, directionSize("scroll-padding")],
|
|
176
|
+
[/^scroll-p-?([bi][se])-?(.+)$/, directionSize("scroll-padding")]
|
|
177
|
+
];
|
|
178
|
+
|
|
179
|
+
const borderSpacingBase = {
|
|
180
|
+
"--un-border-spacing-x": 0,
|
|
181
|
+
"--un-border-spacing-y": 0
|
|
182
|
+
};
|
|
183
|
+
const custom$2 = { preflightKeys: Object.keys(borderSpacingBase) };
|
|
184
|
+
const borderSpacingProperty = "var(--un-border-spacing-x) var(--un-border-spacing-y)";
|
|
185
|
+
const tables = [
|
|
186
|
+
// displays
|
|
187
|
+
["inline-table", { display: "inline-table" }],
|
|
188
|
+
["table", { display: "table" }],
|
|
189
|
+
["table-caption", { display: "table-caption" }],
|
|
190
|
+
["table-cell", { display: "table-cell" }],
|
|
191
|
+
["table-column", { display: "table-column" }],
|
|
192
|
+
["table-column-group", { display: "table-column-group" }],
|
|
193
|
+
["table-footer-group", { display: "table-footer-group" }],
|
|
194
|
+
["table-header-group", { display: "table-header-group" }],
|
|
195
|
+
["table-row", { display: "table-row" }],
|
|
196
|
+
["table-row-group", { display: "table-row-group" }],
|
|
197
|
+
// layouts
|
|
198
|
+
["border-collapse", { "border-collapse": "collapse" }],
|
|
199
|
+
["border-separate", { "border-collapse": "separate" }],
|
|
200
|
+
[/^border-spacing-(.+)$/, ([, s], { theme }) => {
|
|
201
|
+
const v = theme.spacing?.[s] ?? h.bracket.cssvar.global.auto.fraction.rem(s);
|
|
202
|
+
if (v != null) {
|
|
203
|
+
return {
|
|
204
|
+
"--un-border-spacing-x": v,
|
|
205
|
+
"--un-border-spacing-y": v,
|
|
206
|
+
"border-spacing": borderSpacingProperty
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
}, { custom: custom$2, autocomplete: ["border-spacing", "border-spacing-$spacing"] }],
|
|
210
|
+
[/^border-spacing-([xy])-(.+)$/, ([, d, s], { theme }) => {
|
|
211
|
+
const v = theme.spacing?.[s] ?? h.bracket.cssvar.global.auto.fraction.rem(s);
|
|
212
|
+
if (v != null) {
|
|
213
|
+
return {
|
|
214
|
+
[`--un-border-spacing-${d}`]: v,
|
|
215
|
+
"border-spacing": borderSpacingProperty
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
}, { custom: custom$2, autocomplete: ["border-spacing-(x|y)", "border-spacing-(x|y)-$spacing"] }],
|
|
219
|
+
["caption-top", { "caption-side": "top" }],
|
|
220
|
+
["caption-bottom", { "caption-side": "bottom" }],
|
|
221
|
+
["table-auto", { "table-layout": "auto" }],
|
|
222
|
+
["table-fixed", { "table-layout": "fixed" }],
|
|
223
|
+
["table-empty-cells-visible", { "empty-cells": "show" }],
|
|
224
|
+
["table-empty-cells-hidden", { "empty-cells": "hide" }]
|
|
225
|
+
];
|
|
226
|
+
|
|
227
|
+
const touchActionBase = {
|
|
228
|
+
"--un-pan-x": varEmpty,
|
|
229
|
+
"--un-pan-y": varEmpty,
|
|
230
|
+
"--un-pinch-zoom": varEmpty
|
|
231
|
+
};
|
|
232
|
+
const custom$1 = { preflightKeys: Object.keys(touchActionBase) };
|
|
233
|
+
const touchActionProperty = "var(--un-pan-x) var(--un-pan-y) var(--un-pinch-zoom)";
|
|
234
|
+
const touchActions = [
|
|
235
|
+
[/^touch-pan-(x|left|right)$/, ([, d]) => ({
|
|
236
|
+
"--un-pan-x": `pan-${d}`,
|
|
237
|
+
"touch-action": touchActionProperty
|
|
238
|
+
}), { custom: custom$1, autocomplete: ["touch-pan", "touch-pan-(x|left|right|y|up|down)"] }],
|
|
239
|
+
[/^touch-pan-(y|up|down)$/, ([, d]) => ({
|
|
240
|
+
"--un-pan-y": `pan-${d}`,
|
|
241
|
+
"touch-action": touchActionProperty
|
|
242
|
+
}), { custom: custom$1 }],
|
|
243
|
+
["touch-pinch-zoom", {
|
|
244
|
+
"--un-pinch-zoom": "pinch-zoom",
|
|
245
|
+
"touch-action": touchActionProperty
|
|
246
|
+
}, { custom: custom$1 }],
|
|
247
|
+
["touch-auto", { "touch-action": "auto" }],
|
|
248
|
+
["touch-manipulation", { "touch-action": "manipulation" }],
|
|
249
|
+
["touch-none", { "touch-action": "none" }],
|
|
250
|
+
...makeGlobalStaticRules("touch", "touch-action")
|
|
251
|
+
];
|
|
252
|
+
|
|
253
|
+
const fontVariantNumericBase = {
|
|
254
|
+
"--un-ordinal": varEmpty,
|
|
255
|
+
"--un-slashed-zero": varEmpty,
|
|
256
|
+
"--un-numeric-figure": varEmpty,
|
|
257
|
+
"--un-numeric-spacing": varEmpty,
|
|
258
|
+
"--un-numeric-fraction": varEmpty
|
|
259
|
+
};
|
|
260
|
+
const custom = { preflightKeys: Object.keys(fontVariantNumericBase) };
|
|
261
|
+
function toEntries(entry) {
|
|
262
|
+
return {
|
|
263
|
+
...entry,
|
|
264
|
+
"font-variant-numeric": "var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)"
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
const fontVariantNumeric = [
|
|
268
|
+
[/^ordinal$/, () => toEntries({ "--un-ordinal": "ordinal" }), { custom, autocomplete: "ordinal" }],
|
|
269
|
+
[/^slashed-zero$/, () => toEntries({ "--un-slashed-zero": "slashed-zero" }), { custom, autocomplete: "slashed-zero" }],
|
|
270
|
+
[/^lining-nums$/, () => toEntries({ "--un-numeric-figure": "lining-nums" }), { custom, autocomplete: "lining-nums" }],
|
|
271
|
+
[/^oldstyle-nums$/, () => toEntries({ "--un-numeric-figure": "oldstyle-nums" }), { custom, autocomplete: "oldstyle-nums" }],
|
|
272
|
+
[/^proportional-nums$/, () => toEntries({ "--un-numeric-spacing": "proportional-nums" }), { custom, autocomplete: "proportional-nums" }],
|
|
273
|
+
[/^tabular-nums$/, () => toEntries({ "--un-numeric-spacing": "tabular-nums" }), { custom, autocomplete: "tabular-nums" }],
|
|
274
|
+
[/^diagonal-fractions$/, () => toEntries({ "--un-numeric-fraction": "diagonal-fractions" }), { custom, autocomplete: "diagonal-fractions" }],
|
|
275
|
+
[/^stacked-fractions$/, () => toEntries({ "--un-numeric-fraction": "stacked-fractions" }), { custom, autocomplete: "stacked-fractions" }],
|
|
276
|
+
["normal-nums", { "font-variant-numeric": "normal" }]
|
|
277
|
+
];
|
|
278
|
+
|
|
279
|
+
export { filters as a, backdropFilterBase as b, scrolls as c, borderSpacingBase as d, touchActionBase as e, filterBase as f, touchActions as g, fontVariantNumericBase as h, fontVariantNumeric as i, scrollSnapTypeBase as s, tables as t };
|
package/dist/theme.d.mts
ADDED