W3C home > Mailing lists > Public > www-style@w3.org > December 2010

Re: [css3-images] Repeating oblique gradients

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 2 Dec 2010 09:59:03 -0800
Message-ID: <AANLkTikOm4hFyS927RcyAyOsa20QOZyzBPL6Sy=6FRTS@mail.gmail.com>
To: Brad Kemper <brad.kemper@gmail.com>
Cc: Simon Fraser <smfr@me.com>, www-style list <www-style@w3.org>
On Thu, Dec 2, 2010 at 9:02 AM, Brad Kemper <brad.kemper@gmail.com> wrote:
> On Dec 1, 2010, at 5:42 PM, Tab Atkins Jr. wrote:
>> It also avoids having magic behavior tied to background-repeat, where
>> setting 'repeat' on a linear gradient tiles and then rotates the whole
>> layer, while setting it on radial gradients just tiles.
>> background-repeat stays consistent and orthogonal in its behavior.
>
> It's no more magic than anything else, other than that it adjusts its behavior based on information the image provides. Similarly, 'background-size:auto' dimensions an image tile based on information that raster images provide; is that horrible "magic"? Is it non-consistent that raster images that don't contain the same sort of information that would be relevant to 'background-size' don't somehow apply it anyway?

Difference of degree.  I consider it perfectly okay to have a sizing
property pay attention to inherent sizing characteristics in the sized
object.  I don't consider it okay for a property value that appears to
be all about tiling instead rotate certain types of images because it
determines that that particular type of image would be prettier
rotated.


> Radial gradients don't present the same problems when background-tiling that linear gradients do.
>
>> Finally, it ensures feature parity between the two types of gradients
>> - you can tile *or* repeat both gradients.
>
> Not as nicely.
>
>> (And, of course, this is all dependent on me actually uncommenting the
>> section on repeating gradients.)
>
> Even if you do add repeating gradients, that is still repeating within each image tile. How on earth does this prevent you from tweaking how 'background-repeat' tiles each linear-gradient tile? If 'background-repeat' was adjusted to deal better with tiles having an angled linear gradient, you would *still* be able to tile *or* repeat both gradients.
>
> Your argument is circular: you say that we can't fix the way linear-gradient images are tiled because then you would have to change radial gradients too for consistency, but we can't change radial gradients too because it would be nonsensical and unneeded and wouldn't even make them multiple tiles any more, and therefore is inconsistent.

Dude, that's not a circular argument, that's just a normal argument
exploiting a structure similar to reductio ad absurdum.  If assuming X
leads to a logical inconsistency somewhere else, then X was wrong.
(Since we're not doing strict logical proofs I can't assert that ~X
must be true, but I can take it as evidence against X.)


> Using background properties to tile gradients is a powerful feature that should not be dismissed to out-of-hand. Consider the following:
[snip]

I don't disagree at all.  Tiling gradients is useful, yes.


> Or a small variation:
>
>  DIV {
>        background-image: url(h-groove.png);
>        background-image: linear-gradient(90deg, #999, #ddd 5px, white );
>        background-size: 100% 75px;
>        background-repeat:space;
> }
>
> With this version, the background size remains fixed, and the UA doesn't even need to know about 'background-size' if it is using the raster image (progressive enhancement, again). I don't get an exact number of tiles, but with more modern UAs that understand the linear-gradient and 'background-repeat:space' I do get them evenly spaced tiles at an approximate height.

Ah, I always forget about the 'space' value.  That serves the purposes
of my 'consistency' argument well.  'space' tiles the source image,
like all the other background-repeat values, then inserts empty space
between the tiles.  I don't think it makes much sense for 'space' to
rotate a linear gradient.  But it doesn't make much sense for only
'repeat' to have the special rotation behavior either.  So, we
shouldn't have special rotation behavior.

~TJ
Received on Thursday, 2 December 2010 17:59:57 GMT

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