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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 29 Apr 2014 10:45:45 -0700
Message-ID: <CAAWBYDAOWdxoi9q-cmW5RiH1dHnvuuiN8NkrY8+35ArGEjWgHQ@mail.gmail.com>
To: Simon Pieters <simonp@opera.com>
Cc: "www-style@w3.org" <www-style@w3.org>
On Tue, Apr 29, 2014 at 2:36 AM, Simon Pieters <simonp@opera.com> wrote:
> 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)) {}
>
> https://twitter.com/FremyCompany/status/461060172790915072
>
> ...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.

Complicating the language by introducing special-case limitations when
there's no technical reason for them just makes it harder to use for
authors.  While we should resist "completionist" urges, *consistency*
is more important.

~TJ
Received on Tuesday, 29 April 2014 17:46:32 UTC

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