Skip to content

Commit 43de732

Browse files
committed
Add variable fallback to fix Chrome issue
1 parent 4de0769 commit 43de732

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/util/removeAlphaVariables.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ export function removeAlphaVariables(container, toRemove) {
1919
if (decl.value.includes(`/ var(${varName})`)) {
2020
decl.value = decl.value.replace(`/ var(${varName})`, '')
2121
}
22+
23+
if (decl.value.includes(`/ var(${varName},1)`)) {
24+
decl.value = decl.value.replace(`/ var(${varName},1)`, '')
25+
}
2226
}
2327
})
2428
}

src/util/withAlphaVariable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default function withAlphaVariable({ color, property, variable }) {
4242
[variable]: '1',
4343
...Object.fromEntries(
4444
properties.map((p) => {
45-
return [p, formatColor({ ...parsed, alpha: `var(${variable})` })]
45+
return [p, formatColor({ ...parsed, alpha: `var(${variable},1)` })]
4646
})
4747
),
4848
}

0 commit comments

Comments
 (0)