Re: Gradients in CSS3?

Laurens Holst:
| What I mean is that, to determine the colour to draw at a certain
| position in a gradient, you need to know the total size of the gradient.
| In CSS, the height of a block is usually determined by the content,
| which can be loaded incrementally. In the case of inline blocks and
| floats, the width is, too.
|
| So, if you have the background or borders of that block be a gradient,
| they have to be redrawn all the time. Especially in the case of a
| gradient background, that means redrawing all the contents. If I apply a
| gradient to the background of my website (probably not an uncommon thing
| to do), that means continuous reflows.

1) Does this differ to using an SVG background for the gradient, in
combination with the new background-size property? [1] Would that not
suffer form the same problem?

2) The example of the @rule for predefining gradients is interesting,
and it may well be the case that future advancement in CSS is going to
happen using this kind of syntax just to accommodate the complexity,
so I've got no object to doing it this way. It really does depend on
how advanced we want it to be. If the consensus really is that we want
to offer more advanced gradient control (>2 colours, start/stop
positions and so forth) then sure, I completely agree that splitting
it into @rules is tidying and beats adding one huge function (or many
new properties) into the standard CSS (plus it's reusable).

3) That said, we're already saying that any CSS gradients
implementation will not have the same capabilities as SVG (everyone
seems to agree on this, luckily!). Since we're requiring a jump to SVG
for more advanced gradients and backgrounds, I think it makes much
more sense to keep the CSS syntax small and convenient (at the expense
of >2 colours and so forth) than to add a quite chunky graphics syntax
to the language.

If this is really going up for WG consideration (will it?), it would
definitely be worth polling a wider community than this list for
feedback on the limits of the functionality. I remember when multiple
backgrounds was raised, Ian Hickson for one blogged about the syntax
for wider views (in fact, it's that post that got me onto this list).
This sort of feature should be opened up in a similar way, I think.

[1] http://www.w3.org/TR/2005/WD-css3-background-20050216/#background-size

Ben
http://ben-ward.co.uk

Received on Tuesday, 16 August 2005 00:06:12 UTC