Comment 3 for bug 167937

Revision history for this message
sdaau (sd-imi) wrote : Re: CSS definitions being persisted in style attributes

Hi all,

Me too, +1 :)

I tried a small workaround with a Python extension for Inkscape (attached) - basically, it should iterate through all elements that have a "class" attribute, and then delete their "style" attribute - which then means, when you change the inline class, you should save and then "Revert" the file to force a refresh ( Inkscape does not seem to have a command that will refresh the file loaded in memory, without closing and reopening the file? )..

Of course, this is not much of a solution if you want to have a base class, and then add additional "overloads" in the style attribute, but for my case it helps :)

Since it was quite difficult to find basic stuff about extension (like proper syntax for iterating and such) I've left plenty of useless comments in .py file :)

PS: Since I have only option for a single attachment with this comment, I'm including the .inx file inline:

---------------
refreshcss.inx
---------------
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
 <_name>Refresh CSS</_name>
 <id>org.sdaau.refresh.css</id>
 <dependency type="executable" location="extensions">refreshcss.py</dependency>
 <dependency type="executable" location="extensions">inkex.py</dependency>
 <effect>
  <object-type>all</object-type>
  <effects-menu>
   <submenu _name="CSS"/>
  </effects-menu>
 </effect>
 <script>
  <command reldir="extensions" interpreter="python">refreshcss.py</command>
 </script>
</inkscape-extension>
---------------