I try to understand BEVM+SCSS philosophy.
I don't know how to extend V
from BE
in this case.
What I want to achieve:
.block {
&__element {
background-color: black;
&--variation-a {
@extend &__element; //won't work
color: red;
}
&--variation-b {
@extend &__element; //won't work
color: green;
}
}
}
What I want to avoid:
.block {
&__element {
background-color: black;
&--variation-a {
@extend .block__element; //work but ugly
color: red;
}
&--variation-b {
@extend .block__element; //work but ugly
color: green;
}
}
}
The only way I've found it's to have a kind of %element { ... }
aside and extends from it, but it's not exactly what I want.