Automatically removing unused CSS using Grunt

added by Dean
3/5/2014 2:36:16 PM


I have previously blogged about the importance of keeping your web pages lean and the impact that unused CSS can have on your page performance. Apart from causing cluttered files, unused CSS can can slow down page load times due to the unnecessary weight of the file. Google Chrome developer tools has some great features that can help you detect any unused CSS. By using the audit feature, you can view all the CSS selectors that arent used by the current web page. This feature is really handy, but it can be tedious to manually go through each page and remove the unused CSS.