Skip to content

Is block--modifier wrapping the block OK? #174

@davidjgonzalez

Description

@davidjgonzalez

I am working within the constraints of a CMS that "wants" to generate HTML in this format:

<span class="my-component--xmas">
     <div class="my-component"> ... </div>
</span>

Effectively the span (block--modifier) is dynamically injected by the CMS, and the div (block) and everything therein is defined by developers.

IIUC, the ideal application would be

<div class="my-component my-component--xmas"> ... </div>

but that being said, are there risks/inefficiencies following the approach where the block--modifier wraps the block element? Is this considered a violation of the BEM methodology?

@floatdrop / @varya / @iamstarkov thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions