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

Re: [gradients] basics

From: Brad Kemper <brad.kemper@gmail.com>
Date: Tue, 10 Nov 2009 18:46:01 -0800
Message-Id: <1A276C9B-73B7-48E1-8E20-A579E4E12171@gmail.com>
To: fantasai <fantasai.lists@inkedblade.net>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, "robert@ocallahan.org" <robert@ocallahan.org>, Simon Fraser <smfr@me.com>, "news@terrainformatica.com" <news@terrainformatica.com>, www-style <www-style@w3.org>
On Nov 10, 2009, at 12:23 PM, fantasai <fantasai.lists@inkedblade.net>  
wrote:

> Now I think gradients should behave a little special in how they clip.
> They should have a size, but their clip rect should be infinite. So if
> you specify a gradient on the root element, it is sized and positioned
> as for the root element, but its paint continues beyond the box to  
> fill
> the canvas. Similarly a gradient with 'contain' should be sized to  
> that
> container, but its paint should continue to fill the entire background
> painting area.

Since the image has no intrinsic dimensions or aspect ratio,  
'contain', 'cover', 'auto', and '100%' would all have the same effect.  
The gradient image would be stretched to fill the entire background  
painting area.

> I'd even say any background-size value would size the
> gradient but not clip it unless the gradient were repeated in that
> dimension.

I don't think I'd agree. Imagine the following:

Linear-gradient(0deg, black -40%, white, black 140%)

What I expect from this is to create an image with a horizontal  
gradient, where a 0% color-stop would align with the left edge of the  
image, and a 100% color-stop would align with the right edge of the  
image. Since I specified color-stops outside that range and colored  
them black, I'd expect the color at those edges to be some shade of  
gray. With auto sizing, at least, the absolute black would not be seen.

I often use the gradient tool in Photoshop this way because it is a  
little simpler and faster to keep tweaking the extents of the gradient  
line than it is to pick new colors that are shades of some 'pure'  
color. And I'd expect the outide colors to remain clipped if I was  
using 'background-size' with a length measurement to make it smallish. 
  
Received on Wednesday, 11 November 2009 02:46:49 GMT

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