UnCSS will parse a CSS file or a collection of CSS files against a Web page.
It will then detect which CSS rules are actively used to style the aforementioned page and remove unused rules from the stylesheet.
The cleansing operation can be performed on the original CSS files, or the optimized CSS can be written to a new file altogether.
UnCSS can be used from the Node.js command-line or programmatically as a regular JS library. Requirements: