Re: Gradient syntax proposal

On Aug 15, 2009, at 9:08 PM, "Tab Atkins Jr." <jackalmage@gmail.com>  
wrote:

> Yeah, I expect this too; I'm just saying that a gradient is normally
> going to be the entire size of the background-clip area.  (To be
> specific, it's the size of an SVG image without intrinsic dimensions
> used in the same context.)

That's in background-size [1]:

contain
Scale the image, while preserving its intrinsic aspect ratio (if any),  
to the largest size such that both its width and its height can fit  
inside thebackground positioning area.
cover
Scale the image, while preserving its intrinsic aspect ratio (if any),  
to the smallest size such that both its width and its height can  
completely cover the background positioning area.
[ <length> | <percentage> | auto ]{1,2}
The first value gives the width of the corresponding image, the second  
value its height. If only one value is given the second is assumed to  
be ¡®auto¡¯.
A percentage is relative to the background positioning area.
An ¡®auto¡¯ value for one dimension is resolved by using the image's  
intrinsic ratio and the size of the other dimension, or failing that,  
using the image's intrinsic size, or failing that, treating it as 100%.
If both values are ¡®auto¡¯ then the intrinsic width and/or height of  
the image should be used, if any, the missing dimension (if any)  
behaving as ¡®auto¡¯ as described above. If the image has neither an  
intrinsic width nor an intrinsic height, its size is determined as for  
¡®contain¡¯.

So basically, the default value is auto, which respects the intrinsic  
size of the image, but since there isn't one, it fills the background  
positioning area (the border box, unless changed by background-clip).

1. http://dev.w3.org/csswg/css3-background/#the-background-size

Received on Sunday, 16 August 2009 05:11:00 UTC