I have a variable which have empty string as default value and it can be changed dynamically based on skin name. So I tried to write my sass selector like this.
default.scss:
$skin: '';
green.scss:
$skin: 'green';
main.scss:
@import 'default.scss';
.#{$skin} .header{
color: black;
}
So I expected the below output from generated CSS.
.header{
color: black;
}
and
.green .header{
color: black;
}
But it throws below error while compiling Invalid CSS after ".": expected class name, was ".header"
$skin
is empty your output is. .header
so you could move the dot inside the variable – Fabrizio Calderan