W3C home > Mailing lists > Public > www-style@w3.org > March 2012

Re: CSS Hierarchies + @media queries

From: Chris Eppstein <chris@eppsteins.net>
Date: Wed, 29 Feb 2012 16:04:48 -0800
Message-ID: <CANyEp6XGOEybW2sN1uUoePs+caO6h978TDNp8_uv5a07A5shQg@mail.gmail.com>
To: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Cc: www-style@w3.org
I will buy them chocolates and a couple rounds of beer.

Chris

On Wed, Feb 29, 2012 at 4:00 PM, Daniel Glazman <
daniel.glazman@disruptive-innovations.com> wrote:

> Le 01/03/12 00:42, Chris Eppstein a écrit :
>
>
>  I was reading through http://dev.w3.org/csswg/css3-**hierarchies/<http://dev.w3.org/csswg/css3-hierarchies/>and
>> noticed that there was no provision for nesting an @media directive
>> inside a hierarchical selector context.
>>
>> In Sass we let @media be nested in any selector and then "bubble" that
>> @media query to the top level.
>>
>> For example:
>>
>> .context {
>> & .module {
>>     float: left;
>>     width: 50%;
>>     @media all and (max-device-width: 500px) {
>>       float: none;
>>       width: auto;
>>     }
>>   }
>> & p {
>>     color: #333;
>>   }
>> }
>>
>
> Wow. I understand the request but that would require a serious
> change in the parsing rules of CSS and I am not sure browser
> vendors will accept that one easily. The existing proposal
> is already super interesting but will have a rather huge impact
> on a) the parser b) the CSS OM c) the CSS resolution algo
> d) editing tools. I'm not sure an extra change of that magnitude
> will be welcomed, at least in the level 1 of that spec.
>
> </Daniel>
>
>
Received on Thursday, 1 March 2012 00:05:58 GMT

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