An SVGO plugin that converts presentation attributes to inline-style properties.
<g fill="#000" color="#fff" style="-webkit-blah: blah">
⬇
<g style="fill:#000;color:#fff;-webkit-blah: blah">
This is a tool to work around a bug in the Inkscape beta. In
Inkscape, if one runs "Stroke to Path" on an object, in certain peculiar edge
cases, the stroke colors are not transferred if the color is specified by the
stroke
attribute. A workaround is to use the inline style
attribute
instead.
But there of course may be other useful applications for this!
Note: This plugin will not work well if one uses <style>
elements in the SVG,
as the inline style
attribute will override it.
Just drag and drop convertAttrsToStyle.js
into the plugins directory of
SVGO.
- Clone this repository
- Install Node.js (See Installing Node.js via package manager)
- Run
make install_locally
- Copy the plugin into SVGO's plugin directory
cp plugins/convertAttrsToStyle.js svgo/plugins/
make test