I'm looking for a "CSS Post-processor" that will optimize a CSS file.
For example, I know that that are tool that minimize .css files but I would like something that go further in this optimization. Here are some example of possible criteria:
1) Group media-query:
If I have multiple instances of the same mediaquery, this tool should group all selectors under only one instance
2) Group equal rules:
If I have these rules:
.foo1
{
color:red;
border:solid 1px green;
font-size:13px;
text-align:center;
}
.foo2
{
color:blue;
border:solid 1px green;
font-size:13px;
text-align:center;
}
They should grouped into the following final CSS:
.foo1,
.foo2
{
color:red;
border:solid 1px green;
font-size:13px;
text-align:center;
}
.foo2
{
color:blue;
}
3) Remove unused properties:
If I have these properties:
.foo1
{
color:red;
border:solid 1px green;
font-size:13px;
text-align:center;
}
.foo1
{
color:blue;
}
It's clear that with this declaration order .foo1
will never have color:red
applied, and so it should be "condensed" in:
.foo1
{
color:blue;
border:solid 1px green;
font-size:13px;
text-align:center;
}