In case any one is using the Sketch App
. With the svgo plugin for sketch and the following settings, Elements just works with the resulst out of the box. No more tweaking necessary. All the plugins below are based on the default once, but since adding a new one removeDimensions
would overwrite the default settings those others have to be re-added.
I tested it and it worked for me in general. If you want to use a SVG without that compression you need to disable the plugin again.
If you export a single symbol it works if the color is #000000
if you have multiple symbols or like a color specified it keeps the specified once.
Settings
module.exports = {
js2svg: {
indent: 2,
pretty: true,
},
plugins: [
{
name: 'preset-default',
params: {
overrides: {
inlineStyles: false,
removeViewBox: false,
cleanupEnableBackground: false,
removeHiddenElems: false,
convertShapeToPath: false,
moveElemsAttrsToGroup: false,
moveGroupAttrsToElems: false,
convertPathData: false,
},
},
},
'convertStyleToAttrs',
'cleanupListOfValues',
'sortAttrs',
'removeDimensions',
],
};