Answer the question
In order to leave comments, you need to log in
How to properly implement an adaptive grid according to BEM?
Hello.
I would like to know the opinion of professionals on the correct implementation of an adaptive grid using the BEM methodology.
What exactly is the question.
I know three methods:
1. Using special classes, like in bootstrap (col-sm-5, col-xs-5, etc.)
2. @mixin in preprocessors
3. @extend in preprocessors
For me personally, they all have their own cons and pros.
1. Classes speed up the layout, all the rules are in one place. But the html gets messy.
2. Mixins leave clean css and html, but increase the css file.
3. Inheritance makes css smaller, but messy because of the huge pile of selectors.
Which of these methods is more correct?
Answer the question
In order to leave comments, you need to log in
Option 1 is required. The fact that there are many classes does not play any problem. The main thing is to name them correctly, with meaning.
<div class="row">
<div class="col col12 collg6 colmd7 colsm8 colxsm12">
<div class="blockText"></div>
</div>
</div>
Mixins. The increase in the size of the final style file is not large enough to pay attention to.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question