W3C home > Mailing lists > Public > www-style@w3.org > February 2012

Re: [css3-2d-transforms][css3-images] <position> grammar is duplicated or points to the wrong spec

From: Brad Kemper <brad.kemper@gmail.com>
Date: Wed, 1 Feb 2012 21:43:03 -0800
Message-Id: <F133BD61-475A-44CD-BF09-C9CAF579288E@gmail.com>
Cc: Sylvain Galineau <sylvaing@microsoft.com>, "Tab Atkins Jr." <jackalmage@gmail.com>, "L. David Baron" <dbaron@dbaron.org>, www-style list <www-style@w3.org>, fantasai <fantasai@inkedblade.net>
To: Brian Manthos <brianman@microsoft.com>
On Feb 1, 2012, at 12:56 PM, Brian Manthos <brianman@microsoft.com> wrote:

>> background-position: calc(50% + 2px);
>> then it would resolve to:
>> background-position: 51%; /* which is 102px */

Actually the 51% point of the image (not the left edge) lining up with 102px (51% point) of the 200px background.

>> But if you had this:
>> 
>> background-position: calc(2px + 50%);
>> then it would resolve to this: 
>> background-position: 102px;
> 
> Specifying calc resolution such that it doesn't respect commutativity would be awful.

OK. I more than half expected that reaction, and Tab didn't like it either. 

> If you really want to make...
>    calc(a + b) != calc(b + a)
> then it shouldn't be expressed this way.
> 
> You need something more like
>    calc(a, b)
> or
>    calc(directionally-sensitive-addition, a, b)

More to the point would be something like 

   calc(a + b, as percent)

   calc(a + b, as px)

   calc(a + b, as em) /* could make a difference when user resizes text without zooming whole page */
Received on Thursday, 2 February 2012 05:43:34 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:50 GMT