Created
September 11, 2011 08:52
-
-
Save joenoon/1209347 to your computer and use it in GitHub Desktop.
asset-data-url sass helper
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
# `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