CSS Shorthand Generator

Started by buckworks, March 04, 2017, 12:30:39 AM

Previous topic - Next topic

buckworks

One tool too check is the minify tool within PageSpeed.

It won't create shorthand shorthand declarations so far as I can tell ... you have to do that yourself ... but it squeezes out every comment and every bit of white space.

Just a couple of days ago I used it to minify a CSS file and instantly gained a point on the site's PageSpeed score.

ergophobe

Quote from: Drastic on March 10, 2017, 10:26:58 PM
Any recommended minify tools for css files?

I mostly use SASS now, often with Compass. So you just add a flag when you compress and it's done
https://jonbellah.com/how-to-minify-css-with-sass-and-compass/

Standalone CSSTidy - http://csstidy.sourceforge.net/

CSS is not finicky because you won't go changing variable names and such (sometimes minification and aggregation breaks JS). So any online tool would work fine

- http://www.codebeautifier.com/ which runs of CSSTidy
- http://csscompressor.com/

And then lots of common editors have plugins

Atom: https://atom.io/packages/atom-minify
Brackets: http://brackets.dnbard.com/extension/brackets-minify
VS Code: https://marketplace.visualstudio.com/items?itemName=HookyQR.minify or https://marketplace.visualstudio.com/items?itemName=fbdegroot.Minifier

Drastic


ergophobe

Quote from: buckworks on March 10, 2017, 10:41:55 PM
It won't create shorthand shorthand declarations

PS - CSSTidy should do so if you set the right flags. I think both of the online services I link will do so. For sure the first one since it's just a UI for CSSTidy