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
Written by David Somers
Related protips
4 Responses

Hi,
I have this problem with heroku, but which file contains this code?
over 1 year ago
·

As I said, you add it to config/application.rb
. Is that what you mean?
over 1 year ago
·

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
·

Thanks David...
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Filed Under
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#