A
A
Artur2020-07-21 15:16:40
css
Artur, 2020-07-21 15:16:40

How to pass number with CSS variable to Sass mixin?

How to pass a number from the markup using a css variable to make the mixin work?
codepen.io

If you debug, then var(--data) comes into the mixin, not a number. How can you fix it?
@include draw-progress(var(--data), $pie-color)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-07-21
@Seasle

But no way. CSS variables cannot be converted into SASS variables - they are executed in different contexts. And you can change a SASS variable into a CSS variable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question