Re: [csswg-drafts] [selectors-4] New selector based on the amount of child elements (#5694)

Selecting based on how many siblings an element has is an identical amount of work to `:nth-last-child()`. (In other words, it's bad, but it's an amount of bad that we've already accepted.) You can tell this is true because `:sibling-count()` can be *desugared* into a combination of `:nth-child()` and `:nth-last-child()`: `:sibling-count(3)` can be desugared to `:is(:nth-child(1):nth-last-child(3), :nth-child(2):nth-last-child(2), :nth-child(3):nth-last-child(1))` ^_^

Selecting based on how many children an element has is indeed `:has()`-equivalent, however.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5694#issuecomment-722044711 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 5 November 2020 00:16:57 UTC