W3C home > Mailing lists > Public > www-style@w3.org > February 2011

Re: Repeating gradient syntax question

From: Brad Kemper <brad.kemper@gmail.com>
Date: Mon, 7 Feb 2011 08:40:51 -0800
Cc: www-style@w3.org
Message-Id: <78E5B7D0-7C53-42F0-A7E6-6F0D319CA31E@gmail.com>
To: Fraser Pearce <me@fraserpearce.com>

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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:37 GMT