On Sunday 2011-10-30 22:25 -0700, fantasai wrote:
> So I propose for radial-gradient() is to use keywords to denote the various types of
> arguments, thus:
>
> radial-gradient(from center as red, orange, yellow)
>
> radial-gradient(from top left as red, orange, yellow)
>
> radial-gradient(circle from 25% 17% as red, orange, yellow)
>
> radial-gradient(3em 5em from 1em 2em as red, orange, yellow)
>
> Generically, the proposed syntax is:
>
> radial-gradient( <shape-info>
> from <position>
> as <color-stop> [, <color-stop>]+ )
So there's one thing I don't like about this and another that I
think could be improved.
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 ",".
Second, I think the <shape-info> really has two parts -- there's a
shape and a size (or extents). I wonder if this could be recast as:
radial-gradient( <shape>?
from <position>
to <extents>
[, <color-stop>] + )
Where:
<shape> is ellipse or circle, and defaults to ellipse
<position> is as you describe it
<extents> is:
closest-corner
closest-side
farthest-corner
farthest-side
or an explicit size (one number for a circle, two for an ellipse)
I could see the 'from' keyword also being 'at'.
(The 'from'-part and the 'to'-part seem like they could be reversed
if desired.)
I'd like to find an alternative word for 'to' that works well both
for the keywords and for <length> sizes; 'to' is a bit better for
the keywords that the <length> sizes; I think 'size' is the other
way around; I prefer 'to' over 'size' but would prefer a better
option if someone can think of it.
-David
--
𝄞 L. David Baron http://dbaron.org/ 𝄂
𝄢 Mozilla http://www.mozilla.org/ 𝄂