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

Re: CSS Hierarchies / Selector Nesting Proposal

From: Eduard Pascual <herenvardo@gmail.com>
Date: Fri, 3 Jun 2011 15:35:22 +0200
Message-ID: <BANLkTi==WvLHfwkV+JoPdpjwgLSU4YQxpg@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, www-style@w3.org
On Fri, Jun 3, 2011 at 3:13 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 6/3/11 3:06 AM, Tab Atkins Jr. wrote:
>>
>> Yes, it's intended that things like "&input" be supported.  The
>> restriction for tagname selectors to be the first part of a complex
>> selector is solely because we can't distinguish the start of a tagname
>> selector from the end of another selector.
>
> Wait.  So I thought I understood the proposal, but now I see that I don't.

For a moment I felt exactly the same, but I think there are some cases
where the "&input" construct could make sense (not sure if they are
worth the extra implementation complexity, but that I'll let you,
implementors, to decide).

If I got it right, then something like this:
:hover {
    &input { color: red; }
    &span { color: blue; }
}
should be equivalent to this:
input:hover { color: red; }
span:hover { color: blue; }

And would be equivalent to this:
:hoverinput { color: red; }
:hoverspan { color: blue; }
if it weren't for the issue that there is no way to tell the pclass
and element apart.

While it looks like an interesting feature, personally I'd prefer a
simpler implementation being available sooner than having to wait
longer just for this "extra".

Of course, I may have gotten it all wrong, so better wait for Tab to
confirm or correct this :P

Regards,
Eduard Pascual
Received on Friday, 3 June 2011 13:36:09 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:41 GMT