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

[css-variables][mediaqueries] Allow var() in media queries?

From: Glen Huang <curvedmark@gmail.com>
Date: Sat, 4 Apr 2015 15:59:59 +0800
Message-Id: <3D3163A8-E519-4CC0-978D-098D7974F0FF@gmail.com>
To: www-style list <www-style@w3.org>
Does this do what I think it does?

```css
:root {
	--page-width: 768px;
}
@media (min-width: var(--page-width)) {}
```

If not, is it because media queries don’t inherit properties from the :root element? If that’s the case, can we add a selector to select a special element that the :root element and media queries will all inherit from?

When you design the media query break points according to certain element dimensions, being able to use variables in media queries can be very helpful.
Received on Saturday, 4 April 2015 08:00:32 UTC

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