7

I'd like to compare my CSS files with the classes that I'm actually using in the site, and generate a new CSS file that contains only those classes. The point being to get rid of classes that I'm not using.

I previously used the Dust Me Selectors extension for FireFox to find the used and unused CSS selectors but it doesn't work in FireFox 6 any more.

Are there any alternatives?

5
  • I think you should know where your css styles are... even if you find them using some tool as you assume, you will still need to find them in code to remove them, or i dont get your question right Commented Sep 8, 2011 at 12:35
  • 2
    @Gatekeeper Sometimes things do get away from you, especially if you inherit something someone else was doing. The OP basically wants a tool that produces a CSS file containing only the classes that are used in a project. I edited the question a bit more. Commented Sep 8, 2011 at 12:41
  • 4
    I am really impressed with how you (both editors) managed to turn a hardly readable question into a pretty good one. Commented Sep 8, 2011 at 12:46
  • @MuditChauhan I've made one final edit to your title. Please double check and make sure this is still the question you were originally trying to ask :) Commented Sep 8, 2011 at 12:54
  • Have you tried disabling the compatibility check? Commented Sep 8, 2011 at 13:30

4 Answers 4

1

When you put your site to GT-Metrix. Than you can see the un-used CSS selectors. Or you can do it with Google pagespeed.

Sign up to request clarification or add additional context in comments.

Comments

0

You can try this online tool or use Google Chrome's developer tool(installed by default, no extension needed), which has audits tab to display unused css selectors on current page... but i dont think there is a way to have it done automatically for you...

Comments

0

You can try CSS Usage extension for Firebug. It works lika a charm, but it requires manual work https://addons.mozilla.org/en-US/firefox/addon/css-usage/

Comments

0

This system claim to do that: http://sourceforge.net/projects/cssmerge/?source=dlp

But I couldn't make it work, though.

So here it goes some manual tools to compare the files. It is not as fast as an automatic solution, but would make it faster than going by visual comparison alone.

http://www.diffchecker.com/

http://www.araxis.com/merge_mac/index.html

http://csscompare.codeplex.com/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.