How clean is your CSS file?
Thursday October 30, 2008
When I write a review of a website, I always check to see if the CSS validates. But I almost never look at the size of the CSS file or if it's well written. I mean, if it works and makes the page look right, who cares? But then I had to work on a site with a CSS file the size of New York. Okay, maybe not literally, but wading through it felt like I was expected to walk blind-folded through New York City without a map. In desperation, and to finish the job on time, I did like every other developer had done before me. I created a bunch of id'd selectors and made my styles as specific as I could. Yes, I added to the problem. But today I learned about a Firefox add-on you can get from SitePoint that will evaluate the current page to see what selectors it has versus which are used in the CSS. This can help you with sites you maintain to keep your CSS tidy. Which keeps the downloads faster and your customers happier.


Comments
Great information
I have been using http://www.cleancss.com/ for this.