Can a compass combine .css files?

I'm trying to figure out if Compass can merge .css files, rather than using a third-party tool to merge .css files after Compass has compiled .scss files. I looked through the network here, but nothing so far. I thought config.rb might have an option for this, but all I found was a compression function.

Has anyone tried this or found a third-party tool that works well with the compass?

+7
source share
2 answers

I would like to do the same for some time. I finally settled on the following solution.

Take the following structure (i.e. with your modules in a sass )

  • Project
    • bicker
      • modules
        • header.scss
        • Blog posts.scss
        • footer.scss
        • something else.scss
      • main.scss
    • style sheets

Update main.scss to contain:

 @import 'modules/header.scss'; @import 'modules/blog-posts.scss'; @import 'modules/footer.scss'; @import 'modules/something-else.scss'; 

Run the following command (from the project folder) to create

 compass compile . sass/main.scss -s compressed 

It just compiles main.scss , which inturn goes and imports each of your modules. In addition, the compressed style parameter minimizes output.

+15
source

This is not compression, but you can exclude files from the copy in the output directory by adding an underscore to their names. For example:

 scss/ _core.scss // will not be copied theme.scss // @import 'core'; css/ compass compile create ../css/theme.css css/ theme.css 
+1
source

All Articles