@unocss/preset-wind 0.50.6 → 0.50.8
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 +2 -57
- package/dist/index.cjs +89 -67
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +89 -67
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,64 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Tailwind / Windi CSS compact preset for [UnoCSS](https://github.com/unocss/unocss).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
> - [@unocss/preset-mini](https://github.com/antfu/unocss/tree/main/packages/preset-mini)
|
|
5
|
+
## Documentation
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
npm i -D @unocss/preset-wind
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
```ts
|
|
15
|
-
import presetWind from '@unocss/preset-wind'
|
|
16
|
-
|
|
17
|
-
UnoCSS({
|
|
18
|
-
presets: [
|
|
19
|
-
presetWind(),
|
|
20
|
-
],
|
|
21
|
-
})
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Differences from Windi CSS
|
|
25
|
-
|
|
26
|
-
### `<sm` `@lg` Variants
|
|
27
|
-
|
|
28
|
-
- `<sm:p-1` -> `lt-sm:p-1`
|
|
29
|
-
- `@lg:p-1` -> `at-lg:p-1`
|
|
30
|
-
- `>xl:p-1` -> `lg:p-1`
|
|
31
|
-
|
|
32
|
-
to have more consistent naming.
|
|
33
|
-
|
|
34
|
-
### Bracket Syntax Spaces
|
|
35
|
-
|
|
36
|
-
This preset uses `_` instead of `,` for respecting space in bracket syntax.
|
|
37
|
-
|
|
38
|
-
- `grid-cols-[1fr,10px,max-content]` -> `grid-cols-[1fr_10px_max-content]`
|
|
39
|
-
|
|
40
|
-
since some CSS rules require `,` as parts of the value, e.g. `grid-cols-[repeat(3,auto)]`
|
|
41
|
-
|
|
42
|
-
## Experimental Features
|
|
43
|
-
|
|
44
|
-
This preset includes experimental feature that may be changed in breaking ways at any time.
|
|
45
|
-
|
|
46
|
-
### Media Hover
|
|
47
|
-
|
|
48
|
-
Media hover addresses the [sticky hover](https://css-tricks.com/solving-sticky-hover-states-with-media-hover-hover/) problem where tapping target that includes hover style on mobile will persist that hover style until tapping elsewhere.
|
|
49
|
-
|
|
50
|
-
Since the regular `:hover` style most probably used so widely, the variant uses `@hover` syntax to distinguish it from the regular `hover` pseudo.
|
|
51
|
-
|
|
52
|
-
Example: `@hover-text-red`
|
|
53
|
-
|
|
54
|
-
Output:
|
|
55
|
-
```css
|
|
56
|
-
@media (hover: hover) and (pointer: fine) {
|
|
57
|
-
.\@hover-text-red:hover {
|
|
58
|
-
--un-text-opacity: 1;
|
|
59
|
-
color: rgba(248, 113, 113, var(--un-text-opacity));
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
```
|
|
7
|
+
Please refer to the [documentation](https://unocss.dev/presets/wind).
|
|
63
8
|
|
|
64
9
|
## License
|
|
65
10
|
|
package/dist/index.cjs
CHANGED
|
@@ -78,12 +78,12 @@ const animations = [
|
|
|
78
78
|
...utils.makeGlobalStaticRules("animate", "animation")
|
|
79
79
|
];
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
function bgGradientToValue(cssColor) {
|
|
82
82
|
if (cssColor)
|
|
83
83
|
return utils.colorToString(cssColor, 0);
|
|
84
84
|
return "rgba(255,255,255,0)";
|
|
85
|
-
}
|
|
86
|
-
|
|
85
|
+
}
|
|
86
|
+
function bgGradientColorValue(mode, cssColor, color, alpha) {
|
|
87
87
|
if (cssColor) {
|
|
88
88
|
if (alpha != null)
|
|
89
89
|
return utils.colorToString(cssColor, alpha);
|
|
@@ -91,33 +91,45 @@ const bgGradientColorValue = (mode, cssColor, color, alpha) => {
|
|
|
91
91
|
return utils.colorToString(cssColor, `var(--un-${mode}-opacity, ${utils.colorOpacityToString(cssColor)})`);
|
|
92
92
|
}
|
|
93
93
|
return utils.colorToString(color, alpha);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
94
|
+
}
|
|
95
|
+
function bgGradientColorResolver(mode) {
|
|
96
|
+
return ([, body], { theme }) => {
|
|
97
|
+
const data = utils.parseColor(body, theme);
|
|
98
|
+
if (!data)
|
|
99
|
+
return;
|
|
100
|
+
const { alpha, color, cssColor } = data;
|
|
101
|
+
if (!color)
|
|
102
|
+
return;
|
|
103
|
+
const colorString = bgGradientColorValue(mode, cssColor, color, alpha);
|
|
104
|
+
switch (mode) {
|
|
105
|
+
case "from":
|
|
106
|
+
return {
|
|
107
|
+
"--un-gradient-from-position": "0%",
|
|
108
|
+
"--un-gradient-from": `${colorString} var(--un-gradient-from-position)`,
|
|
109
|
+
"--un-gradient-to": `${bgGradientToValue(cssColor)} var(--un-gradient-to-position)`,
|
|
110
|
+
"--un-gradient-stops": "var(--un-gradient-from), var(--un-gradient-to)"
|
|
111
|
+
};
|
|
112
|
+
case "via":
|
|
113
|
+
return {
|
|
114
|
+
"--un-gradient-via-position": "50%",
|
|
115
|
+
"--un-gradient-to": bgGradientToValue(cssColor),
|
|
116
|
+
"--un-gradient-stops": `var(--un-gradient-from), ${colorString} var(--un-gradient-via-position), var(--un-gradient-to)`
|
|
117
|
+
};
|
|
118
|
+
case "to":
|
|
119
|
+
return {
|
|
120
|
+
"--un-gradient-to-position": "100%",
|
|
121
|
+
"--un-gradient-to": `${colorString} var(--un-gradient-to-position)`
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function bgGradientPositionResolver() {
|
|
127
|
+
return ([, mode, body]) => {
|
|
128
|
+
return {
|
|
129
|
+
[`--un-gradient-${mode}-position`]: `${Number(utils.handler.bracket.cssvar.percent(body)) * 100}%`
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
}
|
|
121
133
|
const bgUrlRE = /^\[url\(.+\)\]$/;
|
|
122
134
|
const bgLengthRE = /^\[length:.+\]$/;
|
|
123
135
|
const bgPositionRE = /^\[position:.+\]$/;
|
|
@@ -140,6 +152,7 @@ const backgroundStyles = [
|
|
|
140
152
|
[/^(?:bg-gradient-)?from-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-from-opacity": utils.handler.bracket.percent(opacity) })],
|
|
141
153
|
[/^(?:bg-gradient-)?via-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-via-opacity": utils.handler.bracket.percent(opacity) })],
|
|
142
154
|
[/^(?:bg-gradient-)?to-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-to-opacity": utils.handler.bracket.percent(opacity) })],
|
|
155
|
+
[/^(from|via|to)-([\d\.]+)%$/, bgGradientPositionResolver()],
|
|
143
156
|
[/^bg-gradient-((?:repeating-)?(?:linear|radial|conic))$/, ([, s]) => ({
|
|
144
157
|
"background-image": `${s}-gradient(var(--un-gradient, var(--un-gradient-stops, rgba(255, 255, 255, 0))))`
|
|
145
158
|
}), { autocomplete: ["bg-gradient-repeating", "bg-gradient-(linear|radial|conic)", "bg-gradient-repeating-(linear|radial|conic)"] }],
|
|
@@ -378,32 +391,34 @@ const backdropFilterBase = {
|
|
|
378
391
|
"--un-backdrop-sepia": rules$1.varEmpty
|
|
379
392
|
};
|
|
380
393
|
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)";
|
|
381
|
-
|
|
394
|
+
function percentWithDefault(str) {
|
|
382
395
|
let v = utils.handler.bracket.cssvar(str || "");
|
|
383
396
|
if (v != null)
|
|
384
397
|
return v;
|
|
385
398
|
v = str ? utils.handler.percent(str) : "1";
|
|
386
399
|
if (v != null && parseFloat(v) <= 1)
|
|
387
400
|
return v;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
if (
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
401
|
+
}
|
|
402
|
+
function toFilter(varName, resolver) {
|
|
403
|
+
return ([, b, s], { theme }) => {
|
|
404
|
+
const value = resolver(s, theme) ?? (s === "none" ? "0" : "");
|
|
405
|
+
if (value !== "") {
|
|
406
|
+
if (b) {
|
|
407
|
+
return {
|
|
408
|
+
[`--un-${b}${varName}`]: `${varName}(${value})`,
|
|
409
|
+
"-webkit-backdrop-filter": backdropFilterProperty,
|
|
410
|
+
"backdrop-filter": backdropFilterProperty
|
|
411
|
+
};
|
|
412
|
+
} else {
|
|
413
|
+
return {
|
|
414
|
+
[`--un-${varName}`]: `${varName}(${value})`,
|
|
415
|
+
filter: filterProperty
|
|
416
|
+
};
|
|
417
|
+
}
|
|
403
418
|
}
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
function dropShadowResolver([, s], { theme }) {
|
|
407
422
|
let v = theme.dropShadow?.[s || "DEFAULT"];
|
|
408
423
|
if (v != null) {
|
|
409
424
|
const shadows = utils.colorableShadows(v, "--un-drop-shadow-color");
|
|
@@ -419,7 +434,7 @@ const dropShadowResolver = ([, s], { theme }) => {
|
|
|
419
434
|
"filter": filterProperty
|
|
420
435
|
};
|
|
421
436
|
}
|
|
422
|
-
}
|
|
437
|
+
}
|
|
423
438
|
const filters = [
|
|
424
439
|
[/^(?:(backdrop-)|filter-)?blur(?:-(.+))?$/, toFilter("blur", (s, theme) => theme.blur?.[s || "DEFAULT"] || utils.handler.bracket.cssvar.px(s)), { autocomplete: ["(backdrop|filter)-blur-$blur", "blur-$blur"] }],
|
|
425
440
|
[/^(?:(backdrop-)|filter-)?brightness-(.+)$/, toFilter("brightness", (s) => utils.handler.bracket.cssvar.percent(s)), { autocomplete: ["(backdrop|filter)-brightness-<percent>", "brightness-<percent>"] }],
|
|
@@ -712,6 +727,9 @@ const lineClamps = [
|
|
|
712
727
|
"line-clamp": v
|
|
713
728
|
}), { autocomplete: ["line-clamp", "line-clamp-<num>"] }],
|
|
714
729
|
...["none", ...utils.globalKeywords].map((keyword) => [`line-clamp-${keyword}`, {
|
|
730
|
+
"overflow": "visible",
|
|
731
|
+
"display": "block",
|
|
732
|
+
"-webkit-box-orient": "horizontal",
|
|
715
733
|
"-webkit-line-clamp": keyword,
|
|
716
734
|
"line-clamp": keyword
|
|
717
735
|
}])
|
|
@@ -724,10 +742,12 @@ const fontVariantNumericBase = {
|
|
|
724
742
|
"--un-numeric-spacing": rules$1.varEmpty,
|
|
725
743
|
"--un-numeric-fraction": rules$1.varEmpty
|
|
726
744
|
};
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
745
|
+
function toEntries(entry) {
|
|
746
|
+
return {
|
|
747
|
+
...entry,
|
|
748
|
+
"font-variant-numeric": "var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)"
|
|
749
|
+
};
|
|
750
|
+
}
|
|
731
751
|
const fontVariantNumeric = [
|
|
732
752
|
[/^ordinal$/, () => toEntries({ "--un-ordinal": "ordinal" }), { autocomplete: "ordinal" }],
|
|
733
753
|
[/^slashed-zero$/, () => toEntries({ "--un-slashed-zero": "slashed-zero" }), { autocomplete: "slashed-zero" }],
|
|
@@ -1171,19 +1191,21 @@ function hasOpacityValue(body) {
|
|
|
1171
1191
|
return false;
|
|
1172
1192
|
}
|
|
1173
1193
|
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1194
|
+
function variants(options) {
|
|
1195
|
+
return [
|
|
1196
|
+
placeholderModifier,
|
|
1197
|
+
variantSpaceAndDivide,
|
|
1198
|
+
...variants$1.variants(options),
|
|
1199
|
+
...variantContrasts,
|
|
1200
|
+
...variantOrientations,
|
|
1201
|
+
...variantMotions,
|
|
1202
|
+
...variantCombinators,
|
|
1203
|
+
...variantColorsScheme,
|
|
1204
|
+
...variantStickyHover
|
|
1205
|
+
];
|
|
1206
|
+
}
|
|
1185
1207
|
|
|
1186
|
-
|
|
1208
|
+
function presetWind(options = {}) {
|
|
1187
1209
|
options.dark = options.dark ?? "class";
|
|
1188
1210
|
options.attributifyPseudo = options.attributifyPseudo ?? false;
|
|
1189
1211
|
options.preflight = options.preflight ?? true;
|
|
@@ -1199,7 +1221,7 @@ const presetWind = (options = {}) => {
|
|
|
1199
1221
|
preflights: options.preflight ? presetMini.normalizePreflights(presetMini.preflights, options.variablePrefix) : [],
|
|
1200
1222
|
prefix: options.prefix
|
|
1201
1223
|
};
|
|
1202
|
-
}
|
|
1224
|
+
}
|
|
1203
1225
|
|
|
1204
1226
|
exports.colors = presetMini.colors;
|
|
1205
1227
|
exports.preflights = presetMini.preflights;
|
package/dist/index.d.ts
CHANGED
|
@@ -10,10 +10,10 @@ declare const shortcuts: _unocss_core.Shortcut<_unocss_preset_mini.Theme>[];
|
|
|
10
10
|
|
|
11
11
|
declare const theme: Theme;
|
|
12
12
|
|
|
13
|
-
declare
|
|
13
|
+
declare function variants(options: PresetWindOptions): Variant<Theme>[];
|
|
14
14
|
|
|
15
15
|
interface PresetWindOptions extends PresetMiniOptions {
|
|
16
16
|
}
|
|
17
|
-
declare
|
|
17
|
+
declare function presetWind(options?: PresetWindOptions): Preset<Theme>;
|
|
18
18
|
|
|
19
19
|
export { PresetWindOptions, presetWind as default, presetWind, rules, shortcuts, theme, variants };
|
package/dist/index.mjs
CHANGED
|
@@ -75,12 +75,12 @@ const animations = [
|
|
|
75
75
|
...makeGlobalStaticRules("animate", "animation")
|
|
76
76
|
];
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
function bgGradientToValue(cssColor) {
|
|
79
79
|
if (cssColor)
|
|
80
80
|
return colorToString(cssColor, 0);
|
|
81
81
|
return "rgba(255,255,255,0)";
|
|
82
|
-
}
|
|
83
|
-
|
|
82
|
+
}
|
|
83
|
+
function bgGradientColorValue(mode, cssColor, color, alpha) {
|
|
84
84
|
if (cssColor) {
|
|
85
85
|
if (alpha != null)
|
|
86
86
|
return colorToString(cssColor, alpha);
|
|
@@ -88,33 +88,45 @@ const bgGradientColorValue = (mode, cssColor, color, alpha) => {
|
|
|
88
88
|
return colorToString(cssColor, `var(--un-${mode}-opacity, ${colorOpacityToString(cssColor)})`);
|
|
89
89
|
}
|
|
90
90
|
return colorToString(color, alpha);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
91
|
+
}
|
|
92
|
+
function bgGradientColorResolver(mode) {
|
|
93
|
+
return ([, body], { theme }) => {
|
|
94
|
+
const data = parseColor(body, theme);
|
|
95
|
+
if (!data)
|
|
96
|
+
return;
|
|
97
|
+
const { alpha, color, cssColor } = data;
|
|
98
|
+
if (!color)
|
|
99
|
+
return;
|
|
100
|
+
const colorString = bgGradientColorValue(mode, cssColor, color, alpha);
|
|
101
|
+
switch (mode) {
|
|
102
|
+
case "from":
|
|
103
|
+
return {
|
|
104
|
+
"--un-gradient-from-position": "0%",
|
|
105
|
+
"--un-gradient-from": `${colorString} var(--un-gradient-from-position)`,
|
|
106
|
+
"--un-gradient-to": `${bgGradientToValue(cssColor)} var(--un-gradient-to-position)`,
|
|
107
|
+
"--un-gradient-stops": "var(--un-gradient-from), var(--un-gradient-to)"
|
|
108
|
+
};
|
|
109
|
+
case "via":
|
|
110
|
+
return {
|
|
111
|
+
"--un-gradient-via-position": "50%",
|
|
112
|
+
"--un-gradient-to": bgGradientToValue(cssColor),
|
|
113
|
+
"--un-gradient-stops": `var(--un-gradient-from), ${colorString} var(--un-gradient-via-position), var(--un-gradient-to)`
|
|
114
|
+
};
|
|
115
|
+
case "to":
|
|
116
|
+
return {
|
|
117
|
+
"--un-gradient-to-position": "100%",
|
|
118
|
+
"--un-gradient-to": `${colorString} var(--un-gradient-to-position)`
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function bgGradientPositionResolver() {
|
|
124
|
+
return ([, mode, body]) => {
|
|
125
|
+
return {
|
|
126
|
+
[`--un-gradient-${mode}-position`]: `${Number(handler.bracket.cssvar.percent(body)) * 100}%`
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
}
|
|
118
130
|
const bgUrlRE = /^\[url\(.+\)\]$/;
|
|
119
131
|
const bgLengthRE = /^\[length:.+\]$/;
|
|
120
132
|
const bgPositionRE = /^\[position:.+\]$/;
|
|
@@ -137,6 +149,7 @@ const backgroundStyles = [
|
|
|
137
149
|
[/^(?:bg-gradient-)?from-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-from-opacity": handler.bracket.percent(opacity) })],
|
|
138
150
|
[/^(?:bg-gradient-)?via-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-via-opacity": handler.bracket.percent(opacity) })],
|
|
139
151
|
[/^(?:bg-gradient-)?to-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-to-opacity": handler.bracket.percent(opacity) })],
|
|
152
|
+
[/^(from|via|to)-([\d\.]+)%$/, bgGradientPositionResolver()],
|
|
140
153
|
[/^bg-gradient-((?:repeating-)?(?:linear|radial|conic))$/, ([, s]) => ({
|
|
141
154
|
"background-image": `${s}-gradient(var(--un-gradient, var(--un-gradient-stops, rgba(255, 255, 255, 0))))`
|
|
142
155
|
}), { autocomplete: ["bg-gradient-repeating", "bg-gradient-(linear|radial|conic)", "bg-gradient-repeating-(linear|radial|conic)"] }],
|
|
@@ -375,32 +388,34 @@ const backdropFilterBase = {
|
|
|
375
388
|
"--un-backdrop-sepia": varEmpty
|
|
376
389
|
};
|
|
377
390
|
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)";
|
|
378
|
-
|
|
391
|
+
function percentWithDefault(str) {
|
|
379
392
|
let v = handler.bracket.cssvar(str || "");
|
|
380
393
|
if (v != null)
|
|
381
394
|
return v;
|
|
382
395
|
v = str ? handler.percent(str) : "1";
|
|
383
396
|
if (v != null && parseFloat(v) <= 1)
|
|
384
397
|
return v;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
if (
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
398
|
+
}
|
|
399
|
+
function toFilter(varName, resolver) {
|
|
400
|
+
return ([, b, s], { theme }) => {
|
|
401
|
+
const value = resolver(s, theme) ?? (s === "none" ? "0" : "");
|
|
402
|
+
if (value !== "") {
|
|
403
|
+
if (b) {
|
|
404
|
+
return {
|
|
405
|
+
[`--un-${b}${varName}`]: `${varName}(${value})`,
|
|
406
|
+
"-webkit-backdrop-filter": backdropFilterProperty,
|
|
407
|
+
"backdrop-filter": backdropFilterProperty
|
|
408
|
+
};
|
|
409
|
+
} else {
|
|
410
|
+
return {
|
|
411
|
+
[`--un-${varName}`]: `${varName}(${value})`,
|
|
412
|
+
filter: filterProperty
|
|
413
|
+
};
|
|
414
|
+
}
|
|
400
415
|
}
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
function dropShadowResolver([, s], { theme }) {
|
|
404
419
|
let v = theme.dropShadow?.[s || "DEFAULT"];
|
|
405
420
|
if (v != null) {
|
|
406
421
|
const shadows = colorableShadows(v, "--un-drop-shadow-color");
|
|
@@ -416,7 +431,7 @@ const dropShadowResolver = ([, s], { theme }) => {
|
|
|
416
431
|
"filter": filterProperty
|
|
417
432
|
};
|
|
418
433
|
}
|
|
419
|
-
}
|
|
434
|
+
}
|
|
420
435
|
const filters = [
|
|
421
436
|
[/^(?:(backdrop-)|filter-)?blur(?:-(.+))?$/, toFilter("blur", (s, theme) => theme.blur?.[s || "DEFAULT"] || handler.bracket.cssvar.px(s)), { autocomplete: ["(backdrop|filter)-blur-$blur", "blur-$blur"] }],
|
|
422
437
|
[/^(?:(backdrop-)|filter-)?brightness-(.+)$/, toFilter("brightness", (s) => handler.bracket.cssvar.percent(s)), { autocomplete: ["(backdrop|filter)-brightness-<percent>", "brightness-<percent>"] }],
|
|
@@ -709,6 +724,9 @@ const lineClamps = [
|
|
|
709
724
|
"line-clamp": v
|
|
710
725
|
}), { autocomplete: ["line-clamp", "line-clamp-<num>"] }],
|
|
711
726
|
...["none", ...globalKeywords].map((keyword) => [`line-clamp-${keyword}`, {
|
|
727
|
+
"overflow": "visible",
|
|
728
|
+
"display": "block",
|
|
729
|
+
"-webkit-box-orient": "horizontal",
|
|
712
730
|
"-webkit-line-clamp": keyword,
|
|
713
731
|
"line-clamp": keyword
|
|
714
732
|
}])
|
|
@@ -721,10 +739,12 @@ const fontVariantNumericBase = {
|
|
|
721
739
|
"--un-numeric-spacing": varEmpty,
|
|
722
740
|
"--un-numeric-fraction": varEmpty
|
|
723
741
|
};
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
742
|
+
function toEntries(entry) {
|
|
743
|
+
return {
|
|
744
|
+
...entry,
|
|
745
|
+
"font-variant-numeric": "var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)"
|
|
746
|
+
};
|
|
747
|
+
}
|
|
728
748
|
const fontVariantNumeric = [
|
|
729
749
|
[/^ordinal$/, () => toEntries({ "--un-ordinal": "ordinal" }), { autocomplete: "ordinal" }],
|
|
730
750
|
[/^slashed-zero$/, () => toEntries({ "--un-slashed-zero": "slashed-zero" }), { autocomplete: "slashed-zero" }],
|
|
@@ -1168,19 +1188,21 @@ function hasOpacityValue(body) {
|
|
|
1168
1188
|
return false;
|
|
1169
1189
|
}
|
|
1170
1190
|
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1191
|
+
function variants(options) {
|
|
1192
|
+
return [
|
|
1193
|
+
placeholderModifier,
|
|
1194
|
+
variantSpaceAndDivide,
|
|
1195
|
+
...variants$1(options),
|
|
1196
|
+
...variantContrasts,
|
|
1197
|
+
...variantOrientations,
|
|
1198
|
+
...variantMotions,
|
|
1199
|
+
...variantCombinators,
|
|
1200
|
+
...variantColorsScheme,
|
|
1201
|
+
...variantStickyHover
|
|
1202
|
+
];
|
|
1203
|
+
}
|
|
1182
1204
|
|
|
1183
|
-
|
|
1205
|
+
function presetWind(options = {}) {
|
|
1184
1206
|
options.dark = options.dark ?? "class";
|
|
1185
1207
|
options.attributifyPseudo = options.attributifyPseudo ?? false;
|
|
1186
1208
|
options.preflight = options.preflight ?? true;
|
|
@@ -1196,6 +1218,6 @@ const presetWind = (options = {}) => {
|
|
|
1196
1218
|
preflights: options.preflight ? normalizePreflights(preflights, options.variablePrefix) : [],
|
|
1197
1219
|
prefix: options.prefix
|
|
1198
1220
|
};
|
|
1199
|
-
}
|
|
1221
|
+
}
|
|
1200
1222
|
|
|
1201
1223
|
export { presetWind as default, presetWind, rules, shortcuts, theme, variants };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-wind",
|
|
3
|
-
"version": "0.50.
|
|
3
|
+
"version": "0.50.8",
|
|
4
4
|
"description": "Tailwind / Windi CSS compact preset for UnoCSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"*.css"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@unocss/core": "0.50.
|
|
39
|
-
"@unocss/preset-mini": "0.50.
|
|
38
|
+
"@unocss/core": "0.50.8",
|
|
39
|
+
"@unocss/preset-mini": "0.50.8"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "unbuild",
|