Re: recommendations to css3 draft ...

On Wed, 11 Aug 2004, Bjoern Hoehrmann wrote:

> 
> * Chris Lilley wrote:
> >BH> it'd be nice to be able to work with gradients for
> >BH> box-model backgrounds.
> >
> >Yes, it would. For this, the backgrounds model needs to offer the
> >ability to stretch an image, as an alternative to tiling it. (It already
> >offers this in CSS3).
> >
> >Then, an SVG image can be used to create a gradient as a background.
> >Replicating SVG functionality into CSS3 would be a bad direction.
> 
> Maybe it is just me, but I dislike the idea to create about six SVG
> documents for a site like <http://www.blogger.com/start> and depend
> on SVG support in background-images in the client, maintain all the
> style sheets (e.g., creating a different set of about six images to
> use them for an alternate style sheet) rather than adding few lines
> to the style sheet, just because CSS syntax for gradients would be
> a "bad direction", so, could you be more specific why it would be
> bad if web authors could use gradients for their web site using CSS
> and XHTML only? I fail to see how a CSS syntax for gradients could
> do any harm, other than maybe less demand for SVG support in XHTML+
> CSS user agents.

I think this is one of those questions where there is no clear answer, but
it is a matter of finding the right balance.

If you often need simple gradients, it is good if you can make them with
one line in CSS. On the other hand, that one line is still one more thing
to learn for CSS users, to implement for browser makers, and it makes the
code larger, so it better be used a lot.

But what kind of backgrounds do you need? Is it really just simple linear
or even radial gradients, or are they more often like the flares on the
startup screens of Mac OS X or KDE or other combinations of gradients? On
that blogger page you mentioned, e.g., I see an element where not just the
background, but also the border (integrated into the background image) is
gradated.

Note that you don't have to use SVG. Any image format will do. Since we're
talking about background images, there is no requirement that they contain
fallback text and be accessible. (SVG may lead to smaller files though. A
quick test showed that I needed some 258 bytes for a hand-written SVG
gradient and 635 for the equivalent, resolution-independent PNG gradient,
since my gradient had 154 steps in 24 bit color.)

One idea the CSS WG is exploring is to allow a designer to specify the
background and border of an element as a single image. Another property
then specifies how it is stretched or tiled: divide it in 9 parts and
stretch or tile or center each part.

This gives you a lot of flexibility, with just one or two lines of CSS and
one external image. Many designers routinely make little images that are
integrated with the design of a page. If you have an easy-to-use paint
program, that is not so bad.

(At the moment, the demand for these border/background images seems not so
big, though, and we are hesitant to put it in CSS3.)




Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos/                              W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France

Received on Wednesday, 11 August 2004 22:46:12 UTC