Skip to content

[css-nesting] add note explaining that BEM &__element class accumulation isn't supported and why #3748

@Dan503

Description

@Dan503

CSS nesting spec
https://drafts.csswg.org/css-nesting-1/

There is a very common method of writing BEM classes among FE developers that looks like this when writing in SCSS:

.block {
  &__element {
    // .block__element { ... }
  }
}

The spec currently doesn't seem to explicitly allow for this style of nesting. Providing an example to mention this method is ok is all that would be needed.

Update:

Apparently that syntax isn't actually allowed. 😢

The spec doesn't clearly explain if the syntax is valid or not though.

Please add a clear example stating that this isn't valid and explain why.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions