Answer the question
In order to leave comments, you need to log in
How would it be correct according to BEM?
Good afternoon!
In view of the fact that there are not always good designers and persistent customers (make pixel by pixel, even if everything is crooked)
Given:
- Block
- With the light hand of the designer, the same block in different places of the layout has different margins from 10-40 (conditionally )
Question:
How do you implement the names of modifiers, in particular their naming in similar situations. When the state of the blocks does not change significantly, but naming the modifier in each case leads to a problem.
Answer the question
In order to leave comments, you need to log in
The block is not responsible for its positioning, margins are set only for elements.
<div class="block1">
<div class="block1_child">
<div class="block2"></div>
</div>
</div>
You can alternatively make mixins, for example, there are 2 containers and 2 headers:
<div class="container-1">
<div class="header container-1__header"></div>
</div>
<div class="container-2">
<div class="header container-2__header"></div>
</div>
<div class="block block--margin20">
<div class="block block--margin10">
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question