Skip to content

Is there a way to support native nesting selector & &? #412

@MangelMaxime

Description

@MangelMaxime

With modern CSS, we now have access to the nesting selector &.

.flex-table {
    & &__header {
        display: flex;
        align-items: center;
        padding: 0 10px;
    }
}

When targeting old browser in the past I didn't have any trouble because it was generating something like:

.flex-table { ... }
.flex-table .flex-table__header {...}

which means that I had access to the full class flex-table__header.

However, because modern browser are gaining support of & natively, then depending on the browserlist configuration we don't always have the full class generated.

Is it possible to support such syntax with CSS Modules or do I need to be careful about not using & & trick anymore?

Note

& & trick, was handy because by renaming the top level class all nested reference where automatically renamed too.

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