I have a map generator that add a post particle:
@mixin generator {
@each $key, $value in $config {
$infix: '\@#{$key}' !global;
@content
}
}
I used the mixin above in multiple situations to add the particle at the end, like:
.y- {
@include generator {
&-n#{$infix} {
display: none !important;
}
&-in#{$infix} {
display: inline !important;
}
}
}
I get the following error:
Invalid CSS after "&-none": expected selector, was "@"\n
What I want to have is:
.y-n@key_name1{
display: none !important;
}
.y-n@key_name2{
display: none !important;
}
This appears only when I us \@
.
I can add it this particle when I create the class, but like I said I want to use it in multiple situations and to variate the particle base on conditions, so I need to be in mixin.