Search code examples
sasscompass-sass

Compass and sass: possible to auto-import all partials?


In a compass/sass setup, ideally I would like to compile every .scss-file into one big style.css. Looking e.g. here, it seems my only option would be to make _partials.scss and @import "these"; from one main file. This seems like double work, since every time I move around a .scss-file e.g. to a sub folder I have to update the referenced import-path.

My question is: is it possible with compass instead to just watch a folder and always compile all partials into one single target output file?


Solution

  • Use the Sass Globbing Plugin.

    This way you can import an entire folder:

    @import "library/partials/*"
    

    The partials will be sorted alphabetically before being imported.