maxpoletaev / node-beml

HTML preprocessor for BEM
64 stars 4 forks source link

Mention limitations (or complex cases) in Readme #6

Closed pepelsbey closed 9 years ago

pepelsbey commented 9 years ago

Yes, it’s me bothering you again :) It would be good to mention that due to BEML design limitation it’s not possible to get the following structure:

<div class="one">
    <div class="two__element"></div>
    <div class="two">
        <div class="one__element"></div>
    </div>
</div>

I wouldn’t call it a best practice but sometimes you don’t have a choice. And even if I’m wrong and it’s possible to achieve using mix or complex JSON-based values it still worth mentioning.

maxpoletaev commented 9 years ago

It is possible. You can use forced block notation:

<div block="one">
  <div block="two" elem="element"></div>
  <div block="two">
    <div block="one" elem="element"></div>
  </div>
</div>

or mix (best practice in my view):

<div block="one">
  <div block="two" elem="element"></div>
  <div elem="element-wrapper" mix="block:two">
    <div elem="element"></div>
  </div>
</div>
pepelsbey commented 9 years ago

It would be good to mention “forced block notation” then. Because it’s not obvious from the first look.

maxpoletaev commented 9 years ago

Okay. Thanks!