getbem.github.io
getbem.github.io copied to clipboard
How to name a block children of another block?
Let's say I'm buidling a dialog/modal component, which is composed of 3 parts:
- the header
- the body
- the footer
My root block would be .modal. But .header., .body and .footer are also blocks.
Should the 3 dependent blocks be named .modal__header, .modal__content, modal_footer?
Or simply .header, .content, .footer?
@dessty I guess should, because header is to common name. Tomorrow you will need to make new block of such 3 parts, so how you gonna name them?
When you mark something as a Block (component), it means, that you can use it again somewhere w/o any other dependencies. So you need .footer w/o .modal.? If no, use modal__footer.