R
R
r_g_b_a2020-03-01 17:45:05
BEM
r_g_b_a, 2020-03-01 17:45:05

BEM block: display property and sizing?

1) Quote from documentation

The block should not affect its environment, i.e. the block should not be given external geometry (in the form of padding, borders that affect dimensions) and positioning.

Does this include the display property ? For example, I have a button <button class="button"></button>with display: inline-flex , which is a BEM block. I mix it with some BEM positioning element <button class="button content__button"></button>. But if suddenly there is a different display property in .content__button , then the button will fall apart. It's not a normal situation that the mix will break the layout of the entire block? 2) There is a button that should have fixed dimensions of 100x50 . How to lay it out according to the BEM methodology? Do outer wrappers?

<div class="button">
  <button class="button__inner" style="width:100px;height:50px"></button>
</div>

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