S
S
Sergey Goryachev2016-10-25 14:39:41
css
Sergey Goryachev, 2016-10-25 14:39:41

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

2 answer(s)
Александр, 2016-10-25
@webirus

<div class="block block--mod">
  <div class="block__elem block__elem--mod"></div>
  <div class="block__elem block__elem--mod"></div>
</div>

G
Gregory Bass, 2017-05-16
@GriNAME

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 question

Ask a Question

731 491 924 answers to any question