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

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.

~TJ

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