S
S
SevSergei2018-01-22 18:29:03
css
SevSergei, 2018-01-22 18:29:03

Can a block modifier affect elements or how to do it right?

For example:

<div class="block">
   <span class="block__label">
      Блок
      <i class="fa fa-angle-down block__icon"></i>
   </span>
 </div>

The icon may or may not be visible. I would add a view modifier
.block__icon{
visibility:hidden;
}
.block__label--active .block__icon{
visibility:visible;
}

But BEM doesn't seem to be able to do that... or am I misunderstanding it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SevSergei, 2018-01-22
@SevSergei

found the answer myself.
Who cares:
It turns out you can use the cascade inside the block

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question