Reputation: 31
I am trying to write something like this :
@mixin variableChild($child:".theChild") {
//some css
$child {
//css specific to the child
}
}
#parent { @include variableChild(".specificChild"); };
So it would generate this CSS :
#parent {//some css}
#parent .specificChild {
//css specific to the child
}
Upvotes: 1
Views: 1964
Reputation: 2049
You were almost right, you just missed the #{}
around your child selector I think. There’s more information about it in the Sass documentation.
@mixin variableChild($child:".theChild") {
#{$child} {
color: red;
}
}
#parent {
@include variableChild(".specificChild");
};
Upvotes: 7