Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I remove unused CSS classes from my website project?

Tags:

css

asp.net

My project has collected CSS entropy (unused classes) during its course of development.

Now in order to keep the CSS file small, I want to remove all unused CSS references. But doing that manually involves searching for each class in the entire project. That takes time.

Do you know of any way/tool which I can adopt to find out which CSS classes are no longer used in my project, and remove it?

I am programming on ASP.NET. Visual Studio.

like image 909
Cyril Gupta Avatar asked Nov 18 '08 10:11

Cyril Gupta


1 Answers

In the Chrome Browser, press F12, go to the Audit tab, choose the "Reload page and audit on Load" option, and refresh the page. Chrome will list all the unused CSS rules.

For an online solution, go to unused-css.com.

like image 133
Ankit Avatar answered Nov 15 '22 22:11

Ankit