marcoarib
marcoarib

Reputation: 43

CSS variable receiving a value from SASS function

Is there a way to assign a value from a SASS function on a CSS variable?

I tried different things like:

--color: lighten(blue, 10%); // from a simple color

--color: lighten(var(--blue), 10%); // from another CSS variable

--color: lighten(#{$blue}, 10%); // from a SASS variable

--color: #{lighten(blue, 10%)}; // all function inside an interpolation

Nothing works.

Thanks.

Upvotes: 1

Views: 173

Answers (1)

marcoarib
marcoarib

Reputation: 43

It works with:

--color: #{lighten(blue, 10%)};

or

--color: #{lighten($blue, 10%)};

Upvotes: 1

Related Questions