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

> On Apr 18, 2014, at 9:15 AM, "Tab Atkins Jr." <> wrote:
>> On Thu, Apr 17, 2014 at 5:10 PM, fantasai <> 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".

My initial reaction was to agree with you, but then I started thinking about why someone would use 'start' instead of 'top' or 'left'. It would be to align with the text in some significant way. 

So, suppose I wanted a radial gradient dot to appear at the start of the block direction (which would be the top of the text block in Latin-based languages), and centered in the inline direction, with enough 'padding-block-start' to make it visible before the first line of text. In that case, "whatever axis is vertical" doesn't help me. I would need a 'bg-pos-block' and 'bg-pos-inline'.

Do you have a different use case in mind, where 'start' would need to be used instead of 'top' or 'right', but the axis you applied it to would always be vertical? Or alternately horizontal, if you used 'bg-pos-x'? It seems to me that if you didn't care which logical dimension it was aligned to as long as it was the start of the vertical, you would just use 'top' instead of 'start'.

Received on Friday, 18 April 2014 21:00:04 UTC