Quote:
Originally Posted by kovidgoyal
CSS is specific to web browsers, not SVG.
|
I met styling of SVG just a few days ago. So sorry. Now I'm probably going to say something very dumb...
But did not SVG actually ordinarily use CSS? I mean: in SVG you can write styles (directly using "style" attribute, or by declaring styles in "style" element, and then refering them via "class" attribute)... And the whole thing is called "CSS"... See for example:
https://www.w3.org/TR/SVG/styling.html#StylingUsingCSS
Calibre itself has just now in version 7.8 started to move styles defined in SVG to CSS files (referenced from HMTL) during conversion... (So the "HTML CSS" and "SVG CSS" is mixed in one place...) And that, to my slight surprise, really works... At least in Calibre. Styles defined in external CSS file are successfully applied to displayed SVG images.
So couldn't the renderer also interpret the styles? (In the perfect fairy world.) After all, isn't it the same task as when displaying SVG images (in the editor preview, or in the reader...)? Isn't it simply a matter of "visualization" of SVG in both cases?