W3C home > Mailing lists > Public > www-style@w3.org > November 2010

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 10 Nov 2010 16:15:08 -0800
Message-ID: <AANLkTi=wvtNhGTzOGc996a-Q_Lt78EWETx9JR-MLtNv0@mail.gmail.com>
To: Lee Kowalkowski <lee.kowalkowski@googlemail.com>
Cc: Brad Kemper <brad.kemper@gmail.com>, Markus Ernst <derernst@gmx.ch>, "www-style@w3.org" <www-style@w3.org>
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 GMT

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