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

[mediaqueries][css-values] Use cases for calc() in MQ?

From: Simon Pieters <simonp@opera.com>
Date: Tue, 29 Apr 2014 11:36:14 +0200
To: "www-style@w3.org" <www-style@w3.org>
Message-ID: <op.xe2nmoyfidj3kv@simons-mbp>
Currently it seems no browser supports calc() in media queries, but it  
should be supported per spec.

Does anyone have examples where calc() in media queries is useful?  
Examples of sites that use such breakpoints today (implemented in JS)?

Fran├žois REMY came up with an example:
> @yoavweiss @zcorpan if you have a fixed size column and want to know  
> remaining aspect ratio: (a)media (min-width: calc(100vh + 300px)) {}

...but didn't know of any sites actually doing that today  
(https://twitter.com/FremyCompany/status/461072179174854656 ).

On the one hand, it would be "nice" to support calc() everywhere. On the  
other hand, resources are limited and it's better if we focus on  
supporting things that people really want to do and skip the things that  
are only "nice". Therefore I suggest that we disallow calc() in media  
queries unless someone comes up with a compelling use case or demonstrates  
URLs that would benefit from supporting this.

Simon Pieters
Opera Software
Received on Tuesday, 29 April 2014 09:36:47 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:39 UTC