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

Re: CSS Hierarchies + @media queries

From: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Date: Thu, 01 Mar 2012 01:00:39 +0100
Message-ID: <4F4EBC27.9020603@disruptive-innovations.com>
To: www-style@w3.org
Le 01/03/12 00:42, Chris Eppstein a écrit :

> I was reading through 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:01:05 GMT

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