Reputation: 908
.rule{
&-first.&-second{
/*rules*/
}
}
Generates error "Invalid CSS..."
.rule-first.rule-second{
/*rules*/
}
Can it be done? How?
Upvotes: 4
Views: 2394
Reputation: 8651
You can do this with @at-root
and interpolation. You will need to be using a version of SASS that supports those features.
.rule {
@at-root #{&}-first#{&}-second{
/*rules*/
}
}
Outputs to:
.rule-first.rule-second {
/*rules*/
}
Demo: http://sassmeister.com/gist/f7f9e25a0896e47e0adc
Upvotes: 6