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

Re: Can we have more maths in calc()?

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 07 Apr 2014 21:48:08 -0400
Message-ID: <53435558.3070401@mit.edu>
To: www-style@w3.org
On 4/7/14 9:41 PM, Zack Weinberg wrote:
> OK, I can see why you would be unenthusiastic about min and max on
> <length> particularly when percentages get involved, but note that the
> use case I described only requires them for <number>.  Can the same
> mess still creep in if they are restricted to <number>?

I would think so.  Given real numbers A, B:

   min(Apx, Bpx) == min(A,B)*1px
   min(A%, B%) == min(A, B)*1%

and similar for max.  So given min/max on <number> you can produce all 
the same behavior that you can produce with min/max on lengths.  You 
just have to jump through a tiny (or is it large, since the jump is 
easy?) hoop.

-Boris
Received on Tuesday, 8 April 2014 01:48:38 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:39 UTC