Created
September 4, 2019 18:52
-
-
Save jgillman/62cc48896aced8cd25053145ade7b93e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Automatically optimize and inline ALL styles | |
# svgo_it.sh my.svg | |
main() { | |
local input=$1 | |
local precision=${2:-2} | |
# Move ALL styles to inline | |
local config='{ "plugins": [{ "inlineStyles": { "onlyMatchedOnce": false } }] }' | |
svgo -i "$input" -o "${input}.opt.svg" --precision="$precision" --multipass --config="$config" | |
} | |
main "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment