getbem.github.io icon indicating copy to clipboard operation
getbem.github.io copied to clipboard

BEM: Is it appropriate to create a class called ‘title’ and then use it to style a H1 element inside another block that I have defined?

Open MysticKnight opened this issue 6 years ago • 0 comments

Assuming .title is considered a block in BEM, I may want to use that defined .title in many other blocks.

If it’s not appropriate to do that, that means I’m going to have to redefine .title in each block where I want to use a title.

For the sake of argument, let’s say I have 100 blocks and 50 of them have a simple title that’s blue. It’s easier to define the title as blue one time instead of defining it 50 times. It would also be easier to change the color later.

However, by defining .title outside of the other blocks, those blocks are no longer independent.

MysticKnight avatar Jan 29 '19 08:01 MysticKnight