Re: [css-background] Add the *-x/y longhands to appropriate properties?

On Thu, Apr 17, 2014 at 5:10 PM, fantasai <fantasai.lists@inkedblade.net> wrote:
> On 04/09/2014 05:40 PM, Tab Atkins Jr. wrote:
>>
>> Could we go ahead and add the *-x/y longhands to the appropriate
>> background-* properties?  I know that background-position-x/y are
>> already supported by several impls, and background-repeat-x/y are
>> supported by WK/Blink at least.
>>
>> At minimum it's those two properties, though others could be expanded
>> out as well if necessary.
>>
>> As far as I know, our current plans for handling logical-direction
>> background stuff are compatible with still adding physical-direction
>> longhands, since we'll likely do it by adding logical-direction
>> longhands too (background-position-inline/block, etc), plus some way
>> of deciding which set of positions to pay attention to.
>
>
> I remembered the problematic case for this one:
>   background-position: left start;
>
> This doesn't split nicely into -x/-y/-inline/-block properties
> that take only offsets.

I wouldn't want the longhands to be only offsets anyway.  It's still
convenient to say "background-position-x: right 10px;", rather than
having to write "calc(100% - 10px)" in the longhand.

So, we'll want to allow keywords.  At that point, your example works just fine:

bg-pos: left start;

would decompose to:

bg-pos-x: left;
bg-pos-y: start;

Where "start" means "in the start direction of whatever axis is vertical".

~TJ

Received on Friday, 18 April 2014 16:16:17 UTC