How do I use reference images in Sass when using Rails 3.1?

后端 未结 6 801
北荒
北荒 2020-12-12 19:29

I have a Rails 3.1 project with the asset pipeline working great. The problem is that I need to reference images in my Sass, but Rails calculates image URLs. (This is partic

6条回答
  •  伪装坚强ぢ
    2020-12-12 19:38

    For those who are in favor for faster load times for users, may I suggest following Steve Souders tip for loading images in CSS in base64.

    asset-data-url('path')

    https://github.com/rails/sass-rails#asset-helpers

提交回复
热议问题