Gradients and background-repeat (Was: Re: Automatic spec annotations)

What does this have to do with the subject line?

On May 11, 2011, at 10:24 AM, Brad Kemper wrote:

> 
> On May 10, 2011, at 2:07 PM, Tab Atkins Jr. wrote:
> 
>> On Tue, May 10, 2011 at 11:34 AM, Brad Kemper <brad.kemper@gmail.com> wrote:
>>> BK:
>>> I disagree that using a special version of linear-gradient to make
>>> backgrounds repeat is "the obvious" way. The obvious way to repeat
>>> backgrounds is with background-repeat. And that is what most of the ones I
>>> looked at did.
>> 
>> Like I said, mostly for bandwidth savings, as the point of the
>> patterns gallery is to create images that are smaller than the
>> equivalent PNG would be.
> 
> I don't know what makes you so sure you know the minds of the authors there. It seems more likely to me that they used background-repeat because that is the obvious and familiar way to repeat a background, whether it is a stripe, a star, a wave, or whatever.

As I've said before, I think background-repeat should only ever affect axis-aligned, tiled backgrounds (i.e. repeating a rectangular image on an x-y grid). Because of this, it's not suitable for repeating gradients, which may be linear at an angle, or radial.

> 
> 
>> For argyle, the two layers that use background-repeat *cannot* be
>> replaced by repeating-linear-gradient - they're setting up the
>> checkerboard, which employs a completely different technique.
> 
> The bigger question is whether any of the few using 'repeating-linear-gradient' cannot be replaced by 'background-repeat'., since I am not questioning whether or not 'background-repeat' is necessary; I am questioning whether or not  'repeating-linear-gradient'  is really necessary.
> 
> I think that angles other that are not multiples of 45deg are harder to do with 'background-repeat'. But for the hard cases of repeating arbitrary gradient angles via the familiar background-repeat (and related properties), I would prefer to see something like 'background-rotate: [<angle> | auto]', where 'auto' means rotate the background by the gradient angle and make the actual gradient in the image vertical. That seems more useful and forward looking than to have a separate special version of linear-gradient that does repeating in a new different way than what we are familiar with already in backgrounds.
> 
>> Otherwise, the patterns that can potentially use repeating gradients
>> are tartan, madras, blueprint grid, tablecloth, and the three stripes.
>> Of those, blueprint grid, tablecloth, and horizontal and vertical
>> stripes can also potentially use background-repeat, and they do.  
> 
> I think all of those could use background-repeat, actually. On some of them, using repeating-linear-gradient might save some bytes, but so would the stripe generator you are considering, and so would 'background-rotate' (which is desirable for other reasons as well). I just don't see a strong need for 'repeating-linear-gradient'. And of course, there is considerably less need for 'repeating-radial-gradient', other than for symmetry and consistency of properties if you do have a repeating-linear-gradient property.
> 
>> That said, on Chrome Linux at least, blueprint grid has messed up
>> spacing, and I think it would be a lot easier to understand in general
>> if it just used four repeating linear gradients (if we had a stripe
>> generator, doing it as two would be reasonable, but it's too verbose
>> to do that with the gradient generator).
> 
> Well, sure, a stripe generator would be a more reasonable way of generating stripes than a gradient generator. But then your use cases for 'repeating-linear-gradient' from this site go away. I don't find the rule for "blueprint grid" difficult to decipher. It is one of the easier to read patterns of that site. And Safari's Webkit nightly on Mac renders it fine.
> 

Simon

Received on Wednesday, 11 May 2011 23:14:15 UTC