Closed naftulikay closed 7 months ago
See https://sass-lang.com/documentation/style-rules/declarations/#custom-properties
You need interpolation. e.g.
$black: #1a1a1a;
$white: #f2f2f2;
html[data-theme=light] body {
--text-color: #{$white};
--background-color: #{$black};
}
I'm on Linux/x64 with
sass
version1.72.0
, and I can also replicate this error on the playground.Here is my source in SCSS:
I'm using Sass variables for
$white
and$black
, and runtime CSS variables--text-color
and--background-color
to change the text/background color for a simple dark/light theme system.The output of the above is this:
Is there something I'm missing here? I know the difference between Sass variables and CSS variables, but I'm not sure why it's producing this output, which is not valid CSS and does not work.