Rails 4: How to Use SASS Mappings

Rails 4: how do I use Sass Mappings?

As @dinocarl kindly pointed out, the map and list features of SASS are in version 3+. I had to upgrade sass-rails gem to version 5+ because that version of the gem packages SASS 3+. Worked like a charm after I upgraded the gem version (also were few additional dependencies I had to update).

Sass source map support on chrome isn't working

Try following the tutorial in this link. I just set this up this morning and it's working fine for me.

This will let you inspect an element and then find what the corresponding SCSS declaration is.

SASS, Rails 3.1: Loading stylesheets in vendor/assets

If I'm understanding you correctly, I think this might help.

Add the following to config/application.rb, inside the class Application < Rails::Application block:

config.sass.load_paths << File.expand_path('../../lib/assets/stylesheets/')
config.sass.load_paths << File.expand_path('../../vendor/assets/stylesheets/')

I've just added the above to an app, and the following directives are now both working:

  • Import Sass:
    @import 'grid' in app/assets/stylesheets/application.css.scss finds the file vendor/assets/stylesheets/_grid.scss;
  • Import regular CSS:
    @import 'background', again in application.css.scss, finds vendor/assets/stylesheets/background.css.

Does that help? Sorry if I've misunderstood the problem!



Related Topics



Leave a reply



Submit