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

$variables are no more replaced where they're used #11

Closed
thepra opened this issue Nov 15, 2021 · 2 comments
Closed

$variables are no more replaced where they're used #11

thepra opened this issue Nov 15, 2021 · 2 comments

Comments

@thepra
Copy link

thepra commented Nov 15, 2021

Installed product versions

  • Visual Studio: 2022
  • This extension: 1.12.405

Description

The dollar variables are no more replaced anywhere in a .scss file, breaking up everything in the pipeline.
(I'm using the NuGet package, at compilation time the WebCompiler is triggered.)

Steps to recreate

  1. Setup the code like this in variables.scss:
$main-pc: hsl(25,84,88); //#fbe9d7;

:root {
	--background: $main-pc;
}
  1. Compile with this setup, where main.scss does @import of variables.scss:
[
	{
		"outputFile": "wwwroot/css/my-style.css",
		"inputFile": "SCSS/main.scss"
	}
]
  1. Check the my-style.css output to find this:
:root {
	--background: $main-pc;
}

Current behavior

It doesn't apply the dollar variables.

Expected behavior

It should apply the dollars variable value.

@failwyn
Copy link
Owner

failwyn commented Nov 15, 2021

This looks like a duplicate of #4, can you confirm that this fixed your issue.

-- Comment copied from #4 --
It looks like this was caused by a change to node-sass

sass/node-sass#2627
sass/libsass#2621
https://sass-lang.com/documentation/style-rules/declarations#custom-properties

Can you try the following and let me know if it works?

$var-name: green;
p {
--my-custom-color: #{$var-name};
}

@thepra
Copy link
Author

thepra commented Nov 15, 2021

Yep, this way it does work... Be damned those who changed this syntax!

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