Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Validating CSS files

I have a CSS file that has grown over time. Many of the coders have come and gone. The site has changed along the way and some of the code in the CSS is no longer being used. Is there a QUICK way to validate what is being used and what is not? I need to remove the OLD code that is no longer being used. Even if there was a "site map" method - that would prove to be even better. All suggestions please.

like image 845
Sean Avatar asked Feb 02 '11 14:02

Sean


People also ask

Do you need to validate CSS?

Note: Validation is important. It will ensure that your web pages are interpreted in the same way (the way you want it) by the various web browsers, search engines etc. as well as users and visitors of your Web site.

What is CSS validation testing?

A CSS validator checks your Cascading Style Sheet in the same manner. That is, it will check that it complies with the CSS standards set by the W3 Consortium. There are a few which will also tell you which CSS features are supported by which browsers (since not all browsers are equal in their CSS implementation).

How do I check CSS errors?

A quick way to find errors in CSS code is to install the Web Developer tool bar add-on and use the validator through the tools drop down. What's cool about this tool is you can quickly validate local files too as it will automatically upload them to the W3C validator.


1 Answers

If you use Firefox, you can use the Dust Me Selectors plugin that does exactly what you asked for. It finds unused Selectors for you :) Give it a try!

Also there is the CSS Usage plugin, that looks over your CSS file and tells you which ones are not being used. :)

like image 80
Kyle Avatar answered Sep 23 '22 17:09

Kyle