W3C home > Mailing lists > Public > www-style@w3.org > June 2011

Re: [CSS4 Selectors] :has() (was Re: [CSSWG] ... F2F Kyoto]

From: Brian Kardell <bkardell@gmail.com>
Date: Sat, 11 Jun 2011 09:47:21 -0400
Message-ID: <BANLkTinNd1vT1rZ2U0J+M_FsEj6bU6ypQQ@mail.gmail.com>
To: Alan Gresley <alan@css-class.com>
Cc: fantasai <fantasai.lists@inkedblade.net>, John Jansen <John.Jansen@microsoft.com>, "www-style@w3.org" <www-style@w3.org>
Yes, all of those examples seem intuitive.  Specifying the subject of the
selector is something CSS has never done before, but that is what is in CSS
SELECTORS LEVEL 4 that originated this.  In there though, your example:


Would be written, if I understand correctly:

!ul a
On Jun 11, 2011 9:36 AM, "Alan Gresley" <alan@css-class.com> wrote:
> On 11/06/2011 10:38 PM, Brian Kardell wrote:
>> I have read through the wiki and the discussions surrounding
>> subject/matches/has and I can't seem to find where ! is introduced. In
>> case, I ran this privately past 5 designers and 2 programmers who are
>> good with CSS and without fail all eight of us had the same reaction as
>> Opera voiced "that means not". There was also unanimous agreement that
>> has() as presented by Ian and implemented in jQuery for some time (with
>> addition of supporting rhs combinator), despite a smattering of
>> is both infinitely more intuitive/readable and fulfills the vast majority
>> their real world needs.
>> It is also easy to implement and has the advantage that it already has
>> its practical worth and is used by a large community.
>> As I said, I read fantasai's comments on this, and I understand the
>> objections on a larger "matches", but :has() seems like low hanging fruit
>> that accomplishes a lot even if it could also be written with a matches()
>> some symbol notation. Even if the later has much expressive power, I
>> personally willingly trade a certain amount of whatever that is for
>> intuitiveness and readability.
> So that I am clear in what :has() does. If I wanted to style any
> list-item <li> that does not have anchor links <a>, could use this
> ul:has(a) li { ... }
> Could either of these work?
> ul:has(a) { ... }
> ul:has(li > a) { ... }
> ul:has(a:hover) { ... }
> CSS has never worked like that before.
> --
> Alan Gresley
> http://css-3d.org/
> http://css-class.com/
Received on Saturday, 11 June 2011 13:47:49 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:50:02 UTC