bem-site / bem-forum-content-en

Content BEM forum for English speak users
3 stars 0 forks source link

How to avoid nesting elements #28

Open FrancisVega opened 8 years ago

FrancisVega commented 8 years ago

Hi all! here I go again :) In the code below, how I should name the #### div?

I don't want to name it header__title because it doesn't reflect very well the DOM relation, and since BEM doesn't recommend nesting elements (And I don't really like too) it can't be header__rrss__title

So sorry for this silly question, I read all documentation FAQ's and I can't find any solutions :S

Thanks in advance,

F.

<div class="header">
  <div class="header__logo logo">
    <div class="logo__foo"></div>
  </div>
  <div class="header__rrss">    
    <p class="####"></p>  
    <div class="rrss-icons">
      <div class="rrss-icons__title"></div>
    </div>
  </div>
</div>
qfox commented 8 years ago

Heya.

Just use header__title instead of header__rrss__title. You shouldn't reflect DOM-structure in names of BEM entities. There is no point in doing so.