@unocss/preset-wind 0.20.1 → 0.20.2

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 CHANGED
@@ -38,18 +38,15 @@ const bgGradientColorResolver = (mode) => ([, body], { theme }) => {
38
38
  const data = utils.parseColor(body, theme);
39
39
  if (!data)
40
40
  return;
41
- const { opacity, color, rgba } = data;
41
+ const { alpha, color, rgba } = data;
42
42
  if (!color)
43
43
  return;
44
44
  let colorString = color;
45
45
  if (rgba) {
46
- const a = opacity ? opacity[0] === "[" ? utils.handler.bracket.percent(opacity) : parseFloat(opacity) / 100 : rgba[3];
47
- if (a != null && !Number.isNaN(a)) {
48
- rgba[3] = typeof a === "string" && !a.includes("%") ? parseFloat(a) : a;
46
+ if (alpha != null)
49
47
  colorString = `rgba(${rgba.join(",")})`;
50
- } else {
51
- colorString = `rgba(${rgba.slice(0, 3).join(",")}, var(--un-${mode}-opacity, 1))`;
52
- }
48
+ else
49
+ colorString = `rgba(${rgba.join(",")}, var(--un-${mode}-opacity, 1))`;
53
50
  }
54
51
  switch (mode) {
55
52
  case "from":
package/dist/index.mjs CHANGED
@@ -34,18 +34,15 @@ const bgGradientColorResolver = (mode) => ([, body], { theme }) => {
34
34
  const data = parseColor(body, theme);
35
35
  if (!data)
36
36
  return;
37
- const { opacity, color, rgba } = data;
37
+ const { alpha, color, rgba } = data;
38
38
  if (!color)
39
39
  return;
40
40
  let colorString = color;
41
41
  if (rgba) {
42
- const a = opacity ? opacity[0] === "[" ? handler.bracket.percent(opacity) : parseFloat(opacity) / 100 : rgba[3];
43
- if (a != null && !Number.isNaN(a)) {
44
- rgba[3] = typeof a === "string" && !a.includes("%") ? parseFloat(a) : a;
42
+ if (alpha != null)
45
43
  colorString = `rgba(${rgba.join(",")})`;
46
- } else {
47
- colorString = `rgba(${rgba.slice(0, 3).join(",")}, var(--un-${mode}-opacity, 1))`;
48
- }
44
+ else
45
+ colorString = `rgba(${rgba.join(",")}, var(--un-${mode}-opacity, 1))`;
49
46
  }
50
47
  switch (mode) {
51
48
  case "from":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-wind",
3
- "version": "0.20.1",
3
+ "version": "0.20.2",
4
4
  "description": "Tailwind / Windi CSS compact preset for UnoCSS",
5
5
  "keywords": [
6
6
  "unocss",
@@ -35,8 +35,8 @@
35
35
  "*.css"
36
36
  ],
37
37
  "dependencies": {
38
- "@unocss/core": "0.20.1",
39
- "@unocss/preset-mini": "0.20.1"
38
+ "@unocss/core": "0.20.2",
39
+ "@unocss/preset-mini": "0.20.2"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "unbuild",