Re: [gradients] basics

On Nov 8, 2009, at 1:12 PM, Simon Fraser wrote:

>> Any UA that supports 'background-repeat', 'background-size', and  
>> Tab's 'linear-gradient()' should support tiling a properly sized  
>> gradient with 'background-repeat'. What Gecko does that goes beyond  
>> this is to adjust the tiling so that the gradients in each tile  
>> line up with each other. Thus, if you had a 30deg gradient, the  
>> tiles of 'background-repeat' are not in rows and columns as they  
>> normally are, but presumably shift each column (or row?) so that  
>> the colors of the gradient in each tile will line up with its  
>> neighbor. Although, that doesn't precisely describe how something  
>> like 'repeat-x' would work with a gradient that includes, say, a  
>> 10deg gradient or even a top-left to lower-right gradient.
>
> I don't think this can be construed as "adjusting the tiling so that  
> the gradients line up with eachother", since Gecko also makes radial  
> gradients repeat, and that can't be described by adjusting the tiles.

Agreed. I was limiting myself to talking about linear gradients, and I  
admitted that my explanation didn't exactly cover what was happening.

> What they do is to simply repeat the color stops along the gradient  
> axis for as long as is necessary to fill the box.

Ah, yes. That is a much better way to describe what is happening there.

>> That is kind of nice behavior, even though it seems like a somewhat  
>> uncommon need. Perhaps we could eventually add a note to  
>> 'background-repeat' to explain how to tile generated images like  
>> gradients that can have a more seamless joining of tiles as with  
>> Gecko.
>
> If we want background-repeat to have this magic effect on gradients,  
> we should just say that it's achieved by repeating the color stops.  
> However, Tab's approach was to have two more gradient functions  
> (repeating-linear-gradient, repeating-radial-gradient), which I  
> think is a bit more honest.

That really seems unnecessary. I don't see a strong use case for  
repeating gradients at all, and much less so for 'list-image', 'border- 
image', etc. And for those few times that you do want to have a  
gradient repeat as a background, you would pretty much always want it  
to repeat in the most intelligent way possible, and it is pretty clear  
what that would be: magic. I can't see ANY reason why someone would  
want a repeating background gradient in which there were sharp  
divisions between the tiles because the colors didn't line up, so that  
is where it makes sense for the magic to happen.

Received on Sunday, 8 November 2009 21:24:17 UTC