Rails 3.1, SASS, @import, and directories

20 views
Skip to first unread message

Kurtis Rainbolt-Greene

unread,
Jun 16, 2011, 8:40:20 AM6/16/11
to rubyonra...@googlegroups.com
So, here's the problem: @import isn't liking other directories.

Example:

app/
  assets/
    stylesheets/
      extras/
        _mixins.sass
        _variables.sass
      photographs/
        index.css.sass

And the contents of app/assets/stylesheets/photographs/index.css.sass is:

@import "../extras/mixins", "../extras/variables"

I get the following error:
File to import not found or unreadable: extras/mixins.
Load path: .
  (in /Users/krainboltgreene/repo/ruby/rails/dice-envy/app/assets/stylesheets/reviews/new.css.sass.erb)

Now, here's the thing, with this structure:

app/
  assets/
    stylesheets/
      extras/
        _mixins.sass
        _variables.sass
      photographs.css.sass

And the contents of app/assets/stylesheets/photographs.css.sass is:

@import "extras/mixins", "extras/variables"

Works fine. Absolutely.
Reply all
Reply to author
Forward
0 new messages