Author Topic: CSS Shorthand Generator  (Read 9696 times)

buckworks

  • Inner Core
  • Hero Member
  • *
  • Posts: 1634
    • View Profile
Re: CSS Shorthand Generator
« Reply #15 on: March 10, 2017, 10:41:55 PM »
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

  • Inner Core
  • Hero Member
  • *
  • Posts: 9294
    • View Profile
Re: CSS Shorthand Generator
« Reply #16 on: March 11, 2017, 01:24:25 AM »
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

  • Need a bigger hammer...
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3087
  • Resident Redneck
    • View Profile
Re: CSS Shorthand Generator
« Reply #17 on: March 11, 2017, 02:17:14 AM »
Thank you both!

ergophobe

  • Inner Core
  • Hero Member
  • *
  • Posts: 9294
    • View Profile
Re: CSS Shorthand Generator
« Reply #18 on: March 11, 2017, 02:40:24 AM »
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