From 2488438d902ea7ef8930d0bb6eb8d71a744b3610 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Tue, 21 Apr 2020 13:55:15 +0000 Subject: [PATCH] tools: Convert fix-unused-css to look at zulip.scss. This tool is hackish and incomplete, but it's still worth looking at if somebody wants to hunt down obsolete CSS. There are probably better ways to tackle this problem, so we should eventually just remove this tool, but it's pretty low maintenance. Current output looks like this: $ ./tools/find-unused-css actions_hovered actions_link bookend_tr btn-skip company-name flatpickr-months label_for_text loading_more_messages_indicator_box loading_more_messages_indicator_box_container logoimage messages-collapse messages-expand numInputWrapper page_loading_indicator_box page_loading_indicator_box_container skinny-user-gravatar sp-input summary_colorblock summary_row summary_row_private_message tutorial-done-button --- tools/find-unused-css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/find-unused-css b/tools/find-unused-css index d5e90e1c6c..e79c9e13aa 100755 --- a/tools/find-unused-css +++ b/tools/find-unused-css @@ -1,8 +1,8 @@ #!/usr/bin/env 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 -cv '^static/styles/zulip.css')" -eq 0 ]; then +for n in $(perl -lne 'print $1 while /[#.]([a-zA-Z0-9_-]+)/g' static/styles/zulip.scss | sort -u); do + if [ "$(git grep "$n" | grep -cv '^static/styles/zulip.scss')" -eq 0 ]; then echo "$n" fi done