How to use scss variables to declare variables in css?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
19 views
Use webpack to build.

Trying to collect:
$bg-color: green; body { --background-color: $bg-color; background-color: $bg-color; }


Get:
body { --background-color: $bg-color; background-color: green; }


As you can see one of the usages of the variable $bg-color; remained in place.
How to fix?

webpack 4.6.0
node-sass version "4.9.0"
sass-graph version "2.2.4"
sass-loader version "7.0.1"
by | 19 views

1 Answer

0 like 0 dislike
body { --background-color: #{$bg-color}; background-color: $bg-color; }
by

Related questions

0 like 0 dislike
3 answers
asked Apr 24, 2019 by Olivoin
0 like 0 dislike
1 answer
asked Apr 13, 2019 by mufenman
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
asked May 11, 2019 by andrew_answer
0 like 0 dislike
4 answers
asked Apr 12, 2019 by maestro07
110,608 questions
257,187 answers
0 comments
40,796 users