R
R
rusglov2018-03-02 21:12:28
BEM
rusglov, 2018-03-02 21:12:28

How to position blocks in BEM?

<div class="header">
  <div class="header__logo">
    <a href="#" class="logo">MySite</a>
  </div>
  <div class="header__search">
      <div class="search">
        <input type="text" class="search__input">
        <button class="search__button"></button>
      </div>
  </div>
  <div class="header__auth">
    <form class="auth">
      <input type="text" class="auth__login">
      <div class="auth__button"></div>
    </form>
  </div>
</div>

As far as I understand, in BEM it is impossible to change the outer indents and positioning of the block itself. There are mixes for this (an example is in the code above). So, after watching a bunch of master classes, I still don’t understand why most people forget this rule and calmly set the positioning of the block itself. The essence of BEMA is that any block can be inserted into any part of the site, and nothing should fall apart. Isn't this a mistake? Who is right and how best to do, explain to a newbie)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question