admin管理员组文章数量:1421190
I have removeAttrs set to true, I would like to remove all fill, and color:
{
loader: 'svgo-loader',
options: {
plugins: [
{ removeNonInheritableGroupAttrs: true },
{ collapseGroups: true },
{ removeAttrs: true },
],
},
},
But I don´t know how to specify attrs to remove in there...
I have removeAttrs set to true, I would like to remove all fill, and color:
{
loader: 'svgo-loader',
options: {
plugins: [
{ removeNonInheritableGroupAttrs: true },
{ collapseGroups: true },
{ removeAttrs: true },
],
},
},
But I don´t know how to specify attrs to remove in there...
Share Improve this question edited Apr 21, 2017 at 19:41 Robert Longson 125k27 gold badges267 silver badges253 bronze badges asked Apr 21, 2017 at 9:33 palyxkpalyxk 3512 gold badges5 silver badges17 bronze badges 5- removeUselessStrokeAndFill ?? – Sahil Dhir Commented Apr 21, 2017 at 9:35
- No remove useless stroke and fill i have tried.. – palyxk Commented Apr 21, 2017 at 9:37
- Please provide full code – Sahil Dhir Commented Apr 21, 2017 at 9:41
- thats cool :) :) – Sahil Dhir Commented Apr 21, 2017 at 9:51
- 1 Could somebody enlighten me as on how to use this on the mand line? I want to get rid of a lot of 'forbidden' data-name attributes in a bunch of SVG files. “svgo . enable=removeAttrs data-name” doesn't work. – Ideogram Commented Aug 24, 2017 at 7:21
1 Answer
Reset to default 5I solved it like this:
{
loader: 'svgo-loader',
options: {
plugins: [
{ removeNonInheritableGroupAttrs: true },
{ collapseGroups: true },
{ removeAttrs: { attrs: '(fill|stroke)' } },
]
}
}
本文标签: javascriptsvgo removeAttrs how to specify attrs to removeStack Overflow
版权声明:本文标题:javascript - svgo removeAttrs how to specify attrs to remove - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745348561a2654621.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论