Module: Condenser::SassTransformer::Functions

Includes:
Condenser::Sass::Functions
Defined in:
lib/condenser/transformers/sass_transformer.rb

Overview

Functions injected into Sass context during Condenser evaluation.

Instance Method Summary collapse

Methods included from Condenser::Sass::Functions

#asset_data_url, #asset_path_signature, #asset_url_signature, #audio_path, #audio_url, #font_path, #font_url, #image_path, #image_url, #javascript_path, #javascript_url, #stylesheet_path, #stylesheet_url, #video_path, #video_url

Instance Method Details

#asset_path(path, options = {}) ⇒ Object

Returns a Sass::Script::String.



122
123
124
125
126
127
128
129
# File 'lib/condenser/transformers/sass_transformer.rb', line 122

def asset_path(path, options = {})
  condenser_context.link_asset(path.value)

  path = condenser_context.asset_path(path.value, options)
  query    = "?#{query}" if query
  fragment = "##{fragment}" if fragment
  SassC::Script::Value::String.new("#{path}#{query}#{fragment}", :string)
end

#asset_url(path, options = {}) ⇒ Object

Returns a Sass::Script::String.



132
133
134
# File 'lib/condenser/transformers/sass_transformer.rb', line 132

def asset_url(path, options = {})
  SassC::Script::Value::String.new("url(#{asset_path(path, options).value})")
end