asset-data-uri helper? #40

carhartl opened this Issue Sep 2, 2011 · 8 comments


None yet
7 participants

carhartl commented Sep 2, 2011

I was trying to use


in my .scss files in the same fashion as asset-path() or image-url(), but it seems such helper is missing (Sprockets provides asset_data_uri). Possible to add?

+1 this would be great.

cs commented Sep 10, 2011



joenoon commented Sep 11, 2011

I've made a pull request:


For the time being, here's something you can stick in an initializer:

Thanks @joenoon!


chriseppstein commented Sep 16, 2011

merged. thanks!

florish commented May 24, 2012

Just for anyone else who might run into this: note that the method is called asset-data-url, with an L at the end instead of the i ("uri") mentioned in the original post here.

klebba commented Aug 19, 2013

@florish Thanks for pointing this out, without your comment I would have given up. It is bizarre that sass-rails has renamed this method, given that both the formal name for the format is Data URI ( and the Rails feature is called asset-data-uri (

Unless I'm missing something this feature name is very confusing. Can you at least create an alias for asset-data-uri to be congruent with Rails?

florish commented Aug 20, 2013

@klebba I agree, it is quite confusing. Maybe you should open a new issue (with a reference to this one), as the one we're on now has been closed for 2 years and probably isn't monitored by any of the developers anymore...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment