A command-line tool to filter CSS rules affecting specific parameters.
- Python 3.3 (older versions might work)
- cssutils pip install cssutils
cssextract --property background-image input.css output.css
Output.css contains only the CSS affecting background-image from input.css.
cssextract -p background -p background-image input.css output.css
Output.css contains only the CSS potentially affecting background image (and of course anything that background might affect.)