Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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 "$@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement