Re: Repeating gradient syntax question

On Jan 24, 2011, at 1:15 PM, Fraser Pearce wrote:

> Hi,
> 
> In reading the syntax I can't help but feel the way the repeated gradients work is still a bit long winded and seeminly duplicitive of the non repeat. I can think of two other, potentially better, ways of writing it in CSS that would be simpler and clearer.
>  
> My preferred method would simply to have a repeat keyword in the syntax, so the following:
> 
> -webkit-repeating-linear-gradient(left, red, green, blue)
> 
>  
> Would be written:
> 
> -webkit-linear-gradient(left, red, green, blue, repeat)
> 
>  
> The other option would be to observe the background-repeat value instead, seeing as ultimately these gradients are generated background images… but in this option I can't help but think I'm missing taking into account some kind of effect you wouldn't be able to do this way.
> 
I agree with you. I anticipate that almost all practical uses of repeating gradients will be for backgrounds, which already have a method of repeating. Thus, background-repeat is where we should make sure gradients repeat well, even if the gradient is at an angle. I have proposed that we do this by simply rotating the background (i.e. all the tiles of a background-repeat) instead of rotating the gradient inside each tile.

As for repeating radial gradients, this seems like an effect that will almost never be used. If someone really, really needs a radial gradient that repeats infinitely (instead of just copy-pasting the color stops a few times), they should use an SVG image.

Received on Monday, 7 February 2011 16:41:28 UTC