Skip to content

Instantly share code, notes, and snippets.

@joenoon
Created September 11, 2011 08:52
Show Gist options
  • Save joenoon/1209347 to your computer and use it in GitHub Desktop.
Save joenoon/1209347 to your computer and use it in GitHub Desktop.
asset-data-url sass helper
# `asset-data-url` sass helper
# quick fix for: https://github.com/rails/sass-rails/pull/46
unless Sass::Script::Functions.method_defined?(:asset_data_url)
module Sass
module Extra
module Helpers
def asset_data_url(path)
data = context_asset_data_uri(path.value)
Sass::Script::String.new(%Q{url(#{data})})
end
protected
def context_asset_data_uri(path)
options[:custom][:resolver].context.asset_data_uri(path)
end
end
end
end
module Sass
module Script
module Functions
include Sass::Extra::Helpers
end
end
end
else
Rails.logger.warn "THIS FILE IS NO LONGER NECESSARY: #{__FILE__}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment