Re: Gradient syntax proposal

Tab Atkins Jr. wrote:
> On Fri, Aug 14, 2009 at 5:16 PM, Tab Atkins Jr.<jackalmage@gmail.com> wrote:
>> Yeah, but allowing the literate form (in addition to the short "left"
>> form) makes a *wonderful* parallel to the full <bg-position>
>> construction, so it's easy to learn and understand.  This suggestion
>> from Elika was a definite win in my mind.
> 
> After some thought, I think I'd rather make that parallel explicit.  I
> want to change the second construction back to only taking a single
> keyword, but then add those keywords to the possible values in the
> second construction, and define what they translate to in terms of
> <bg-position>.  "left", frex, would translate to "left center" as a
> <bg-position>.
> 
> The syntax would then look like:
> 
> [
>   <angle> [ inside | outside ]?
> |
>   <point>
> |
>   [ <bg-position> | <point> ] to [ <bg-position> | <point> ]
> ]
> 
> with <point> being [ left | right | top | bottom | top-left |
> top-right | bottom-left | bottom-right ].
> 
> Sound good?

I'd drop the combination keywords, because you can write them
as <bg-position>. (top-left vs top left is not an improvement,
just makes things more confusing). Also <bg-position> already
allows single keywords:
   http://www.w3.org/TR/CSS21/colors.html#background-properties

So like this:

[
   <angle> [ inside | outside ]?
|
   <bg-position> [ to <bg-position> ]?
]

Also, I would like to see the ability to combine lengths and
start positions with the angle, as in
   http://lists.w3.org/Archives/Public/www-style/2009Aug/0142.html
because I think in many cases it will be simpler than picking two
sets of coordinates.

So

[
   <bg-position>? <angle> <length>?
|
   <angle> [ inside | outside ]
|
   <bg-position> [ to <bg-position> ]?
]

or simply

[
   <bg-position>? <angle> <length>?
|
   <bg-position> [ to <bg-position> ]?
]

if we drop the 'inside' option.

~fantasai

Received on Friday, 14 August 2009 23:14:11 UTC