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

Re: [selectors] Previous-sibling combinator?

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 9 Feb 2015 08:16:16 +1100
Message-ID: <CAAWBYDCCqnNmBRML4WzF_9vY4S-5itrY8p28m1Wg=jb+fUNezQ@mail.gmail.com>
To: Clive Chan <doobahead@gmail.com>
Cc: Brad Kemper <brad.kemper@gmail.com>, Henrik Andersson <henke@henke37.cjb.net>, www-style list <www-style@w3.org>
On Mon, Feb 9, 2015 at 2:31 AM, Clive Chan <doobahead@gmail.com> wrote:
> I feel like ~ should have been used for previous-sibling, since it's
> sometimes used as a negation operator. And then just use ++ or ~~ to
> indicate the "all after/before" combinators. The ship has long sailed for
> that, though, unless we're planning on breaking backwards compat.
>
> I like the idea of requiring spaces around the dash - it'll actually force
> people to write nicely spaced out CSS combinators, haha - but it does break
> typical naming conventions. Hm. I'm still for it, though.
>
> Or we could use more wordy things such as :siblings, :siblings:before,
> :siblings:after, similarly to the jQuery .siblings() function (do any
> frameworks have CSS-ified syntax for all-siblings yet?).

Agreed that it should have been spelled ++ originally. ^_^  At least
we can make up for the mistake with the descendant combinator - it can
now be spelled >> as well as with a space (at least, per spec - no
browser has picked it up yet).

The way we do named combinators now is as /foo/ - a name between two
slashes.  So /siblings/ or /prev-sibling/, etc, is possible.

~TJ
Received on Sunday, 8 February 2015 21:17:04 UTC

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