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
-
#asset_path(path, options = {}) ⇒ Object
Returns a Sass::Script::String.
-
#asset_url(path, options = {}) ⇒ Object
Returns a Sass::Script::String.
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, = {}) condenser_context.link_asset(path.value) path = condenser_context.asset_path(path.value, ) 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, = {}) SassC::Script::Value::String.new("url(#{asset_path(path, ).value})") end |