Re: [csswg-drafts] Make it easier to express ranges for <An+B> selectors (#4140)

I really don't like the syntax that puts the condition on the N; the fact that N goes over 0-Inf is already kinda confusing. I strongly prefer mixing the conditions into the An+B condition, so you filter the outputted element indexes.

For dealing with counting from the end, I think we should just allow negatives. `last-3` gives the parser hives (that's a single ident token). It looks a little weird, yeah, but it's familiar from other languages like Python that let you do an array slice like `arr[2:-3]` (and where "reversed" slices like `arr[3:2]` do indeed yield nothing).

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

Received on Monday, 14 October 2019 21:33:19 UTC