Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SASS assets don't load the way Sprocket loads them #2

Open
zinkkrysty opened this issue Apr 17, 2012 · 3 comments
Open

SASS assets don't load the way Sprocket loads them #2

zinkkrysty opened this issue Apr 17, 2012 · 3 comments

Comments

@zinkkrysty
Copy link

I can't use rails helpers within .sass files or import external libraries that belong to a gem (e.g. Bourbon)

My .sass file looks like this:

@import 'bourbon'
@import 'variables'

.text
  color: $my_color_1
  background-color: $my_color_2
  background-image: image-url('email/email_bg_blue.jpg')
  @include inline_block

The external library is not that important (I need it because I include some mixins in my _variables.css.sass file) - this can be fixed by a refactor in my code

But the important part is being able to use Rails' asset helpers like image-url because we use cloud asset hosting and can't hard-code the path to the image background in the .sass file.

@billhorsman
Copy link
Owner

I'll need to think about this. It's not immediately obvious to me how I'm going to solve that. Digging around in the Rails code should reveal the answer... eventually.

@zinkkrysty
Copy link
Author

Sure, take your time, it's not that critical :)

@zinkkrysty
Copy link
Author

I just found this post, maybe it's of help. I'll investigate the issue my self as well and keep you up-to-date.

http://www.krautcomputing.com/blog/2012/03/27/how-to-compile-custom-sass-stylesheets-dynamically-during-runtime/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants