RE: Gradient syntax proposal

Brad Kemper wrote:
| ... You thinking you can just create a second
| background thats as small as that box? I was think of that too, but
| the gradation actually needs to keep going on all four sides of that

I think I misinterpreted your comment (and you mine). I wanted confirmation
that, in an element with a background color but no border, it was agreed
that a gradient with these properties:

background-size: calc(100%-200px) calc(100%-200px);
background-position: 50% 50%;
background-repeat: no-repeat;

would be confined to its box and the background color (or an underlying
auto-sized gradient) would show as a 100px border. (At the time I was
thinking in terms of an argument about complexity, but I'm not recalling
what it was.)

(Interesting animation potential in being able to size a gradient box larger
than the clip box.)

Anyway, I'm all for simplicity, and it seems to me just this suffices for
<gradient-line>:

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

But this is just a valid subset of the current spec, right?

I think that it would avoid possible confusion if <color-stop> stood for:

[ <color> [ <percentage> | <length> ]? ]

It just seems reasonable to have the required value come first.

<length> as an option is very important - how would I align a particular
band of gradient behind a headline without it?

Might be good to require <color-stop>s to be in ascending order. Less chance
for misreading someone else's stylesheet. Or, since there is a difference
between blending two colors and overlaying one blend on a solid color, maybe
it does make sense to allow backtracking. Then you could call for rendering
a solid area, backtracking, and laying down a gradient. (Just a thought.)

David Perrell

Received on Sunday, 16 August 2009 21:54:36 UTC