Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. # Automatically optimize and inline ALL styles
  4. # svgo_it.sh my.svg
  5.  
  6. main() {
  7. local input=$1
  8. local precision=${2:-2}
  9. # Move ALL styles to inline
  10. local config='{ "plugins": [{ "inlineStyles": { "onlyMatchedOnce": false } }] }'
  11.  
  12. svgo -i "$input" -o "${input}.opt.svg" --precision="$precision" --multipass --config="$config"
  13. }
  14.  
  15. main "$@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement