When referencing assets in Sass, you must use asset helpers to ensure paths are correctly rewritten by the asset pipeline. Note that Ruby underscores (_) become hyphens (-) in Sass.
General Helpers
asset-path($relative-asset-path): Returns a string path (e.g., asset-path("rails.png") $\rightarrow$ "/assets/rails.png").asset-url($relative-asset-path): Returns a CSS url() reference (e.g., asset-url("rails.png") $\rightarrow$ url(/assets/rails.png)).asset-data-url($relative-asset-path): Returns a Base64-encoded data URL.
Specialized Helpers
For convenience, use these specific helpers for different asset types:
image-path() / image-url()font-path() / font-url()video-path() / video-url()audio-path() / audio-url()javascript-path() / javascript-url()stylesheet-path() / stylesheet-url()
/* Examples */
.icon {
background-image: image-url("logo.png");
}
.font {
src: font-url("myfont.woff");
}