Re: CSS Aliases

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. :)

~fantasai

Received on Wednesday, 8 October 2008 00:24:27 UTC