K
K
Konstantin Khabibov2020-10-06 13:19:32
BEM
Konstantin Khabibov, 2020-10-06 13:19:32

Is it possible to use block, element and modifier at the same time in BEM?

I have a popular news item, unload the selectors, add a modifier to differentiate the news item and get:
news__item news-item news-item--popular

<div class="news">
    <h3 class="news__title">Новости</h3>

    <ul class="news__list">
      <li class="news__item news-item news-item--popular">
        <h4 class="news-item__title">Заголовок новости</h4>
        <p class="news-item__text">Текст новости</p>
      </li>
      <li class="news__item"><!-- новость --></li>
    </ul>
</div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FabiBoom, 2020-10-06
@FabiBoom

You can of course (you too), let's say we have a button component inside the promo:
- As a block - .button
- As an element of the promo block (for example, to position the button inside the block) - .promo__button
- And we want a rounded button - .button-- rounded

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question