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

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