S
S
SidneyMur2020-05-11 23:43:10
css
SidneyMur, 2020-05-11 23:43:10

How to change SCSS variables with JS?

Here's the thing,
Let's say there are variables in SCSS(SASS):
$color-text:#a52626;
$background-set:url(../IMG/fon_in.jpg);
And in JS:
let color = '#0e12ac'

All you need is for the script to perform magic and as a result, the value of the $color-text variable is replaced with the value of color

It seems like I know what is possible, but I did not find a way, help guys out

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WapSter, 2020-05-11
@SidneyMur

It seems like I know what is possible, but I did not find a way
No. SCSS compiles to CSS. Use native variables Updating a CSS Variable with JavaScript

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question