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

Re: [css-values] Revisiting calc() and whitespace

From: Brad Kemper <brad.kemper@gmail.com>
Date: Fri, 2 May 2014 11:01:12 -0700
Message-Id: <5E1B0612-A773-469B-835D-BAF8C1B6AA0D@gmail.com>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, "www-style@w3.org" <www-style@w3.org>
To: Simon Pieters <simonp@opera.com>
On May 2, 2014, at 12:00 AM, "Simon Pieters" <simonp@opera.com> wrote:

>> calc(1px-1px)
>> calc(1px+1px)
>> 
>> ...which are both invalid for different reasons.
> 
> Yes, I think we should make those two valid. But I think it would be silly to allow calc(1px+1px) and calc(1px + 1px) but not calc(1px +1px). We currently allow calc(2*2px) calc(2 * 2px) calc(2 *2px) etc.

I totally agree. I've used calc on a few projects now, and I always have to stop and remember to insert spaces on both sides of the plus, because I remember the discussion that leaving the space out of one side or the other caused some sort of problem. If I wasn't involved in this list, I probably wouldn't remember that, and I still don't spend a lot of time thinking about "why" when I'm writing it. It seems like a silly, unintuitive restriction to me, that only exists to make things more convenient for implementors. 

If it comes to it, I'd rather we disallowed adding or subtracting signed values on the right, than to force spaces into what looks like otherwise valid math. 
Received on Friday, 2 May 2014 18:01:42 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:51:26 UTC