W3C home > Mailing lists > Public > www-style@w3.org > November 2013

Re: [mediaqueries] Add "<" and ">" syntax?

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 14 Nov 2013 16:39:23 -0800
Message-ID: <CAAWBYDBKht99-NPWV1=8F=u7=m=Z2iJDY7xofbpHFOwKsSSmVw@mail.gmail.com>
To: Andrew Fedoniouk <news@terrainformatica.com>
Cc: www-style list <www-style@w3.org>, Daniel Glazman <daniel.glazman@disruptive-innovations.com>
On Thu, Nov 14, 2013 at 4:04 PM, Andrew Fedoniouk
<news@terrainformatica.com> wrote:
> Good one, thanks. But I think calc() should be mentioned explicitly as
> currently [1]  contains just this:
> 4.1. width
> Value: <length>
> And calc() is not a length strictly speaking.

Actually, it is (as long as it contains an expression that evaluates
to a <length>).

> Yes, [2]  contains
> statement "It can be used wherever <length>, <frequency>, <angle>,
> <time>, <number>, or <integer> values are allowed." but calc() among
> other things can be evaluated to <percent> for example. Treatment of
> <percent>s in MQ can be different from normal box model that we have
> (e.g. calculated against screen workspace dimensions).

The definition of calc() already handles percentages.  They're only
valid if bare <percentage>s are valid where the calc() is placed, and
if so, they're evaluated in the same way, to one of the other types.

> In fact calc()
> may also benefit from having conditionals:
>    calc( 20px > 2em ? 300px : 200px )
> but that's another story indeed.


Received on Friday, 15 November 2013 00:40:10 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:37 UTC