M
M
Maloy1232017-01-19 14:41:42
css
Maloy123, 2017-01-19 14:41:42

Are empty classes in BEM normal?

When laying out according to the BEM methodology, sometimes blocks without styles are obtained. For example:

<div class="block">
    <div class="block__item"></div>
    <div class="block__item"></div>
    <div class="block__item"></div>
</div>

.block {}
.block__item {
     color: #000000;
     padding: 10px;
}

Is this normal or am I misunderstanding something and there should not be such blocks?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yaroslav Ivanov, 2017-01-19
@Maloy123

Everything is fine. In BEM markup, you specify a class for each element. In css, if it is not used, do not write anything.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question