Re: [css3-background] New use case for background-position-x (&y!)

On Wed, Nov 10, 2010 at 4:07 PM, Lee Kowalkowski
<lee.kowalkowski@googlemail.com> wrote:
> On 10 November 2010 23:52, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>>> But unless I misread the specification, you still have to remember the
>>> order to do this.  I mean, is "top 15px left 10px" allowed?
>>
>> Yes.  That's the whole reason for tagging it with a side keyword -
>> there's no need for a specific order, because it's unambiguous.
>
> Thanks, is that what && means?  I'm not really familiar with that in
> this context:
>
>  [ center | [ left | right ] [ <percentage> | <length> ]? ] &&
>  [ center | [ top | bottom ] [ <percentage> | <length> ]? ]
>
> I thought it just meant you must provide both.

&& means both, in any order.  The full set of syntax combinators are |
which means "choose one", || which means "choose any number", and &&
which means "choose all, in any order".  (The "choose all, in the
specified order" case is implied by just not using a combinator.)


> So what happens if one uses "left 10px left 10px"?  Is that what the
> && prevents?

Yes.  You have to select one value from each side.  The 'left' keyword
is only on one side, so you can only select it once.  "left 10px left
10px" is just an invalid value, and thus ignored.

~TJ

Received on Thursday, 11 November 2010 00:16:08 UTC