Search code examples
csssasscompass-sass

Compass set .css output path to same location as .scss


I have my compiled .css files in multiple, diverse directories along my app, and the Sass compiler I was previously using simply compiled the .scss files to a .css file in whatever directory they were in.

Compass seems to require a single 'output' directory that you can configure, that all of your compiled .css files go to, and it only watches a single folder.

How do you tell Compass to simply compile to the location of the .scss file?


Solution

  • Silly me (then). Compass does this as well. Just pick the highest parent folder for your project as the sass and css dirs in your config.rb file, and compass will recursively loop through and compile the css into sass in whatever directory it found it.

    sass_options = {:cache_location => "./temp/.sass-cache"}
    http_path = "/"
    css_dir = "therootdirectory"
    sass_dir = "therootdirectory"
    images_dir = "therootdirectory/assets/images/sprites"
    javascripts_dir = "javascripts"