W3C home > Mailing lists > Public > www-style@w3.org > December 2010

Re: [css3-values] unitless zero lengths inside 'calc()'

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 29 Dec 2010 10:48:02 -0800
Message-ID: <AANLkTinTZmgh4Y6ReT1H13X2WKO4wLzunTaFVmKyB5kx@mail.gmail.com>
To: Brad Kemper <brad.kemper@gmail.com>
Cc: "L. David Baron" <dbaron@dbaron.org>, "www-style@w3.org" <www-style@w3.org>
2010/12/29 Brad Kemper <brad.kemper@gmail.com>:
> What is the harm of having unitless zero allowed? The benefit is that authors would not need to remember a special exception to unitless zeros that can be applied everywhere else that lengths are accepted.

It's ambiguous.  What's calc(0), a number or a length?  Is calc(0 +
2em) valid?  What about calc(0 + 3)?  In calc(2em * 0 + 0), would 0 be
a number both times, or a number the first time and a length the

calc() requires us to do some (very basic, in the current version)
unit algebra, and the ambiguity makes this trickier (though not

Received on Wednesday, 29 December 2010 18:48:57 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 11 February 2015 12:34:45 UTC