Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update svgo config #1888

Merged
merged 8 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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