Why not combine BEM-compliant class names? #236
Unanswered
ErikDyflexis
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
On the BEM Site it is mentioned that
.block .block__element
is a bad way to write BEM. (http://getbem.com/naming/). That same way,.block.block--modifier
and.block.block--modifier .block__element
is also incorrect. The only thing that is considered acceptable when using more than one selector would be.block--modifier .block__element
according to the FAQ. (http://getbem.com/faq/#block-modifier-affects-elements).I am at peace with this decision, however, I find that I cannot explain this to others.
I know plenty of people that would (and do) argue being specific is not a bad thing, especially if we stick to this notation religiously we won't get into specificity issues. And whether or not it is readable remains a a matter of taste. Because it sticks to the parent, it also becomes independent, if not even less dependent, on other blocks.
What is the official stance on this? What are some problems would arise when writing BEM with this method?
Beta Was this translation helpful? Give feedback.
All reactions