Answer the question
In order to leave comments, you need to log in
Is it possible to set a modifier to a block in BEM?
Actually, the question is in the SUBJECT.
I mean, is it acceptable to write like this:
<div class="block--mod">
<div class="block--mod__elem"></div>
<div class="block--mod__elem--mod"></div>
</div>
Answer the question
In order to leave comments, you need to log in
<div class="block block--mod">
<div class="block__elem block__elem--mod"></div>
<div class="block__elem block__elem--mod"></div>
</div>
Class modifier one is not used. That is, you always need to write at least
2
classes
.
If the block is of the same style, then for the elements such a modifier. If the block is different then other modifiers for elements
For example
block block_big
block__elem block__elem_big
block block_small
block__elem block__elem_small
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question