Skip to content

Commit

Permalink
Update svgo config (#1888)
Browse files Browse the repository at this point in the history
Make use of `removeUnknownsAndDefaults`'s option `keepDataAttrs` to remove data attributes
  • Loading branch information
XhmikosR committed Dec 11, 2023
1 parent 51eb00c commit 1613e13
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion svg-sprite.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"params": {
"overrides": {
"removeUnknownsAndDefaults": {
"keepDataAttrs": false,
"keepRoleAttr": true
},
"removeViewBox": false
Expand All @@ -33,7 +34,6 @@
"params": {
"attrs": [
"clip-rule",
"data-name",
"fill"
]
}
Expand Down
8 changes: 4 additions & 4 deletions svgo.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ export default {
params: {
overrides: {
removeUnknownsAndDefaults: {
keepRoleAttr: true
keepDataAttrs: false, // remove all `data` attributes
keepRoleAttr: true // keep the `role` attribute
},
removeViewBox: false
removeViewBox: false // keep the `viewBox` attribute
}
}
},
// The next plugins are included in svgo but are not part of preset-default,
// so we need to enable them separately
// so we need to explicitly enable them
'cleanupListOfValues',
{
name: 'removeAttrs',
params: {
attrs: [
'clip-rule',
'data-name',
'fill'
]
}
Expand Down

0 comments on commit 1613e13

Please sign in to comment.