W
W
wakenbyWork2021-05-28 18:19:51
BEM
wakenbyWork, 2021-05-28 18:19:51

How to act in such cases?

I have a lot of BEM blocks, and they have indents from the bottom and sometimes from the top, in 90% of cases they are the same, is it possible to write modifiers for such cases like this?:

.class-name {
  /* ...code */

  &--mb-20 {
    margin-bottom: 20px;
  }

  &--mt-40 {
    margin-top: 40px;
  }

  &--m-36 {
    margin: 36px;
  }
}

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