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

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