Skip to content

Why not combine BEM-compliant class names? #198

@ErikDyflexis

Description

@ErikDyflexis

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions