...
Is it possible to " />
...
Is it possible to " />
...
Is it possible to "/>

Can a BEM Block have optional Elements?

31 views Asked by At

I have a "card" which looks like this:

<div class="card">
  <div class="card__tag"
  </div>
  <div class="card__title">
  </div>
  ...
</div>

Is it possible to use it in another context without the card__tag element like so:

<div class="card">
  <div class="card__title">
  </div>
</div>

Or should the card__tag element be extracted as a Mix?

I've been previously reusing blocks and in various places with elements optionally being included. I am now questioning if that is the correct approach and if the optional elements should be extracted out as their own Mix.

0

There are 0 answers