I am looking for a web service or (OS X) software that will take a stylesheet similar to this:
h1,h2 {margin-bottom:1em;}
h2.special {color:red;text-align:justify;}
p {margin-bottom:1em;font-weight:bold; }
and convert it to this:
h1,h2,p {margin-bottom:1em;}
h2.special {color:red}
h2.special {text-align:justify;}
p {font-weight:bold;}
Ie I need something that takes every unique combination of attributes / values ββin the CSS file and then groups all the selectors that use it.
It seems to me that this is a trivial problem, but the only bit of βcodingβ capable of Im is a bit of RegEx - it seems that this does not give me a solution here.
Thank.
Note:
I know that such an approach cannot lead to optimization (dimension). This is not for a live site / CSS, but for the analysis and "screening" of unnecessarily complex stylesheets. After this step, the attributes will be grouped again.