Re: Background-repeat:extend (for gradients)

On Thu, Mar 18, 2010 at 8:15 AM, Brad Kemper <brad.kemper@gmail.com> wrote:
> In fact, since backgrounds are the place where repeating the gradient is more useful, I would prefer to remove repeating-linear-gradient() and repeating-radial-gradient() from CSS Images and just have repeating handled by 'background-repeat', with some special behavior to deal with the repeat not always being horizontal or vertical.
>
> Instead, we can simply say that for 'background-repeat:repeat-y' that the gradient repeats in the direction of the gradient path, and for 'background-repeat:repeat-x' that the gradient repeats in a direction perpendicular to the gradient path (for radial gradients, it would repeat radially for any of these three values).

Neither of those value seem at all obvious, and would even be
confusingly contradictory for horizontal gradients, where repeat-y
makes it repeat horizontally.

I'm also not sure what you mean for it to repeat in a direction
perpendicular to the gradient path.

> For border-image, I don't see the non-infinite repeatability of non-horizontal and non-vertical gradients to be an issue of great concern, and for list-style-image it is no concern at all.

I think repeating gradients are a niche case anyway.

> Having background-image-repeat work this way would simplify CSS Images, and avoid redundant ways to do the same thing: repeating a sized gradient using background-repeat, as one would normally expect to work (at least with horizontal and vertical it would look good and be very useful), or by using a special version of the image functions. As the CSS Design Principles state:
>
> "The CSS properties are kept independent of each other to the largest extent possible and there is generally only one way to achieve a certain effect."
>
> http://www.w3.org/TR/2009/CR-CSS2-20090908/intro.html#design-principles

That design principle is *precisely* why I think reusing
background-repeat and giving some of the values special meaning is
wrong.  Doing that is tying two properties together (well, a property
and a particular type of value) in a very specific way different from
how the property treats all other values of similar type.

Having both background-repeat and repeating-*-gradient does mean that
there are two ways to have a vertical or horizontal gradient repeat,
but that's a small price to pay for the fact that the two ways produce
*different* results for all other gradients.

(Note, again, that repeating-*-gradient() is not in the draft at the
moment, except for an overlooked mention at the very end in an
example.)

~TJ

Received on Thursday, 18 March 2010 16:14:22 UTC