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.
Reactions are currently unavailable
With modern CSS, we now have access to the nesting selector &.
When targeting old browser in the past I didn't have any trouble because it was generating something like:
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.