views:

58

answers:

1

On larger projects I have segmented stylesheets that have rules written for specific modules. I'd like to be able to automate a process that minifies my CSS (at least remove commenting) and also combine multiple CSS files into a single asset to minimize requests.

+1  A: 

If you are using PHP 5+ I would highly recommend Scaffold. It blew my mind when I saw how easy it was - yet how powerful. Watch the video to see it in action

Supports:

  • Constants
  • Mixins
  • Nested Selectors
  • Expressions
  • Caching and gzipping
  • Extendable through plugins

Thus you can do things like:

/*include/aggregate other CSS files*/
@include '/css/reset.css';
@include '/css/sections/layout.css';
#foo{
  background-color:#efefef;
  color:#333;
  /* nested selectors will expand in the output */
  a{
    color:#11f;
    padding:2px;
  }
}

and have the whole thing minified, gzipped and cached as a single CSS file

scunliffe
Interesting I personally am using ruby so I wonder if there is anything like this in other languages. I know Rails does all of these things except minify. Maybe I'll have to extend it myself.
Jim Jeffers