Re: [css3-images] Repeating oblique gradients

On Dec 2, 2010, at 9:59 AM, Tab Atkins Jr. wrote:

> On Thu, Dec 2, 2010 at 9:02 AM, Brad Kemper <> 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.

I certainly don't see why not. CSS is largely about making pages pretty. This is something simple we can do to aid that. And there is no "instead". You are still tiling, and still rotating. It is just that you are rotating in background plane after the tiling, instead of rotating in the image before the tiling.

>> 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.)

There's no logical inconsistency. There is only a specialized behavior for a specialized problem.

>> 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.

Yeah, you snipped out the part where I explained why this is important to this discussion.

>> 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.

It makes just as much sense for 'space' as for 'repeat'. In other words, a lot of sense. Therefore we should have special rotation behavior. So there.

Received on Thursday, 2 December 2010 18:34:38 UTC