DEV Community

Discussion on: What is BEM and why use it to name your HTML classes!

Collapse
 
bourhaouta profile image
Omar Bourhaouta

A great post πŸ‘
I had a good time using BEM myself, but over time I changed the way I write classnames from .main__text-special to .main-text--special because of the text selection shortcuts and then I started to split the modifier from the classname to keep the JavaScript conditions as clean as possible:

BEM

and that's only for my personal projects to keep the consistency with the team.

Collapse
 
pachicodes profile image
Pachi πŸ₯‘

Thank you! And that is a interesting approach.
It is nice how you can adapt BEM to your needs