W3C home > Mailing lists > Public > public-css-archive@w3.org > October 2019

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

From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
Date: Mon, 14 Oct 2019 21:33:18 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-541934715-1571088796-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:54 UTC