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

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

From: François REMY <fremycompany_pub@yahoo.fr>
Date: Mon, 22 Oct 2012 08:22:34 +0200
Message-ID: <CB400528676C4B4681D791AEF41FD529@FREMYD2>
To: "Boris Zbarsky" <bzbarsky@MIT.EDU>, "www-style list" <www-style@w3.org>
|  3) This obviously doesn't help other consumers of media queries, like 
|  @import and <link>.  To address those we'd need to add more options for 
|  boolean operations to media queries (e.g. "or" and/or allowing "not" on 
|  individual expressions) and let authors deal with the resulting boolean 
|  logic hell.  My suggestion for doing @import sanely is to simply allow 
|  @import inside @media, for what it's worth.  I don't have a good 
|  suggestion for <link>

An idea to solve the case in more generality:

    @switch media {
        (min-width: 1000px) {
            ...
        }
        (min-width: 480px) {
            ...
        }
        all {
            ...
        }
    }
    
    @switch import {
        "desktop.css" (min-width: 1000px);
        "phone.css" (min-width: 480px);
        "small-phone.css" all;
    }
Received on Monday, 22 October 2012 06:22:43 GMT

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