Skip to content

Inconsistency in how bemto identifies a primary block/element class #72

@jonscottclark

Description

@jonscottclark

Hey @kizu,

I wanted to report this issue because I don't know if it's actually a bug or not.. maybe it's just something that needs documenting, or maybe you had a good reason to do this.

If I write:

+b.Component.otherclass
  +e.Element

It compiles as expected to:

<div class="Component otherclass">
  <div class="Component__Element">
  </div>
</div>

But if I change it to:

+b.Component.otherclass(class='_modifier')
  +e.Element

It renders:

<div class="Component otherclass otherclass_modifier">
  <div class="Component__Element">
  </div>
</div>

It appears that when you use the class attribute (as I sometimes do to dynamically insert extra modifier classes) instead of passing the modifiers directly into the selector, bemto will add the modifier class onto the last class in the selector, when, in previous versions and in most other cases, bemto will identify the first class after +b or +e as the primary class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions