@unocss/preset-wind 0.50.7 → 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/dist/index.cjs +15 -4
- package/dist/index.mjs +15 -4
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -104,22 +104,32 @@ function bgGradientColorResolver(mode) {
|
|
|
104
104
|
switch (mode) {
|
|
105
105
|
case "from":
|
|
106
106
|
return {
|
|
107
|
-
"--un-gradient-from":
|
|
108
|
-
"--un-gradient-
|
|
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)`,
|
|
109
110
|
"--un-gradient-stops": "var(--un-gradient-from), var(--un-gradient-to)"
|
|
110
111
|
};
|
|
111
112
|
case "via":
|
|
112
113
|
return {
|
|
114
|
+
"--un-gradient-via-position": "50%",
|
|
113
115
|
"--un-gradient-to": bgGradientToValue(cssColor),
|
|
114
|
-
"--un-gradient-stops": `var(--un-gradient-from), ${colorString}, var(--un-gradient-to)`
|
|
116
|
+
"--un-gradient-stops": `var(--un-gradient-from), ${colorString} var(--un-gradient-via-position), var(--un-gradient-to)`
|
|
115
117
|
};
|
|
116
118
|
case "to":
|
|
117
119
|
return {
|
|
118
|
-
"--un-gradient-to":
|
|
120
|
+
"--un-gradient-to-position": "100%",
|
|
121
|
+
"--un-gradient-to": `${colorString} var(--un-gradient-to-position)`
|
|
119
122
|
};
|
|
120
123
|
}
|
|
121
124
|
};
|
|
122
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
|
+
}
|
|
123
133
|
const bgUrlRE = /^\[url\(.+\)\]$/;
|
|
124
134
|
const bgLengthRE = /^\[length:.+\]$/;
|
|
125
135
|
const bgPositionRE = /^\[position:.+\]$/;
|
|
@@ -142,6 +152,7 @@ const backgroundStyles = [
|
|
|
142
152
|
[/^(?:bg-gradient-)?from-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-from-opacity": utils.handler.bracket.percent(opacity) })],
|
|
143
153
|
[/^(?:bg-gradient-)?via-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-via-opacity": utils.handler.bracket.percent(opacity) })],
|
|
144
154
|
[/^(?:bg-gradient-)?to-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-to-opacity": utils.handler.bracket.percent(opacity) })],
|
|
155
|
+
[/^(from|via|to)-([\d\.]+)%$/, bgGradientPositionResolver()],
|
|
145
156
|
[/^bg-gradient-((?:repeating-)?(?:linear|radial|conic))$/, ([, s]) => ({
|
|
146
157
|
"background-image": `${s}-gradient(var(--un-gradient, var(--un-gradient-stops, rgba(255, 255, 255, 0))))`
|
|
147
158
|
}), { autocomplete: ["bg-gradient-repeating", "bg-gradient-(linear|radial|conic)", "bg-gradient-repeating-(linear|radial|conic)"] }],
|
package/dist/index.mjs
CHANGED
|
@@ -101,22 +101,32 @@ function bgGradientColorResolver(mode) {
|
|
|
101
101
|
switch (mode) {
|
|
102
102
|
case "from":
|
|
103
103
|
return {
|
|
104
|
-
"--un-gradient-from":
|
|
105
|
-
"--un-gradient-
|
|
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)`,
|
|
106
107
|
"--un-gradient-stops": "var(--un-gradient-from), var(--un-gradient-to)"
|
|
107
108
|
};
|
|
108
109
|
case "via":
|
|
109
110
|
return {
|
|
111
|
+
"--un-gradient-via-position": "50%",
|
|
110
112
|
"--un-gradient-to": bgGradientToValue(cssColor),
|
|
111
|
-
"--un-gradient-stops": `var(--un-gradient-from), ${colorString}, var(--un-gradient-to)`
|
|
113
|
+
"--un-gradient-stops": `var(--un-gradient-from), ${colorString} var(--un-gradient-via-position), var(--un-gradient-to)`
|
|
112
114
|
};
|
|
113
115
|
case "to":
|
|
114
116
|
return {
|
|
115
|
-
"--un-gradient-to":
|
|
117
|
+
"--un-gradient-to-position": "100%",
|
|
118
|
+
"--un-gradient-to": `${colorString} var(--un-gradient-to-position)`
|
|
116
119
|
};
|
|
117
120
|
}
|
|
118
121
|
};
|
|
119
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
|
+
}
|
|
120
130
|
const bgUrlRE = /^\[url\(.+\)\]$/;
|
|
121
131
|
const bgLengthRE = /^\[length:.+\]$/;
|
|
122
132
|
const bgPositionRE = /^\[position:.+\]$/;
|
|
@@ -139,6 +149,7 @@ const backgroundStyles = [
|
|
|
139
149
|
[/^(?:bg-gradient-)?from-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-from-opacity": handler.bracket.percent(opacity) })],
|
|
140
150
|
[/^(?:bg-gradient-)?via-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-via-opacity": handler.bracket.percent(opacity) })],
|
|
141
151
|
[/^(?:bg-gradient-)?to-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-to-opacity": handler.bracket.percent(opacity) })],
|
|
152
|
+
[/^(from|via|to)-([\d\.]+)%$/, bgGradientPositionResolver()],
|
|
142
153
|
[/^bg-gradient-((?:repeating-)?(?:linear|radial|conic))$/, ([, s]) => ({
|
|
143
154
|
"background-image": `${s}-gradient(var(--un-gradient, var(--un-gradient-stops, rgba(255, 255, 255, 0))))`
|
|
144
155
|
}), { autocomplete: ["bg-gradient-repeating", "bg-gradient-(linear|radial|conic)", "bg-gradient-repeating-(linear|radial|conic)"] }],
|
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",
|