I am using some interactive/dynamic SVG on my site and as a feature we have an option to download the .svg file as-is.
One problem we discovered is that when external stylesheets are used, the styles get lost if the user, say, tries to open the file in Inkscape. So I have been styling fill and stroke colors, etc., inline on the elements.
I am wondering about the SVG standard and how stylesheets fit into it. Are .css files designed to be transported with the .svg file? I understand you can declare external stylesheets like so:
<?xml-stylesheet type="text/css" href="mystylesheet.css" ?>
Will most vector graphics software recognize and load this if they are in the same folder? It seems Illustrator doesn’t have initial support for SVG but has add-ons that include JavaScript and CSS3 engines.
I can’t help but feel like everyone has missed the SVG boat. Has anyone had success doing something like, packaging the .svg with a .css for download and trying this out in various vector graphics programs? What do programs like Inkscape typically do when they save SVG, as there are obviously several ways to assign styles?
I found a few documents from W3C about SVG viewer conformance that clear some of this up:
SVG Viewer Conformance
Styling with CSS
Styling Alternatives
Common Facilities Used by SVG and CSS
I saw this line,
which makes me believe that only SVG viewers that support CSS (as opposed to presentation attributes) are required to support external stylesheets – so basically just browsers.
I would still like to have a list of SVG software packages and whether each supports external stylesheets as well as how they assign styles, but maybe I will have to do this research for myself.