I'm about to tidy up some CSS files. The stylesheets are pretty messed up and some selectors appear all over the script. I already used the css comb grunt task to tidy up the properties within the selectors but now I'm looking for something to merge and sort the selectors. I already checked out the cssc grunt plugin and it has kind of what I'm looking for. It's option parameters sortSelectors
, sortDeclarations
, consolidateViaDeclarations
, consolidateViaSelectors
and consolidateMediaQueries
do the job. But unfortunately they "mess up" the code and remove comments, whitespaces, linebreaks etc.
I'm not looking for a uglifier/minifier - I'm looking for something to sort the code and make it more readable. Is there any option or another tool that could do that?