DEV Community

Discussion on: BEM Modifiers in Pure CSS Nesting

 
what1s1ove profile image
Vladyslav Zubko

Hey @latobibor !

Thank you for your comment. Indeed, without context, it's hard to understand which block I meant. I have revised the comment a bit, and @darkwiiplayer has described everything correctly as well, thank you!

Overall, BEM is primarily about conventions, and nothing stops you from adapting them to the needs of your project. Personally, in this project where I used this approach, each BEM block is in a different CSS file. If I were to use github as a separate BEM block, I would need to put it in a separate file as well, which I don't like.

Thread Thread
 
latobibor profile image
András Tóth

Thank you everyone for the explanation! Once they pointed out "B" is standing for block I understood it immediately.
I also didn't get it as I'm more pragmatic about it; I can tolerate some files containing other things as long as the file is small and no one is reusing the code in it.

Thread Thread
 
what1s1ove profile image
Vladyslav Zubko

It's not so much about tolerating it, but more about the fact that it violates the BEM rules, which state that styles of one block should not be present in the files of another block.