Skip to content

Instantly share code, notes, and snippets.

@tzi
Created June 16, 2016 16:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tzi/580df8ec040990e0e741ec0a3c24211e to your computer and use it in GitHub Desktop.
Save tzi/580df8ec040990e0e741ec0a3c24211e to your computer and use it in GitHub Desktop.
# How to search the "z-index" values of your CSS project
git grep -h "z-index" | sed -E "s/.*z-index\s*:\s*(-?[0-9]+).*/\1/" | sort | uniq -c | sort -b -r
# Explanations
# git grep -h "z-index"
# -> Find every line of your project that contain "z-index"
# sed -E "s/.*z-index\s*:\s*(-?[0-9]+).*/\1/"
# -> Only keep the property value
# sort | uniq -c | sort -b -r
# -> count the number of occurrences by value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment