2 replies [Last post]
weborganix
Offline
newbie
Last seen: 8 years 41 weeks ago
Joined: 2005-11-06
Posts: 4
Points: 0

Hey there...
I did a search in the forums... didnt find anything.

But I dont know about u guys but i have some big projects going that have long style sheets. Often i realize that there are some styles that are no longer being called via my markup.

Is there a utility out there that can identify what styles are not being used - or being used... for a current document?

I was checking out FF extensions to see if there was anything for that specifically - no luck yet.

Thanks! Cleaning em up by hand gets to be cumbersome cuz I gotta remove styles and check the markup in the browser to see if i axed anything i shouldnt have.

Cheers!

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 32 weeks 3 days ago
London
Joined: 2004-06-06
Posts: 15650
Points: 2788

Utility to clean up unused styles

Thats part and parcel of hand coding Smile

If you keep a tight and disciplined rain on your styles then it shouldn't be a problem, generally if you have decided that rule set is no longer needed you would have commented it out and written new ones retaining the old ones in case you need to revert, if you don't actually clean up as you go along then you just have to be prepared to slog through at the end and tidy things up.

You shouldn't really reach a point where you have live styles that are not actually being used as such; you should deal with them at the time.

There is as far as I'm aware no utility as such that can read a stylesheet and determine what styles are in use and clean up those that aren't.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

weborganix
Offline
newbie
Last seen: 8 years 41 weeks ago
Joined: 2005-11-06
Posts: 4
Points: 0

Utility to clean up unused styles

Ok - Thanks Hugo.

I do hand code... but I often use style sheets from other templates and use only certain styles in the new template. I agree with you 100% and thats how i have been doing it as of late, by hand.

However- I still think it is a gr8 idea for a utility.
CSS CLEANUP could be the name...

hehe - take care.

Love the site btw.