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

Re: CSS Hierarchies / Selector Nesting Proposal

From: Andrew Fedoniouk <andrew.fedoniouk@live.com>
Date: Thu, 2 Jun 2011 22:48:44 -0700
Message-ID: <BLU165-ds20440346B013780533BD70F87F0@phx.gbl>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: "Boris Zbarsky" <bzbarsky@mit.edu>, "Brad Kemper" <brad.kemper@gmail.com>, <www-style@w3.org>
-----Original Message----- 
>From: Tab Atkins Jr.
>Sent: Thursday, June 02, 2011 9:40 PM
>To: Andrew Fedoniouk
>Cc: Boris Zbarsky ; Brad Kemper ; www-style@w3.org
>Subject: Re: CSS Hierarchies / Selector Nesting Proposal
>
>On Thu, Jun 2, 2011 at 9:04 PM, Andrew Fedoniouk
><andrew.fedoniouk@live.com> wrote:
>> -----Original Message-----
>>>
>>> From: Boris Zbarsky Sent: Thursday, June 02, 2011 9:09 AM To: Brad 
>>> Kemper
>>> Cc: www-style@w3.org Subject: Re: CSS Hierarchies / Selector Nesting
>>> Proposal
>>> On 6/2/11 11:48 AM, Brad Kemper wrote:
>>>>
>>>> OK, I see the issue now. By inserting the ampersand token, you are 
>>>> being
>>>> more explicit with regard to space handing.
>>>
>>> Yeah, the use of ' ' as a combinator is sort of killing us here.  :(
>>
>> I suspect that backward compatibility is also the feature being killed.
>>
>> Consider this sample:
>>
>> <html>
>> <style>
>>  #one {
>>   & #two { background:yellow; }
>>   background:red;
>>  }
>> </style>
>> <body>
>>  <div id=one>test</div>
>> </body>
>> </html>
>
>This was *explicitly* mentioned in my original email.  "However, it
>degrades well in existing browsers if you put the nested rules below
>all the properties in a rule."
>

Yes, it was mentioned. But mentioning it does not solve its problem in 
general.

By the way, this:

#one {
   & #two { background:yellow; };
   background:red;
}
is backward compatible and works unconditionally. Note ';' after '}'.

In any case all this setup is not quite useful as soon it will be at least 
one UA
in use that does not support this feature. If someone will need this kind of
style organization they will use LESS or the like.

Problem is that for other CSS features there are reasonable fallbacks at the 
moment.
But for this one the fallback will be in maintaining two parallel style 
sets.
So it will be even worse than now.


-- 
Andrew Fedoniouk

http://terrainformatica.com
Received on Friday, 3 June 2011 05:49:15 GMT

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