Created
July 23, 2015 09:02
-
-
Save KOWLOR/1c1e6ec8e19a9ee0954f to your computer and use it in GitHub Desktop.
Middleman retina_image_tag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
helpers do | |
def retina_image_tag(default_name, options={}) | |
retina_name = default_name.gsub(%r{\.\w+$}, '@2x\0') | |
image_tag(default_name, options.merge('data-interchange' => "[#{asset_path(:images, retina_name)}, (retina)]")) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using the
data-interchange
by foundation.Place this snippet in config.rb, make sure
foundation.js
andfoundation.interchange.js
are calledAnd also :
Use like this :