Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

$variable in a comment block #138

Open
achavazza opened this issue Jan 16, 2018 · 3 comments
Open

$variable in a comment block #138

achavazza opened this issue Jan 16, 2018 · 3 comments

Comments

@achavazza
Copy link

achavazza commented Jan 16, 2018

I'm getting a kind of weird error:

Error: Undefined variable "$color"

/*
$color is a variable inside a comment block
*/

So yeah, IS undefined thats why it's in a comment...
There is a way to force ignore comments?

@achavazza
Copy link
Author

Im sorry. I didn't know that /* / comments were processed too
I had replace /
*/ to // comments
hideous, but works!

@dperolio
Copy link

dperolio commented Jan 17, 2018

@achavazza Surprised you're getting an error there. You want it to display literally '$color'? It looks that way, so it should work as is I think. If you have $color defined before the comment and want it's value in the comment in place of $color, you can use #{$color}. You should only be getting that error if you put #{$color} in the comment and didn't define $color beforehand. EDIT: Ah, seems to depend on the compiler. Older ones seem to give that error.

@armin-pfaeffle
Copy link
Owner

armin-pfaeffle commented Jan 18, 2018

Hey! Well, my package has no compiler itself. It uses node-sass for compilation.

I tested the following code and everything works as expected:

/*
$color is a variable inside a comment block
*/

Please ensure that you use the latest version of node-sass and check this again! Did an update fix your problem?

This is my node-sass --version output:

node-sass       4.5.3   (Wrapper)       [JavaScript]
libsass         3.5.0.beta.2    (Sass Compiler) [C/C++]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants