asset-data-uri helper? #40

Closed
carhartl opened this Issue Sep 2, 2011 · 8 comments

Comments

Projects
None yet
7 participants

carhartl commented Sep 2, 2011

I was trying to use

asset-data-uri('foo.png')

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

+1

Contributor

joenoon commented Sep 11, 2011

I've made a pull request:

#46

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

https://gist.github.com/1209347

Thanks @joenoon!

Collaborator

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 (http://en.wikipedia.org/wiki/Data_URI_scheme) and the Rails feature is called asset-data-uri (http://guides.rubyonrails.org/asset_pipeline.html#coding-links-to-assets)

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