Re: Repeating gradient syntax question

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.

Simon

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