W3C home > Mailing lists > Public > www-style@w3.org > November 2010

[css3-images] Repeating oblique gradients

From: Leif Arne Storset <lstorset@opera.com>
Date: Tue, 30 Nov 2010 18:06:53 +0100
To: "Brad Kemper" <brad.kemper@gmail.com>, "Rik Cabanier" <cabanier@adobe.com>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, "www-style list" <www-style@w3.org>
Message-ID: <op.vmzttrogtmo5g6@nynorsk>
> 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'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.

Rik Cabanier <cabanier@adobe.com> skreiv Mon, 29 Nov 2010 20:27:42 +0100

> If a browser creator has to implement this complicated tiling for  
> gradients, he might as well implement it for all images...

Supporting various spread methods is not necessarily complicated; a  
graphics library may even support it out of the box. In that case rotating  
raster images could be a bit more work, especially considering background  
images is a very old CSS feature. As mentioned by Brad Kemper, performance  
could be an issue too.

-- 
Leif Arne Storset
Core Technology Developer, Opera Software
Oslo, Norway


proposed-spread-argument.png
(image/png attachment: proposed-spread-argument.png)

Received on Tuesday, 30 November 2010 17:09:44 GMT

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