W3C home > Mailing lists > Public > www-svg@w3.org > November 2004

Re: Reconsider SVG 1.2

From: Philippe Lhoste <PhiLho@GMX.net>
Date: Wed, 17 Nov 2004 15:59:45 +0100
Message-ID: <419B6761.1070709@GMX.net>
To: Jon Ferraiolo <jon.ferraiolo@adobe.com>
CC: ronan@roasp.com, Anne van Kesteren <fora@annevankesteren.nl>, www-svg@w3.org

Jon Ferraiolo wrote:
 > My personal opinion is that:
 > 1) It was a mistake for SVG 1.0 (with the emphasis on "1.0") to support
 > CSS at all, even on an optional basis. Virtually no real-life SVG
 > content uses CSS today. (As you point out, CSS is an optional feature in
 > SVG, and the Tiny profile does not allow it at all.)

Really? This is quite surprising. You are probably right, knowing well 
the market, but I find CSS can help SVG authoring.

I have quite mixed feelings about CSS in SVG.

On the minus side:

- CSS is a big and complex specification, adding to an already big and 
complex spec. (SVG).

- If you know nothing to CSS when starting to learn SVG (unlikely, but 
why not?), it is another spec. to learn.
Even if not all of CSS is needed, I think (but may have missed) that SVG 
fails to indicate in one location which parts are requested (must be 
Actually, a CSS sub-specification would be useful, with the required 
parts, and the related parts (general rules/syntax, etc.).

- It is hard to implement, and perhaps some implementers get exhausted 
trying to implement the whole spec. (selectors...) while only part of it 
is needed (correct me if I am wrong here).

- It is not XML. Not a biggie for me, but some people complains about it.

- It is often misused, replacing attributes while it belongs more (IMHO) 
to separate style sheets.

On the plus side:

- If you don't know CSS, it is always good to know it, it is useful... 
If you already know it, SVG then rely on well known syntax.

- It can be a precious shortcut, adding lisibility and consistency.
Recently, I saw some SVG GIS code and I recommended to the author to use 
stylesheets, as it would has cut down dramatically the size of his 
document and made it easier to maintain:

<style type="text/css">
text { font-family:sans-serif; stroke:none;fill:black; }
text.Middle { text-anchor:middle; }
text.S10 { font-size:10pt; }
text.S8 { font-size:8pt; }
text.S7 { font-size:7pt; }
<text id="petit_texte_1" x="55" y="25" class="Middle S10">Description</text>
<text id="pt_sec_azote_1" x="632" y="140" class="Middle S7" 
<text x="25" y="284" class="S8">10</text>

seems better than repeating all the above attributes (font-family, 
stroke, fill, font-size, text-anchor) in each and every text element 
(there were numerous).

That's why I am surprised by your statement that CSS is rarely used in 
real world documents.

Perhaps SVG could have made a functionnality like CSS in pure XML form, 
thus avoiding complains from various sides (implementors, script 
writers, CSS guys)...
Then again, it would have been reinventing the wheel, and Ian would have 
complained for that anyway ;-)

Philippe Lhoste
--  (near) Paris -- France
--  Professional programmer and amateur artist
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --
Received on Wednesday, 17 November 2004 15:02:19 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:29:24 UTC