A reliable way to logically minify css? -


to minify this:

h1 {      color: #fff;  } 

you get:

h1{color: #fff;} 

but if had:

h1{color: #fff;} h1{color: #fff;} h1{color: #fff;} h1{color: #fff;} 

minifying wouldn't solve problem. nor this:

h1{color: #fff;} div h1{color: #fff;} 

i tries csscss points out duplicates. other that, wasn't able find reliable way strip out logical redundancies in css. there perhaps tool similar csscss or perhaps php library can kind of logical redundancies?

you can use css-purge achieve looking for.

npm install css-purge -g // no needed if have installed css-purge -i style.css -o style_purged.css 

also if have automated build process using grunt, can use grunt-css-purge


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -