W3C home > Mailing lists > Public > www-style@w3.org > August 2012

Re: List of selectors under consideration for Selectors Level 4?

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 16 Aug 2012 07:46:39 -0700
Message-ID: <CAAWBYDC5vtUXko=GrnOr=kwV_G4938Jn9meubS+gt4Y3x_tr-g@mail.gmail.com>
To: Greg Houston <gregory.houston@gmail.com>
Cc: fantasai <fantasai.lists@inkedblade.net>, www-style@w3.org
On Thu, Aug 16, 2012 at 1:38 AM, Greg Houston <gregory.houston@gmail.com> wrote:
> Ah. Is Selectors Level 5 in the works? If so, is there a list of
> selectors being considered for inclusion in the draft?

It will be, later.  We haven't started working on it yet.

>>> I'm particularly interested in the status of the previous sibling
>>> combinators and wonder if they are even on anyone's radar.
>> I believe you're looking for
>>   http://dev.w3.org/csswg/selectors4/#subject
> I'm not sure that link relates to the combinators I mentioned. Someone
> proposed the previous sibling combinators that basically look in the
> opposite direction of the preceding sibling combinators, + and ~. I
> find myself wishing these existed on just about every UI project I
> work on. That way I could change content styling depending on if that
> content is followed by a footer or pagination for example.

Instead of "p - ul" (select a <ul> whose following sibling is a <p>),
do "!ul + p".  Same selector as always, but the ! tells the engine
which element is the "subject" of the selector.

As Marat says, you can combine this with :matches() if you then want
to chain off of the element.

Received on Thursday, 16 August 2012 14:47:30 UTC

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