getbem.github.io icon indicating copy to clipboard operation
getbem.github.io copied to clipboard

How to name a block children of another block?

Open dessty opened this issue 7 years ago • 1 comments

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 avatar Jan 17 '18 22:01 dessty

@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.

f0rmat1k avatar Jan 19 '18 07:01 f0rmat1k