PDA

View Full Version : [CSS] Not even sure this is possible to do...


OO7MIKE
20th Jul 2008, 09:20 AM
I have been in a long and drawn out process of migration of my photography website to a new server. The process has been painful and has taken over 2 months now.

Today I found out that my database has been lost and along with it every page and post I ever made on my website. I have a back up of some of my content, but its not pretty and it wont be easy. This is unfortunate but I will use what I have and move on.

Since I have the fortunate opportunity to start fresh and new (code wise) I want to refocus my efforts to cleaning up the code on my website. I have a lot of garbage code and not a whole lot of time to clean it up. Rather than sifting through my old .css files for what is important and what is never used...

I would like to find a way to run some kind of checker program which will let me know what .css code is relevant/working/used and what can simply be deleted.

Any ideas?



Does such a thing exist?

Thrash123
20th Jul 2008, 12:07 PM
Yes and no. You could do it with some clever BASH/Perl scripting utilizing grep and/or regex. To be honest, though, I'd probably just code it from the ground up again. That's what I usually do.

TWD
20th Jul 2008, 12:34 PM
Firebug has some limited functionality in there that does that. It seems to me that the default css view shows what firebug thinks the css code should be. Hence it ignores lines that do nothing, and consolidates others (Ie turns border-bottom bordert-top etc into one border statment).

I would try looking around for a css specific editor. I'm sure that such a program would include the feature you want.