Answer the question
In order to leave comments, you need to log in
Is it possible to just write active in BEM?
I know that you can write like this:
<div class="tab">
<div class="tab__contetn tab__content--active"></div>
<div class="tab__contetn"></div>
<div class="tab__contetn"></div>
</div>
<div class="tab">
<div class="tab__contetn active"></div>
<div class="tab__contetn"></div>
<div class="tab__contetn"></div>
</div>
Answer the question
In order to leave comments, you need to log in
BEM is a fairly flexible methodology, and if your project agrees that `active` can be a global modifier for blocks and elements, you can.
In some projects, such modifiers are separated into `is_`-components: `is_active`, `is_hover`. Again, this is about teamwork. If by the rules, then `
active` is a block , not a modifier. It's just naming that confuses other project participants. You expect one thing, but you get another.
At first I would follow the methodology strictly, and then I would modify it for the project and the team.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question