Does anyone know of a tool that will not minify my CSS, but combine and optimize all my selectors? It would be nice
to be able to keep CSS reset, color, font, and layout separated while coding, for ease of navigating the CSS while
tweaking those various aspects. As a bonus, It would be nice if such a tool would convert any applicable styles into
shorthand, as well. I’ve never tried this workflow, but I’d be willing to if such a tool exists.
Ok, so this isn’t the best example, but when you have a fairly hefty CSS file, having all your, say, font styles in one
spot when tweaking the look of your fonts sure beats the heck out of scanning up and down your CSS, looking for
that one class:
[COLOR="#008000"]/* Fonts */[/COLOR]
.myElement01 {
font-size: 1em;
line-height: 1.4em;
font-family: serif;
}
.myElement02 {
font-size: 2em;
line-height: 1.4em;
font-family: sans-serif;
}
[COLOR="#008000"]/* Color */[/COLOR]
.myElement01 {
color: #000;
background-color: #fff;
}
.myElement02 {
color: #000;
background-color: #fff;
}
[COLOR="#008000"]/* Layout */[/COLOR]
.myElement01 {
float: left;
margin-left: 1em;
margin-right: 2em;
margin-top: 3em;
margin-bottom: 4em;
}
.myElement02 {
float: left;
margin-left: 1em;
margin-right: 1em;
margin-top: 2em;
margin-bottom: 2em;
}
[COLOR="#008000"]/* optimized */[/COLOR]
.myElement01 {
font: 1em/1.4em serif;
float: left;
margin: 3em 2em 4em 1em;
}
.myElement02 {
font: 2em/1.4em sans-serif;
float: left;
margin: 2em 1em;
}
.myElement01,
.myElement02 {
color: #000;
background-color: #fff;
}