This works in LESS:
.block {
&--modifer1 {
background: red;
}
&--modifier2 {
background: blue;
}
// If block has both modifiers
&--modifer&--modifier2 {
background: orange;
}
}
And the last selector becomes (as expected);
.block--modifer.block--modifier2 {
background: orange;
}
Can be tried here:
http://winless.org/online-less-compiler
But the same code does not work for Sass, which can be tried here:
Instead you get the error:
Invalid CSS after "&--modifer": expected "{", was "&--modifier2"
"&--modifier2" may only be used at the beginning of a compound selector.
How do you write this simple example with Sass?