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

Re: Proposal: @-rule for containing exclusive @media rules

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 22 Oct 2012 02:35:30 -0400
Message-ID: <5084E932.1050205@mit.edu>
To: François REMY <fremycompany_pub@yahoo.fr>
CC: www-style list <www-style@w3.org>
On 10/22/12 2:22 AM, François REMY wrote:
> An idea to solve the case in more generality:
>
>     @switch media {
>         (min-width: 1000px) {
>             ...
>         }
>         (min-width: 480px) {
>             ...
>         }
>         all {

I can probably live with this, though requiring the explicit "all" is a 
bit counterintuitive; it took me a sec to figure out why that works.

The fact that this doesn't simply reuse existing @media rules make the 
implementation a bit more annoying, but not too terrible, I guess.  It 
also makes the CSSOM for this a bit more painful to spec, too...  Again 
not too big a deal, assuming we actually _do_ it.

 >      @switch import {
 >       "desktop.css" (min-width: 1000px);
 >       "phone.css" (min-width: 480px);
 >       "small-phone.css" all;
 >   }

Again, a bit more implementation and spec work than simply allowing 
@import inside @media, but doable.

-Boris
Received on Monday, 22 October 2012 06:35:59 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:01 GMT