Skip to content

Commit 1640305

Browse files
committed
add workaround to prevent some CSS minifiers from reducing 0% color-mix values to invalid 0 values
1 parent 6d28a84 commit 1640305

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/common/scss/_color-functions.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@
8686
* Created to replace them easily for CSS custom properties.
8787
*/
8888
@function eccgui-color-rgba($color, $alpha) {
89-
@return eccgui-color-mix($color 100% * $alpha, transparent);
89+
@if $alpha > 0 {
90+
@return eccgui-color-mix($color 100% * $alpha, transparent);
91+
} @else {
92+
// workaround: we need to prevent `0%` because it will reduced to `0` by some CSS minifiers and leads to invalid color-mix values
93+
@return eccgui-color-mix($color, transparent 100%);
94+
}
9095
}
9196

9297
$debug-rgba-values: "yes";

0 commit comments

Comments
 (0)