L
L
lilwings2019-12-17 20:00:13
css
lilwings, 2019-12-17 20:00:13

Is it necessary to shorten modifiers in BEM?

Should modifiers be abbreviated:
Abbreviations:

<div class="test test_mb_10"></div>
<div class="test test_ta_center"></div>
<div class="test test_fz_16"></div>
<div class="test test_ai_center"></div>

Without abbreviation:
<div class="test test_margin-bottom_10"></div>
<div class="test test_text-align_center"></div>
<div class="test test_font-size_16"></div>
<div class="test test_align-items_center"></div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2019-12-17
@lilwings

Yes, write immediately in style, what for fooling around like that.

<div class="test" style="margin-bottom:10px">
</div>

And I'm quite serious. There should be no such modifiers. I already wrote in more detail about this, laziness will repeat. In short, if you need to quickly fix the style in some place, stick it inline.
Or get confused, think over the semantics of the modifier, name it normally and use it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question