libsass icon indicating copy to clipboard operation
libsass copied to clipboard

@extend doesn't flatten idempotent selector pseudos

Open nex3 opened this issue 4 years ago • 0 comments

The pseudoclass selectors with selector arguments :matches(), :any(), :current(), :nth-child(), and :nth-last-child() are all idempotent, which means that wrapping a selector in multiple layers of the same selector has no additional effect. Because of this, LibSass should flatten these selectors if they're injected into an identical selector via @extend.

For example, selector-extend(":matches(.c)", ".c", ":matches(.d, .e)") should return :matches(.c, .d, .e) but in LibSass it currently returns :matches(.c, :matches(.d, .e)).

nex3 avatar Feb 28 '20 02:02 nex3