W3C home > Mailing lists > Public > www-style@w3.org > April 2008

Re: Using SVG properties in CSS

From: David Hyatt <hyatt@apple.com>
Date: Wed, 30 Apr 2008 15:17:41 -0500
To: Erik Dahlström <ed@opera.com>
Cc: "www-style@w3.org" <www-style@w3.org>
Message-id: <CBBCF2DC-9305-4C61-96CF-FFDD955FD489@apple.com>

On Apr 30, 2008, at 3:56 AM, Erik Dahlström wrote:

>
> Hello www-svg,
>
> while I find it very interesting and fun to see David Hyatt come up  
> with new syntaxes for SVG features in CSS I still think that it  
> falls short of offering the full benefits of SVG. There are a number  
> of things that make it less useful than having a full svg document  
> that you can manipulate with script, animate with SMIL and reuse  
> parts of. And that hasn't even begun addressing the concerns about  
> being able to transparently use definitions across different  
> document formats.
>
> I'm editor of two SVG 1.2 spec modules that cover filters and paint  
> servers. Both of which have corresponding CSS properties which could  
> very well be applied to other types of content than SVG, in fact  
> it's a stated goal. There are other modules in progress as well,  
> which could also apply to any content in a similar fashion.
>
> Having the CSS WG adopt the SVG properties defined in SVG 1.1 so  
> that they could be used in e.g HTML was proposed a long long time  
> ago. Now, since it seems to be on the table again in another form,  
> it seems indeed that the features are desired and I think it would  
> be good if that the proposal to allow SVG properties to be used in  
> CSS for other content was considered again, see for example threads  
> listed here[1].
>
> There's some discussion on the mozilla svg newsgroup[2] about how  
> such definitions could be made, and I believe it would be similar to  
> how CSS background images are defined with regards to intrinsic size  
> etc.
>
> It's also noteworthy to see that when it comes to resources such as  
> webfonts, it seems it's not considered a problem to download  
> additional resources, but when it comes to the same using additional  
> svg files, then it's often said to be too heavy. Besides, since  
> Webkit is already supporting downloadable SVGFonts in @font-face,  
> they should be well aware that such resources may well contain other  
> resources that could be used in the stylesheet, re-using the same  
> svg resource. My question is simply: is there any good reason why  
> this shouldn't be allowed?
>
> True, SVG is not CSS. But then again, CSS isn't meant to be SVG  
> either. At least that's my opinion.
>
> Best regards
> /Erik

While I believe CSS should define some of the more common primitives  
(gradients, masks, and yes, filters too), I think it's also reasonable  
to be able to link to the SVG equivalents in a separate SVG file for  
situations where the CSS primitives can't do what you need.  However I  
don't think SVG should be the sole way of doing gradients, filters,  
masks, etc. in CSS.  SVG is significantly more cumbersome to use in  
simple cases than the new CSS syntax in WebKit.

dave
(hyatt@apple.com)
Received on Wednesday, 30 April 2008 20:18:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:05 GMT