Forum How do I...?

Styling SVG elements with external CSS stylesheet


I'm very impressed with the way Prince handles SVG. I'm wondering if it's possible to style the svg elements from an external style sheet?
e.g. if I have this in my SVG xml:
<rect class="myrectangle" x="94" y="0" width="33" height="29" rx="0" ry="0" />

And this in an external style sheet
.myrectangle {
stroke: cmyk(0,0,0,0);

How would I do something like that?

Many thanks and keep up the good work!


At the moment we don't support external style sheets for SVG, but we are planning to add this feature in a future release.
Have you made any further progress with adding external stylesheet processing for SVG images? This will be a great feature for providing consistent styling across all elements in a document.
Yes, this will be available in the next release.
When will the next release be available? Are there any betas?
We will release a beta version soon, before the end of the year.
...or after the end of the year! :)

Prince 8.0 beta is out now, and includes support for the SVG <style> element.