uklpaa
Last Updated: February 25, 2016
·
4.871K
· jalada
Profile picture may 2012

Using SASS instead of SCSS by default in Rails

Presumably because people love CSS (?) Rails defaults to SCSS when generating stylesheets. I use HAML instead of HTML so SASS is a much better fit.

Add this to config/application.rb:

config.sass.preferred_syntax = :sass

You'll have problems running tasks on Heroku if your sass-rails gem is in the assets gem group now. To fix that, use these lines instead:

if Rails.configuration.respond_to?(:sass)
  Rails.configuration.sass.tap do |config|
    config.preferred_syntax = :sass
  end
end

Thanks.

Say Thanks
Respond

4 Responses
Add your response

730
F3bb6e27e334ebfadd5347f4f02bfcd6

Hi,

I have this problem with heroku, but which file contains this code?

over 1 year ago ·
748
Profile picture may 2012

As I said, you add it to config/application.rb. Is that what you mean?

over 1 year ago ·
827
F3bb6e27e334ebfadd5347f4f02bfcd6

Oh, i don't understand that, sorry.
I thought that part of code would go in another file.
So, all code (the sentence and the block) should be in application.rb

Thanks

over 1 year ago ·
6999
94bea9dfe7bb73ce7831a6967767f612

Thanks David...

over 1 year ago ·