A Python script to find unused CSS classes.
Install it with:
pip install cssutils
In def main(), edit the paths:
html_directory = '/path/to/html/dir'
css_files = [
'/path/to/css/styles.css',
'/path/to/css/bootstrap.css'
]
Then execute the script. The report with name unused_css_report_{timestamp}.txt is output in the same folder where the Python script is run from.
The blog post: Find unused CSS with Python
This project is made available under a GPL3 licence -- see COPYING for the full text.