postcss-unused-var
Postcss plugin to safely remove the unused CSS var from your styles
Installation
npm install postcss-unused-var --save-dev
Usage
Refer the PostCSS Documentation for using this plugin.
Example
Input
Output
Not removing the un-used variables from
:root
as they are available acroos the site and can be access in other stylesheet as well. So they might have used in other stylesheet so its not safe to remove them