Does not convert CSS attributes to XML attributes when saving Optimized SVG

Steps to reproduce:

  • Open SVG with fill style (see source.svg)
  • Save as…
  • Save as type: Optimized SVG
  • Check Convert CSS attributes to XML attributes

What happened?

  • The file is saved as it is.

What should have happened?

  • The file should have converted fill style to the XML attribute (see expected.svg).
  • According to tooltip "Convert styles from style tags and inline style='' declarations into XML attributes." I would expect the behaviour to transform <style>.cls{fill:#f00;}</style><path class="cls" ... to <path fill="#f00" ....
  • Another possibility is to convert to inline style: <path style="fill:#f00" ..., AFAIK the Illustrator has this capability.

Motivation

  • There are some libraries and frameworks that have limited SVG support, also from performance reason, e.g. flutter, see usvg.

Inkscape Version and Operating System:

  • Inkscape Version: Inkscape 0.92.4 (5da689c313, 2019-01-14)
  • Operating System: Windows 10
  • Operating System version: 1803
  • Operating System edition: Windows 10 Enterprise

source.svg expected.svg

Edited by Jonathan Neuhauser
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information