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
This commit is contained in:
Steve Howell 2020-04-21 13:55:15 +00:00 committed by Tim Abbott
parent 62c0ab3f9d
commit 2488438d90
1 changed files with 2 additions and 2 deletions

View File

@ -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