Linked Questions

Popular Questions

How to use value returned from Contrast() in Mix()

Asked by At

I am currently migrating from less to sass and I have below code converted from one less file to scss.

$white: #FFF;
$black: #000;
$gray: #CCCCCC;

$modal-destroy-btn-bg: mix(contrast($gray, $black, $white, 50%),$white,50%);

When I compile this code, I am getting error "Error: $color1: "contrast(#FFF, #000, CCCCCC, 50%)" is not a color for `mix'".

I have looked around for a while and came to know that contrast() will be returning the filter value so I am thinking that above code will not work because mix() expects different values. I am not sure whether this was worked in less or not as that is legacy code. So my question here is is there a way to make this work? Thanks in Advance!

Related Questions