getbem / getbem.github.io

Get BEM to all people in simplest way
http://getbem.com/
MIT License
5.68k stars 217 forks source link

Can blocks have other blocks as children, or only elements are allowed? #224

Closed andrejesuscm closed 2 years ago

andrejesuscm commented 2 years ago

Imagine the following component:

<div class="card">
    <div class="heading">...</div>
    <div class="card__body">...</div>
    <div class="card__footer">...</div>
</div>

Is it allowed to have another block heading as children of another block, or should we wrap it in another element:

<div class="card">
    <div class="card_heading">
        <div class="heading">...</div>
    </div>
    <div class="card__body">...</div>
    <div class="card__footer">...</div>
</div>

Thanks for the clarification.