Skip to content

Instantly share code, notes, and snippets.

@noopkat noopkat/gist:10506922
Last active Aug 29, 2015

Embed
What would you like to do?
Sass Function extend
module Sass::Script::Functions
def getImg(string, url)
assert_type string, :String
assert_type url, :String
manifest = JSON.parse(File.read("manifest.json"))
Sass::Script::Value::String.new(url + "/" + manifest["img"][string])
end
declare :getImg, [:string]
end
/* usage in sass */
#stuff
background: url(getImg('unicorn.png', $s3url))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.