You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 24, 2024. It is now read-only.
I was having a hard time getting some CSS Custom Properties (CSS variables) to take on some hex values that I was holding in some SCSS vars, after updating a number of libraries in my project.
What was odd was that the following code was working fine:
$foo: #ccc;
html, body {
background: $foo;
}
In the browser's dev tools I would see: background: #ccc; and the background would be grey, as expected.
But this code didn't work:
$foo: #ccc;
html {
--my-grey-color: $foo;
}
Oddly enough in the browser dev tools, I'd then see --my-grey-color: $foo, w/o the SCSS variable's value interpolated.
I tried wrapping the variable reference in #{} and bingo it worked!
So here's my question.... while I'm glad I finally have a way forward, and thankful for that comment on that thread.... Why is it that the #{} is needed only when trying to interpolate values for CSS Custom Properties, but seems to be working just fine for others?