W3C home > Mailing lists > Public > www-style@w3.org > June 2015

Re: [selectors][css-syntax] Allow comma-separated lists of An+B?

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 22 Jun 2015 11:48:06 -0700
Message-ID: <CAAWBYDABM+GTJfT3CBHffpv5iVbviRs2aR_FZvKPHhMYMMUHJA@mail.gmail.com>
To: lists@novalistic.com
Cc: "<www-style@w3.org>" <www-style@w3.org>
On Mon, Jun 22, 2015 at 11:29 AM, Daniel Tan <lists@novalistic.com> wrote:
> On 6/23/2015 2:13 AM, Tab Atkins Jr. wrote:
>> There's nothing wrong with that at a parsing level.  The more complex
>> grammar of :nth-child() is a bit more difficult, though -
>> comma-separated indexes, or whole entries?
>
> Good point - what I initially had in mind was :nth-child(An+B, Cn+D of sel1,
> sel2), but I can see how that could be interpreted as :nth-child(An+B of
> sel1, Cn+D of sel2) instead, or how someone might want to write it that way.
> I hadn't quite thought that through.
>
> It seems the complexity of this would be too great taking the selector-list
> argument into account :/

I mean, you can do one or the other.  In particular, just letting the
whole thing be repeated comma-separated is fine and not confusing:

:nth-child(An+B of sel1, An+B of sel2, Cn+D of sel1, Cn+D of sel2)

It's shorter than using :matches() and repeating the :nth-child() part
three more times, at least.

~TJ
Received on Monday, 22 June 2015 18:48:52 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:55 UTC