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

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.

Indeed.

~TJ

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