You could ask in that topic if a reverse method could be created, converting the inline style info into separate attributes (referring back to this topic).
One thing that sounds like a bug: While Inkscape reads the XML attribute, it does not change it, and just adds the CSS attribute with a different color.
This results in two different colors for the same object, making the color dependent on the order of preference a renderer assigns to these
Hello,
for an iOS app, I am trying to change the color in an existing file. This file uses `fill=#00bb00` to specify colors.
When I edit the file with Inkscape, this attribute still persists, and a new attribute is added: `style="fill:#ff0000`.
Browsers and the macOS finder see this `style` attribute, but neither Xcode not the iOS or macOS SDKs do.
Is there a way I can tell Inkscape to use the `fill` attribute?
A full description of the issue can be found here: https://github.com/below/SVGSample
Thanks for you help!
In a related topic, style info was converted to inline (opposite of your situation). https://inkscape.org/forums/questions/svgs-import-but-dont-display-correctlyfully/
You could ask in that topic if a reverse method could be created, converting the inline style info into separate attributes (referring back to this topic).
Convert CSS attributes to XML attributes is an option in save as optimised SVG.
One thing that sounds like a bug: While Inkscape reads the XML attribute, it does not change it, and just adds the CSS attribute with a different color.
This results in two different colors for the same object, making the color dependent on the order of preference a renderer assigns to these
Following on to Aeros post
It might be an idea to try this first
https://jakearchibald.github.io/svgomg/
Which is a front end (can be run locally too) for https://github.com/svg/svgo
Brute force methods.
For a single object:
For multiple objects, just fill and stroke rewriting: