SHARE
TWEET

Untitled

a guest Sep 15th, 2019 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 "$@"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top