Consider killing "anti-pattern" warning
Writing modular/BEM CSS can sometimes lead to this "anti-pattern" warning, when in fact it is perfectly logical.
In this example, we're extending .Component, even though it hasn't yet had any styles attached to it. Though it may, and we would want them once we added.
.Component--modifier {…}
.Component-descendant {…}
…
.ClonedComponent {
@extend .Component;
@extend .Component--modifier;
}
I think either totally removing the warning and putting something in the readme would suffice, otherwise maybe a setting to silence it.
Going to make a pass at getting it to behave with BEM, but more than likely it will be silenced.
At current, appears to be extending empty classes without complaint, no guarantee on the rest of BEM.
For those coming here trying to clear up this warning, note that it will be thrown if there are subsequent declarations of the original extended class after @extend is used.
Easier to see the example than read the sentence above:
.column {
width: calc(100% - 4rem);
max-width: 70rem;
margin: 0 auto;
}
.column--wide {
@extend .column;
max-width: 110rem;
}
.column--narrow {
@extend .column;
max-width: 45rem;
}
.column.with-aside {
width: calc(100% - 20rem);
}
(This is also bad BEM, you'd probably want to replace the compound selector .column.with-aside to be .column--with-aside)
@travco will this problem be solved?