W3C home > Mailing lists > Public > www-style@w3.org > October 2008

Re: CSS Aliases

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 8 Oct 2008 08:15:20 -0500
Message-ID: <dd0fbad0810080615s1362daedxd4c0d0ad657326f@mail.gmail.com>
To: fantasai <fantasai.lists@inkedblade.net>
Cc: "Matt Patenaude" <MattPat@mattpat.net>, "Keiji Ikari" <kei@teamikaria.com>, www-style@w3.org
On Tue, Oct 7, 2008 at 7:23 PM, fantasai <fantasai.lists@inkedblade.net>wrote:

>
> Matt Patenaude wrote:
>
>>
>> Hey Keiji,
>>
>> On Oct 6, 2008, at 11:56 PM, Keiji Ikari wrote:
>>
>>  Instead, I'd suggest something like this:
>>>
>>> div.(product, service):first-child > h3 + p
>>>
>>> So each string (not necessarily a class name) separated by commas in
>>> the parentheses would be "expanded out" like mathematical brackets and
>>> would be changed by the parser to
>>>
>>> div.product:first-child > h3 + p, div.service:first-child > h3 + p
>>>
>>> before being applied.
>>>
>>
>> I actually thought of something like this as well, and I would probably
>> use this syntax over the one I proposed for new designs. However, I think
>> this only has half of the capability of the alias syntax I proposed, and
>> still presents a lot of search-and-replace work for modifying existing code.
>>
>> Ideally I'd like to see a little of both. :)
>>
>
> Something like
>  div:matches(.product, .service):first-child > h3 + p
> has been proposed before. It is purely syntactic sugar, so should be
> very straightforward to implement, and I would support putting it into
> Selectors 4.
>
> The sort of "Aliases" you suggest, not so simple. If the above solves
> your use case, I'd much rather we concentrate on that. :)


I like it, too.  I've had several cases where some simple sugar like that
would have saved me from typing a *long* run of selectors.

~TJ
Received on Wednesday, 8 October 2008 13:15:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:15 GMT