Improve svgo.yml
- Remove plugins that are already the default in svgo, and link to docs - Move the `removeDimensions` plugin to be next to `removeViewBox` - Add configuration to the `convertPathData` and `mergePaths` plugins to avoid an issue with over-aggressive optimization for arcto commands introduced in svgo v1.3.0. Also: - Add missing `--config` option to the svgo command in README - Remove over-aggressive optimization from the cv.svg flag
This commit is contained in:
parent
38065fab68
commit
69e1f8df1f
3 changed files with 12 additions and 13 deletions
|
|
@ -41,7 +41,7 @@ First, edit the relevant SVG files in the `flags/` directory.
|
|||
Then run `svgo` to optimize the SVG files:
|
||||
|
||||
```sh
|
||||
svgo ./flags --recursive
|
||||
svgo ./flags --recursive --config=svgo.yml
|
||||
```
|
||||
|
||||
Then commit the changes, and submit them as a pull request.
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><circle cx="256" cy="256" r="256" fill="#eee"/><path fill="#0052b4" d="M256 0A256.2 256.2 0 000 256.2c170.6-.1 341.7.3 512-.2A256.2 256.2 0 00256 0zM34.4 384.2A256.8 256.8 0 00260 512a257 257 0 00217.6-127.8H34.4z"/><path fill="#d80027" d="M3.6 298.9a256 256 0 0011.1 42.6h482.6a256 256 0 0011-42.6H3.7z"/><path fill="#ffda44" d="M182.8 190.4l5.2 16.4h17.1l-13.8 10 5.3 16.3-13.8-10-14 10 5.4-16.3-13.9-10h17.1zm0 213.3L188 420h17.1l-13.8 10 5.3 16.2-13.8-10-14 10L174 430l-14-10h17.2zm-99.2-72.1l5.2 16.2h17.1L92.1 358l5.2 16.2-13.7-10-14 10L75 358l-14-10.1h17.2zm37.9-119.8l5 16h17.2l-13.8 10.3 5.2 16.2-13.7-10-14 10 5.4-16.3-14-10.1H116zm-60.4 67h17l5.5-16.2 5.2 16.2h17.1L92.1 289l5.2 16.4L83.6 295l-14 10.3 5.4-16.4zm46.5 143l5.3-16.2L99 395.4h17.1l5.4-16.2 5.2 16.3h17.1L130 405.6l5.3 16.2-13.8-10zM282 331.6l-5.4 16.2h-17l13.8 10.2-5.3 16.2 13.9-10 13.8 10-5.2-16.3 13.7-10.1h-17zm-38-119.8l-5.3 16.2h-17.1l14 10.2-5.4 16.2 13.9-10 13.8 10-5.3-16.3 13.8-10.1h-17zm60.3 67h-17l-5.3-16.2-5.4 16.2h-17l13.8 10.1-5.3 16.4L282 295l13.8 10.3-5.2-16.4zm-46.4 143l-5.3-16.2 13.8-10.2h-17l-5.3-16.2-5.4 16.3h-17.1l14 10.1-5.4 16.2 13.9-10z"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><circle cx="256" cy="256" r="256" fill="#eee"/><path fill="#0052b4" d="M256 0A256.2 256.2 0 0 0 0 256.2c170.6-.1 341.7.3 512-.2A256.2 256.2 0 0 0 256 0zM34.4 384.2A256.8 256.8 0 0 0 260 512a257 257 0 0 0 217.6-127.8H34.4z"/><path fill="#d80027" d="M3.6 298.9a256 256 0 0 0 11.1 42.6h482.6a256 256 0 0 0 11-42.6H3.7z"/><path fill="#ffda44" d="M182.8 190.4l5.2 16.4h17.1l-13.8 10 5.3 16.3-13.8-10-14 10 5.4-16.3-13.9-10h17.1zm0 213.3L188 420h17.1l-13.8 10 5.3 16.2-13.8-10-14 10L174 430l-14-10h17.2zm-99.2-72.1l5.2 16.2h17.1L92.1 358l5.2 16.2-13.7-10-14 10L75 358l-14-10.1h17.2zm37.9-119.8l5 16h17.2l-13.8 10.3 5.2 16.2-13.7-10-14 10 5.4-16.3-14-10.1H116zm-60.4 67h17l5.5-16.2 5.2 16.2h17.1L92.1 289l5.2 16.4L83.6 295l-14 10.3 5.4-16.4zm46.5 143l5.3-16.2L99 395.4h17.1l5.4-16.2 5.2 16.3h17.1L130 405.6l5.3 16.2-13.8-10zM282 331.6l-5.4 16.2h-17l13.8 10.2-5.3 16.2 13.9-10 13.8 10-5.2-16.3 13.7-10.1h-17zm-38-119.8l-5.3 16.2h-17.1l14 10.2-5.4 16.2 13.9-10 13.8 10-5.3-16.3 13.8-10.1h-17zm60.3 67h-17l-5.3-16.2-5.4 16.2h-17l13.8 10.1-5.3 16.4L282 295l13.8 10.3-5.2-16.4zm-46.4 143l-5.3-16.2 13.8-10.2h-17l-5.3-16.2-5.4 16.3h-17.1l14 10.1-5.4 16.2 13.9-10z"/></svg>
|
||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
21
svgo.yml
21
svgo.yml
|
|
@ -1,20 +1,12 @@
|
|||
# Default options: https://github.com/svg/svgo#what-it-can-do
|
||||
|
||||
floatPrecision: 1
|
||||
multipass: true
|
||||
plugins:
|
||||
- removeTitle: true
|
||||
- removeDesc: true
|
||||
- removeUselessDefs: true
|
||||
- removeHiddenElems: true
|
||||
- removeDimensions: true
|
||||
- removeViewBox: false
|
||||
- removeUnknownsAndDefaults: true
|
||||
- removeUselessStrokeAndFill: true
|
||||
- removeUnusedNS: true
|
||||
- cleanupIDs: true
|
||||
- cleanupNumericValues: true
|
||||
- collapseGroups: true
|
||||
- removeRasterImages: true
|
||||
- sortAttrs: true
|
||||
- removeDimensions: true
|
||||
- removeAttrs:
|
||||
attrs:
|
||||
- 'font.*'
|
||||
|
|
@ -24,3 +16,10 @@ plugins:
|
|||
- 'text.*'
|
||||
- removeStyleElement: true
|
||||
- removeScriptElement: true
|
||||
# Avoid optimization that breaks some editors/viewers.
|
||||
# For context, see https://github.com/svg/svgo/issues/1137
|
||||
# and https://github.com/HatScripts/circle-flags/pull/4.
|
||||
- convertPathData:
|
||||
noSpaceAfterFlags: false
|
||||
- mergePaths:
|
||||
noSpaceAfterFlags: false
|
||||
|
|
|
|||
Loading…
Reference in a new issue