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

Re: Repeating gradients (Was: Re: Talk on radial gradients)

From: Brad Kemper <brad.kemper@gmail.com>
Date: Wed, 26 Aug 2009 09:54:39 -0700
To: David Perrell <davidp@hpaa.com>
Message-Id: <6A328E46-11A6-44E2-B8CB-771473E7BD94@gmail.com>
Cc: "www-style list" <www-style@w3.org>

On Aug 26, 2009, at 8:59 AM, David Perrell wrote:

> Brad Kemper wrote:
> | I feel that the emphasis for CSS gradient "images" should be on the
> | commonest cases, written simply, with little (if any) special magic
> | for how they repeat in backgrounds. It seems to me that endlessly
> | repeating radial gradients would be pretty uncommon, and should be
> | left to SVG for that. If gradient is an image type in CSS, it should
> | just behave like an image.
>
> In the case of a radial gradient, the simplest case would be  
> circular, with
> nothing but color stops, the last of which defines the encompassing  
> square.
> Dimensions would be decimal numbers from 0 to 1.

Right, although I think decimals are no more simple than percentages  
(just a bit shorter, sometimes), and percentages are a bit easier to  
recognize the meaning of than a naked number is.

Also, I think there is sufficient number of needs for fixed lengths to  
include them as well. That would be a very common use.

> The gradient would be
> considered to have no intrinsic width or height, so it would be  
> sized by
> default to fill the background positioning area (an elliptical  
> gradient when
> width != height). Repeating a small-sized gradient could be used for a
> polka-dot background or a soft-dotted line.


This is something that should be consistent with linear gradients. If  
I say that I want a 45% angle, does that assume a square that can be  
resized to a non-square, thus changing the angle dependent on the  
aspect ratio of the background area? So far, we have been assuming  
that even though the "image" would be sized to all different  
dimensions, that the angle and the fixed lengths would stay constant.

Perhaps we should just have a keyword to indicate if that is true or  
not. If not, then 45% becomes the same as 'bottom left to top right',  
and could be written much shorter. The same word would control if the  
shape was a circle or an oval (if only one radius is given, or no  
degrees). Background-size would do all the heavy lifting.
Received on Wednesday, 26 August 2009 16:55:25 GMT

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