Skip to content

Instantly share code, notes, and snippets.

@pootsbook
Last active December 22, 2015 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pootsbook/6548972 to your computer and use it in GitHub Desktop.
Save pootsbook/6548972 to your computer and use it in GitHub Desktop.
Sass-Rails Asset Helpers
asset-path($relative-asset-path, $asset-class)
asset-path("rails.png", image) => "/assets/rails.png"
image-path($relative-asset-path)
font-path($relative-asset-path)
video-path($relative-asset-path)
audio-path($relative-asset-path)
javascript-path($relative-asset-path)
stylesheet-path($relative-asset-path)
asset-url($relative-asset-path, $asset-class)
asset-url("rails.png", image) => url(/assets/rails.png)
image-url($relative-asset-path)
font-url($relative-asset-path)
video-url($relative-asset-path)
audio-url($relative-asset-path)
javascript-url($relative-asset-path)
stylesheet-url($relative-asset-path)
So in our stylesheets:
url(/assets/rails.png) => image-url("rails.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment