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? #240
Unanswered
MysticKnight
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
-
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.
Beta Was this translation helpful? Give feedback.
All reactions