node-sass icon indicating copy to clipboard operation
node-sass copied to clipboard

CSS variables mixed with SCSS variables don't emit proper CSS in 4.8+

Open nolanlawson opened this issue 8 years ago • 3 comments

// styles.scss
$theme-color: #177380;
body {
  --theme-color: $theme-color;
}

Run:

node-sass styles.scss

Output in 4.7.4 (expected):

body {
  --theme-color: #177380; }

Output in 4.8.1-4.8.3:

body {
  --theme-color: $theme-color; }
$ npm -v
5.6.0
$ node -v
v9.11.1

nolanlawson avatar Apr 19 '18 02:04 nolanlawson

Please search issue before opening a new one.

body {
  --theme-color: #{$theme-color}; }

The old behaviour was a bug that violated the Sass language spec.

xzyfer avatar Apr 19 '18 03:04 xzyfer

Thanks, apologies for not finding the existing issue!

nolanlawson avatar Apr 19 '18 03:04 nolanlawson

Please search issue before opening a new one.

body {
  --theme-color: #{$theme-color}; }

The old behaviour was a bug that violated the Sass language spec.

Still not working for me

akshaykhanna avatar Mar 18 '22 09:03 akshaykhanna