diff --git a/lib/sass_extensions.rb b/lib/sass_extensions.rb index 4a025185..0d76425c 100644 --- a/lib/sass_extensions.rb +++ b/lib/sass_extensions.rb @@ -19,6 +19,9 @@ module Sass::Script::Functions end def image_url(path) + if absolute_path?(path.value) + return Sass::Script::String.new("url(#{path})") + end http_images_path = if Compass.configuration.http_images_path == :relative if (target_css_file = options[:css_filename]) images_path = File.join(Compass.configuration.project_path, Compass.configuration.images_dir) @@ -35,6 +38,11 @@ module Sass::Script::Functions end Sass::Script::String.new("url(#{path})") end + + private + def absolute_path?(path) + path[0..0] == "/" || path[0..3] == "http" + end end # XXX: We can remove this check and monkeypatch once Sass 2.2 is released.