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

Re: [selectors] Proposal: :n-children() selector

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Wed, 04 Feb 2015 06:25:51 +0100
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Matt Mastracci <matthew@mastracci.com>, Lea Verou <lea@verou.me>, www-style list <www-style@w3.org>
Message-ID: <p3b3dat6726knmhsm5umban00h96nk09rq@hive.bjoern.hoehrmann.de>
* Tab Atkins Jr. wrote:
>With that, you could do something like:
>
>@custom-selector $rest:--n-siblings($n)
>:nth-child(1):nth-last-child($n) /self-and-siblings/ $rest;
>
>So that writing `.foo:--n-siblings(3)` would become
>`:nth-child(1):nth-last-child(3) /self-and-siblings/ .foo` after
>expansion.

(A node cannot be `self` and `sibling` at the same time, so I do not
think `and` makes sense there; union is `or`, not `and`).
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
D-10243 Berlin · PGP Pub. KeyID: 0xA4357E78 · http://www.bjoernsworld.de
 Available for hire in Berlin (early 2015)  · http://www.websitedev.de/ 
Received on Wednesday, 4 February 2015 05:26:22 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:52:01 UTC