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

Re: Repeating gradient syntax question

From: Simon Fraser <smfr@me.com>
Date: Mon, 07 Feb 2011 09:13:33 -0800
Cc: Fraser Pearce <me@fraserpearce.com>, www-style@w3.org
Message-id: <F590B5DC-4F29-477B-9BD8-5B438AEEF386@me.com>
To: Brad Kemper <brad.kemper@gmail.com>
On Feb 7, 2011, at 8:40 am, Brad Kemper wrote:

> On Jan 24, 2011, at 1:15 PM, Fraser Pearce wrote:
>> 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.

I disagree. I think "background-repeat" should only ever cause repeating of axis-aligned image tiles.

> 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.

I think repeating radial gradients should be there for symmetry with repeating linear gradients, and I'm sure that designers will find uses for them that we haven't thought of.

Received on Monday, 7 February 2011 17:14:08 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:43 UTC