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

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