Skip to content

Clarify how to apply block modifiers to the elements #308

@collimarco

Description

@collimarco

For example, if you have:

<div class="article article--featured">
  <h1 class="article__title"></h1>
</div>

Now I want to have a bigger h1 for the variant article--featured.

  1. Should I add the class article__title--featured to h1 if I want to apply some styles to that element for the variation?
  2. Or should I add a class article--featured__title?
  3. Or should I keep only the class article__title and style it in CSS using a descendant selector .article--featured .article__title?

This is not clear from the spec.

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