Search code examples
ruby-on-railsruby-on-rails-3compass-sass

How can I get Compass to automatically import all stylesheets in app/assets/stylesheets?


I'm trying to add Compass to my Rails 3.2 app, using compass-rails. How can I get it to automatically import all of the stylesheets in app/assets/stylesheets? At the moment I have to manually do @import 'filename'; in application.css.scss for each one.


Solution

  • Put all your scss files (except application.css.scss) in a different folder:

    /application.css.scss

    /all/hello.css.scss

    /all/hi.css.scss

    application.css.scss file like below will work.

    @import "compass";
    @import "all/*";