Skip to content

Instantly share code, notes, and snippets.

@alerque
Last active August 29, 2015 14:03
Show Gist options
  • Save alerque/74d6cfc91bfd67a59485 to your computer and use it in GitHub Desktop.
Save alerque/74d6cfc91bfd67a59485 to your computer and use it in GitHub Desktop.
Simple template for CSS tidy that indents with two spaces
find ./ -iname '*.css' -not -iname '*.min.css' \
-execdir csstidy {} --silent=true --template=~/scratch/csstidy.tpl --compress_colors=true --compress_font-weight=false --discard_invalid_properties=false --preserve_css=true --remove_bslash=true --sort_properties=true --sort_selectors=true --timestamp=false --merge_selectors=0 --case_properties=1 --optimise_shorthands=0 {} \; \
-execdir sed '/{$/s/\(\s*\)\([^,]\+\),/\1\2,\n\1/g' -i {} \; \
-execdir sed '/^@media/s/\(min\|max\)-width\s*\([^ ]\+\)/(\1-width:\2)/' -i {} \; \
-execdir sed "/src:/s/format(\([^')]\+\))/format(\'\1\')/g" -i {} \; \
-execdir sed 's/-\(webkit\|moz\|ms\)-\(transition\): 0 / -\1-\2: -\1-transform /g' -i {} \; \
-execdir vim +StripWhitespace +x {} \;
| {
|| {
| | |;
|}|
|
}
| ||
|
|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment