Open whidy opened 6 years ago
@whidy while there is no fix for this bug, you can try to set the variable's value to a component selector like:
.component {
$c: .component;
&__card {
&:hover $(c)__name {
...
}
}
}
or
$c: .component;
$(c) {
&__card {
&:hover $(c)__name {
...
}
}
}
To quote the postcss advanced variables
readme:
*Note: To use #{$var-name} without issues, you will need to include the PostCSS SCSS Syntax.
Meaning you will have to add PostCSS SCSS Syntax to your pipeline for this to work properly.
If your issue persists it likely belongs to postcss-advanced-variables or /postcss-scss instead. :)
I have tried many times to resolve code like this below correctly,
But, it never works well, precss 2.0.0 would throw an error:
Then I tried upgrade precss 3.1.0, it works, but not well.
Which I expect result should be like this:
You can also try that sass code compile online http://sass.js.org/.
But truely result is below:
Is it a bug? And how to solute the problem?