Skip to content

Instantly share code, notes, and snippets.

@kribblo
Created September 20, 2017 15:03
Show Gist options
  • Save kribblo/a08a5eea7cc90734d2782197d4742357 to your computer and use it in GitHub Desktop.
Save kribblo/a08a5eea7cc90734d2782197d4742357 to your computer and use it in GitHub Desktop.
Quick one-off hack in Perl to scale some CSS properties
perl -pi -e 's/(width|height|margin-?\w*|padding-?\w*|font-size): ([\d+\.])(vw|vh|%|px)/"$1: ".sprintf("%.2f", $2*(1\/0.85)).$3/e' file.css
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment