RE: [css3-images] Making gradients readable

From: L. David Baron [mailto:dbaron@dbaron.org]
>> Generically, the proposed syntax is:
>>   radial-gradient( <shape-info>
>>                    from <position>
>>                    as <color-stop> [, <color-stop>]+ )
>
> The thing I don't like is that, in general, I don't like something
> that looks like this:
>
>  function(foo bar as a, b, c)
> 
> because I think when you have commas inside of functions, it's
> natural to split it like this (because many languages separate
> things inside functional syntax with commas):

>   foo bar as a
>    b
>    c
> 
> rather than splitting it as:
>    foo bar
>    a, b, c
>
> I thus prefer replacing the "as" with a ",".

Indeed.  This is one of the  reasons I strongly prefer proposal C to  proposal B.

Another reason is that I see the general syntax as:
 <gradient-type>-gradient([<optional-parameters> ,] <color-stop>[, <color-stop>]+)
where <gradient-type> is either "linear" or "radial" for CSS3, and <optional-parameters> resolves to one of
 <linear-optional-parameters>
 <radial-optional-parameters>

I also believe this easily scales to all gradient types that we might propose for CSS going forward.



A: radial-gradient(1em 2em, 3em 5em, red, orange, yellow)  
B: radial-gradient(3em 5em at 1em 2em as red, orange, yellow)  
C: radial-gradient(3em 5em at 1em 2em, red, orange, yellow)  
D: radial-gradient(shape 3em 5em at 1em 2em as red, orange, yellow)  

Received on Thursday, 3 November 2011 21:09:05 UTC