Re: [gradients] basics

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 UTC