# File lib/compass/sass_extensions/functions/urls.rb, line 16 def self.included(base) if base.respond_to?(:declare) base.declare :stylesheet_url, [:path] base.declare :stylesheet_url, [:path, :only_path] end end
# File lib/compass/sass_extensions/functions/urls.rb, line 22 def stylesheet_url(path, only_path = Sass::Script::Bool.new(false)) # Compute the path to the stylesheet, either root relative or stylesheet relative # or nil if the http_images_path is not set in the configuration. http_stylesheets_path = if relative? compute_relative_path(Compass.configuration.css_path) elsif Compass.configuration.http_stylesheets_path Compass.configuration.http_stylesheets_path else Compass.configuration.http_root_relative(Compass.configuration.css_dir) end path = "#{http_stylesheets_path}/#{path.value}" if only_path.to_bool Sass::Script::String.new(clean_path(path)) else clean_url(path) end end