Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS custom properties(variables) not rendered correctly in libsass 3.5.2 #2620

Closed
simongcc opened this issue Mar 27, 2018 · 5 comments
Closed

Comments

@simongcc
Copy link

The sass $variable is not recognized and being output directly in the libsas 3.5.2.
Details as follow:

input.scss

$theme-primary: 0,0,0;
:root {
  --TEST: $theme-primary;

  // example use case
  // background: RGBA(var(--TEST), 0.7); // where RGBA is in capital letter as work around suggested in #2244
}

Reference: [#2244]

Actual results

libsass 3.5.2

:root {
  --TEST: $theme-primary;
}

Expected result

libsass 3.5.0.beta.2

:root {
  --TEST: 0, 0, 0;
}

version info:

$ node-sass --version
node-sass	4.8.3	(Wrapper)	[JavaScript]
libsass  	3.5.2	(Sass Compiler)	[C/C++]

Last known good version

$ node-sass --version
node-sass	4.7.2	(Wrapper)	[JavaScript]
libsass  	3.5.0.beta.2	(Sass Compiler)	[C/C++]
@xzyfer
Copy link
Contributor

xzyfer commented Mar 27, 2018

The current behaviour is correct. Sass is not allowed to evaluate the values of custom properties. The one exception is string interpolation.

:root {
  --TEST: #{$theme-primary};
}

@xzyfer xzyfer closed this as completed Mar 27, 2018
@simongcc
Copy link
Author

@xzyfer Thanks for your follow up.

@simongcc
Copy link
Author

@xzyfer After reinstalling the node-sass 4.8.3 allow again the follow behaviour which you described as "not allowed" is allowing again. I am not sure what dependency making it happening by chance.

SCSS

:root {
  --TEST: $theme-primary;
}

expected

:root {
  --TEST: $theme-primary;
}

result

:root {
  --TEST: 0, 0, 0;
}

@xzyfer
Copy link
Contributor

xzyfer commented Mar 28, 2018

Run npm ls node-sass to make sure you don't have multiple versions on node-sass in play.

@simongcc
Copy link
Author

@xzyfer I have just confirmed it is the only version installed:

yarn list v1.5.1
warning Filtering by arguments is deprecated. Please use the pattern option instead.
└─ node-sass@4.8.3

blowery added a commit to Automattic/wp-calypso that referenced this issue Jun 8, 2018
blowery added a commit to Automattic/wp-calypso that referenced this issue Jun 11, 2018
blowery added a commit to Automattic/wp-calypso that referenced this issue Jun 11, 2018
* Update to Node 10 (10.4.0) and npm 6.1.0

* pull in node-sass 4.9 which has node 10 support

* allow config as a builtin, even though it's not?

* update to fsevents 1.2.4 for node 10 support

* fixup css that broke with node-sass 4.9

This also shows a bunch of deprecation warnings that look like they'll be removed in 4.9.1.

See sass/node-sass#2362
Specifically https://github.com/sass/node-sass/issues/2362\#issuecomment-392118915

* touch node_modules after generating shrinkwrap

* use string interpolation on css variable values.

see sass/libsass#2620

* Removed "cash-touch" dependency, use instead a multi-platform NodeJS equivalent of "touch node_modules"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants