Answer the question
In order to leave comments, you need to log in
Mix of BEM and bootstrap grids, is it readable?
I came across a project with an atypical way of mixing BEM class naming and bootstrap grid. And according to the rules, there are no conflicts between grid styles and BEM block styles… But there are doubts about the readability of such logic.
Class types for positioning
.container
and.row
.<block>__col-<element>
(attached to a BEM element, has no explicit logical binding to grid classes)<header class="page-header">
<div class="container page-header__container">
<div class="row page-header__row">
<div class="logo page-header__col-logo">…</div>
<nav class="main-nav page-header__col-menu">
<ul class="main-nav__list">…</ul>
</nav>
<div class="page-header__col-email">
<div class="page-header__email">…</div>
</div>
</div>
</div>
</header>
.block__container.container
and.block__row.row
.block__col-<element>
// Сетка
.page-header {
&__container.container {}
&__row.row {}
&__col-logo {}
&__col-menu {}
&__col-email {}
}
// Оформление
.page-header__email {}
// Оформление вложенных блоков logo, main-nav — в отдельных файлах (без позиционирования)
Answer the question
In order to leave comments, you need to log in
As for me, these are absolutely useless mixes:
<div class="container page-header__container">
<div class="row page-header__row">
Some shitty code. Personally, I was horrified. It would be better if the author did it on a clean bootrap.
I am sometimes amazed by the originality of thinking of individual characters who manage to pervert the generally simple principles of BAM into something strange (to put it mildly). Here is one such example. And then they write articles on habr, what a bad bam :)
Somehow I tried to figure this out. An unreadable mess comes out. I agree with Alexey Nikolaev.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question