From 7d74c64f7567cfd5509e6c92870a2a93dd09b4ae Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 31 Mar 2016 16:29:05 -0700 Subject: [PATCH] Add hackish tool for finding unused CSS. --- tools/find-unused-css | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 tools/find-unused-css diff --git a/tools/find-unused-css b/tools/find-unused-css new file mode 100755 index 0000000000..86c5b771f7 --- /dev/null +++ b/tools/find-unused-css @@ -0,0 +1,8 @@ +#!/bin/bash +# Hackish tool for attempting to find unused IDs / classes in our CSS + +for n in $(perl -lne 'print $1 while /[#.]([a-zA-Z0-9_-]+)/g' static/styles/zulip.css | sort -u); do + if [ $(git grep "$n" | grep -v '^static/styles/zulip.css' | wc -l) -eq 0 ]; then + echo $n + fi +done