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

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

From: Simon Pieters <simonp@opera.com>
Date: Fri, 06 Jun 2014 10:44:08 +0200
To: "www-style@w3.org" <www-style@w3.org>
Message-ID: <op.xg0yjujaidj3kv@simons-mbp>
On Tue, 29 Apr 2014 11:36:14 +0200, 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?

http://nostrongbeliefs.com/responsive-images/ under "An image in an  
article" seems like a reasonable use case for calc in the  
<media-contidion> in sizes="" at least.

sizes="(min-width:78.94736842105263em) 48.75em,
        (min-width:50em) 61.75vw,
        95vw"

->

sizes="(min-width:calc(75em / 0.95)) calc(75em * 0.65),
        (min-width:50em) calc(65vw * 0.95),
        95vw"

-- 
Simon Pieters
Opera Software
Received on Friday, 6 June 2014 08:44:26 UTC

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