2

I'm working with a friend on a project with a huge CSS file. There is a lot of duplication like:

h1 {
  color : black;
}

h1 {
  color : blue;
  width: 30px;
}

The first h1 can be removed, because it will never be used, because fully rewrited by the second. (because it is in the same CSS file)

I would know if it exists a tool that factorizes (and compress) this kind of stuff. To only have at the end:

h1 {color:blue;width:30px}

PS: If it can be an online tool, it will be perfect!

3 Answers 3

3

There's a nice one in ruby: http://zmoazeni.github.io/csscss

In node.js: https://github.com/rbtech/css-purge

Both are very easy to use from command line.

This is also a nice once: http://cssmerge.sourceforge.net

And a plugin for Firefox: https://addons.mozilla.org/en-us/firefox/addon/css-usage

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

1 Comment

We have just launched our update, which does its job better, faster and even more now :) ~ rbtech.github.io/css-purge
2

First you can try

Then Try these

Comments

1

If you are using Firefox, you can use this addon which will help you achieve it.

https://addons.mozilla.org/en-us/firefox/addon/css-usage/

It creates a new css which tells you only used rules and sideline unused one. It also lets you export that css.

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.