Sass, Compass, compile all CSS file to one

MyMomSaysIamSpecial picture MyMomSaysIamSpecial · Oct 23, 2012 · Viewed 10.2k times · Source

Now, while I am developing my project I have three files, "main.css", "about.css" and "news.css" (for example). Is it possible to compile them into one "final.css" for production?

Answer

hopper picture hopper · Oct 23, 2012

The SASS import directive is used to import the contents of one file into another, so you could create a file final.scss whose contents are:

@import 'main';
@import 'about';
@import 'news';

You'd then need to rename your files to have "scss" extensions so the import directive will find them. If you don't want the main.scss, about.scss, and news.scss files to compile to CSS files themselves, you can use partials by prefixing the filenames with an underscore (i.e., _main.scss, _about.scss, _news.scss).