W3C home > Mailing lists > Public > www-style@w3.org > April 2014

[css-variables][css3-mediaqueries] using variables in media query expressions

From: Cameron McCormack <cam@mcc.id.au>
Date: Tue, 15 Apr 2014 13:00:11 +1000
Message-ID: <534CA0BB.4080904@mcc.id.au>
To: www-style list <www-style@w3.org>
I saw somebody want to use CSS Variables with media queries, like this:

   :root {
     --large: 800px;
   }

   @media screen and (max-width: var(--large)) {
     /* rules to implement some responsive design */
   }

That seems like a reasonable thing to want to do.  Can we define that 
variables in @media rules are resolved using the computed style of the 
root element?
Received on Tuesday, 15 April 2014 03:00:44 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:21 UTC