Re: CSS3 background-position

On 01/06/2010 07:12 AM, Yves Lafon wrote:
> Hi,
> In [1]
> The two values notation is inherited from CSS21, so not so much we can
> do with it, however, the 3 or 4 values notation is adding extra
> complexity for not much.
>
> [ center | [ left | right ] [ <percentage> | <length> ]? ] ||
> [ center | [ top | bottom ] [ <percentage> | <length> ]? ]
>
> left 20% top 20% is exactly like 20% 20%, so nothing really useful there.
> right 20% top 20% is like 80% 20%, that's adding complexity for nothing.
>
> right 10px top 10px, here we have something useful, but quite limited by
> the fact that keywords are imposed as first values. It is also
> impossible to do 33% -10px top 20px, why?

Because that case is solved by calc(). (Technically right and
bottom offsets can also be solved by calc(), but it is friendlier
to math-averse people to allow the use of keywords.)

See css3-values for the definition of calc().
   http://www.w3.org/TR/css3-values/
   http://dev.w3.org/csswg/css3-values/

> Also forcing four values in that case would be easier, the three values
> notation doesn't seem more human friendly :)

I'm not convinced it's better to ignore three-value notations, and
I don't think this is important enough to change at this point.
CSS3 Backgrounds and Borders is a Candidate Recommendation.

~fantasai

Received on Thursday, 7 January 2010 01:34:37 UTC