Tool for cleaning up CSS? [duplicate]
Asked Answered
S

4

1

Before publishing a site I have bloat of unused CSS styles. Is there any good tool to detect unused CSS classes, divs?

Related Questions:

Stoneware answered 23/3, 2009 at 10:0 Comment(1)
Please check this question. and related questions in the RHS.Daciadacie
J
-2

You can try CSS Tidy:

http://csstidy.sourceforge.net/

It is simple yet effective.

Jocundity answered 23/3, 2009 at 10:20 Comment(2)
this is not an appropriate answer for this question, as css tidy does not identify unused css rulesDomesticate
@alegscogs: Hm, you are indeed correct..don't know how I missed it, or why was it accepted then.. >_>Jocundity
P
0

Here is a simple web based css optimizer, very useful: http://www.cleancss.com/

Propositus answered 16/4, 2010 at 20:29 Comment(1)
This doesn't remove unused classes either.Howlond
O
0

Try ProCSSor

Okeefe answered 6/10, 2010 at 5:46 Comment(1)
This doesn't remove unused classes either.Howlond
D
0

Make sure you have firebug (for Firefox, if you don't know), and then install the pagespeed plugin for firebug, developed by Google:

http://code.google.com/speed/page-speed/

It will give you a 'pageSpeed' tab in firebug. Open it and, with 'performance' selected, click 'analyze performance'. Along with lots of other useful suggestions, you will get a list item labelled "Remove Unused Css". Click to expand it and see a breakdown by resource of unused css rules appearing on the present page, along with the memory size that you will save by removing the unused rules.

Domesticate answered 29/12, 2010 at 4:0 Comment(2)
how do you accomplish same in chrome?Mountaintop
the pagespeed plugin is developed by google and available for chrome as well as firefox.Domesticate
J
-2

You can try CSS Tidy:

http://csstidy.sourceforge.net/

It is simple yet effective.

Jocundity answered 23/3, 2009 at 10:20 Comment(2)
this is not an appropriate answer for this question, as css tidy does not identify unused css rulesDomesticate
@alegscogs: Hm, you are indeed correct..don't know how I missed it, or why was it accepted then.. >_>Jocundity

© 2022 - 2024 — McMap. All rights reserved.