Re: [css3-images] Repeating oblique gradients

On Nov 30, 2010, at 9:06 AM, Leif Arne Storset wrote:

>> On Nov 28, 2010, at 11:38 PM, Rik Cabanier wrote:
>>> Yes, for tiling rotated gradients, there's a need to have a 'background-rotate' keyword which doesn't seem to exist.
> In the gradient implementation I'm working on at the moment, I've solved this by adding an optional spread argument to the gradient function, like so:
> linear-gradient(left top, repeat, orange 0%, white, blue 50%);
> The spread argument can be 'repeat', 'reflect' or 'extend' (default if not given). I called the default "extend" since it seemed more intuitive than "clamp", the internal name for it. See the attached image for a demonstration.

I don't understand. What is the difference between "extend" and "none"?

> I'm not formally proposing it yet, but if we want to repeat along the gradient line I think this is a more elegant way to express it than using 'background-repeat': what concerns only gradients can stay in the gradient function. It does require 'background-repeat: extend' in order to have visible effects.

It does require 'background-repeat: extend' ? But it is more elegant than using 'background-repeat'? Those two statements sound contradictory.

I think that repeating a pattern in one or two directions should stay in the background-repeat property, as it is already and has been for many years. It has to do it anyway; it is just a matter of whether it will do it elegantly or not. So if we look at that property, we see that for any diagonal gradient the results are ugly and unlikely to be what any author would want (generally speaking). So we can either add some magic to it to automatically turn 'background-repeat: repeat-y' into 'background-repeat:repeat-in-the-direction-of-the-gradient-angle' or something (which someone pointed out problems with some time ago, although I don't recall the specific argument), or we can add another value or two to 'background-repeat'. But the point is, once this is solved for backgrounds that use images, then it doesn't need to re-solved for the images themselves. Unless someone can prove that this is really also an important need for images in other places (like filters) that don't have their own flexibility of sizing, repeating, and moving the image around.

Received on Tuesday, 30 November 2010 17:42:59 UTC