diff --git a/svg-sprite.json b/svg-sprite.json index 9c6bdc8819..5fbad8ae71 100644 --- a/svg-sprite.json +++ b/svg-sprite.json @@ -20,6 +20,7 @@ "params": { "overrides": { "removeUnknownsAndDefaults": { + "keepDataAttrs": false, "keepRoleAttr": true }, "removeViewBox": false @@ -33,7 +34,6 @@ "params": { "attrs": [ "clip-rule", - "data-name", "fill" ] } diff --git a/svgo.config.mjs b/svgo.config.mjs index 4f4c9e28bd..bcc32b0019 100644 --- a/svgo.config.mjs +++ b/svgo.config.mjs @@ -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' ] }