W3C home > Mailing lists > Public > www-style@w3.org > May 2011

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

From: Brad Kemper <brad.kemper@gmail.com>
Date: Fri, 13 May 2011 10:05:01 -0700
Cc: Simon Fraser <smfr@me.com>, www-style list <www-style@w3.org>
Message-Id: <38A788CF-9CF5-4D5E-931A-65F992304B0C@gmail.com>
To: Tab Atkins Jr. <jackalmage@gmail.com>

On May 12, 2011, at 1:23 PM, Tab Atkins Jr. wrote:
>> What other property? background-image? Oh, come on. Having an image that
>> adapts its output so that two tightly integrated background properties can
>> work together is not evil magic. SVG adapts its output resolution based on
>> 'background-size', doesn't it? Is that magic bad too? When a linear-gradient
>> with 'bottom left' in it adjusts its gradient angle based on the size from
>> 'background-size' or 'width', how is that magic so much better than having
>> linear-gradient with '30deg' in it adjust its gradient angle based on a
>> single value in 'background-rotate'?
> The other two are one property controlling some simple concept (the
> size of the canvas), and then another thing (SVG, gradient) reacting
> to that concept. 

Not that different with my idea. One property (background-rotate) is controlling the rotation of the canvas, and another thing (gradient) is reacting to that concept. The fact that the property determines what 'auto' means based on information from the image, is no worse than a value of 'background-size' determining what 'auto' means based on information from a raster image.

> I thought my reasoning was clear - I just don't think it's a very good
> idea, in objective terms.  

You can think so, but I don't. The line between what you call magic or not seems very arbitrary and blurry, and not backed up by any kind of reasonable consistent logic.

> The fact that it's tightly integrated with
> backgrounds is part of the badness.

Bizzarre. Whatever damage you think this 'magic' causes would have a very limited effect, because it is just two background properties that affect each other, just as any other two background properties will affect each other. For instance, the actual x/y positioning of each drawn background tile in an element is affected by values from 'background-position', 'background-repeat' ('space', 'round'), 'background-origin', 'background-size', etc. These properties are all designed to work well together, and that is what I am proposing too, that 'background-rotate' and 'background-image' could also be designed to work well together.

> Anyway, I'm not going to take this approach unless the WG overrides me.

Exactly. You made up your mind when you first heard the early versions of the idea, and no amount of argument or logic or changes to the idea will let you budge. But anyway, I don't expect you to do anything about 'background-rotate', as that would be part of a newer background module anyway, which you are not working on. The point was simply that the repeating versions of gradients are unnecessary. The only need they fulfill is already being mostly met by background-repeat, and which could be even more fully met with a new 'background-rotate' property. 

And by the way, even if there was not a 'background-rotate: auto' that worked as I described, that need would still be met by 'background-repeat: <angle>', but just a little less elegantly, as the author could set the gradient angle to zero himself, and then enter the angle he wants into background-rotate directly. Et voila, gradients aligned to x/y axes, repeated, and then rotated. Do you also deny that 'background-rotate' (or perhaps 'background-transform', though I think that would be overkill) would be good to have on general principles, even if not used with gradients?
Received on Friday, 13 May 2011 17:05:32 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:45 UTC