You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where config is a custom file I have created in the root of the project (same level as package.json)
this is my config file:
constmyPlugin={name: 'makeEverythingPink',description: 'Change all fill attribute values to pink.',fn: ()=>{return{element: {enter: (node,parentNode)=>{if(node.attributes.fill===null){return;}node.attributes.fill='pink';}}};}};module.exports={plugins: ['cleanupAttrs','removeDoctype','removeXMLProcInst','removeComments','removeMetadata','removeUselessDefs','removeEditorsNSData','removeEmptyAttrs','removeEmptyText','removeEmptyContainers','cleanupEnableBackground','convertStyleToAttrs','removeUselessStrokeAndFill','removeDimensions','cleanupIds',{name: 'removeViewBox',enabled: false},{name: 'prefixIds',params: {prefix: {toString(){this.counter=this.counter||0;return`svgo-viewbox-id-${this.counter++}`;}}}},myPlugin]};
myPlugin is an example located in svgo website, but it seems is not really working at all, I keep getting the same fill value as is declared in the original <svg /> file.
I have checked the console log for both enter: and exit: of the function, it seems to actually change the fill: 'pink' like this, but the generated svg symbols still have the original fill.
Am I doing something wrong? I am not completely sure if this is an svgo issue or a svg-symbol-sprite issue though.
The text was updated successfully, but these errors were encountered:
Hello, I am wondering if I'm doing something incorrect
I'm using the
cli
with this command:where config is a custom file I have created in the root of the project (same level as package.json)
this is my config file:
myPlugin
is an example located insvgo
website, but it seems is not really working at all, I keep getting the samefill
value as is declared in the original<svg />
file.I have checked the console log for both
enter:
andexit:
of the function, it seems to actually change thefill: 'pink'
like this, but the generated svg symbols still have the originalfill
.Am I doing something wrong? I am not completely sure if this is an
svgo
issue or asvg-symbol-sprite
issue though.The text was updated successfully, but these errors were encountered: