Module: Compass::Core::SassExtensions::Functions::InlineImage

Included in:
GradientSupport::LinearGradient, GradientSupport::RadialGradient, Sass::Script::Functions
Defined in:
lib/compass/core/sass_extensions/functions/inline_image.rb

Instance Method Summary collapse

Instance Method Details

#inline_font_files(*args) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/compass/core/sass_extensions/functions/inline_image.rb', line 9

def inline_font_files(*args)
  files = []
  with_each_font_file(*args) do |path, type|
    path = path.value
    real_path = File.join(Compass.configuration.fonts_path, path)
    data = inline_image_string(data(real_path), compute_mime_type(path))
    files << list(data, unquoted_string("format('#{type}')"), :space)
  end
  list(files, :comma)
end

#inline_image(path, mime_type = nil) ⇒ Object



3
4
5
6
7
# File 'lib/compass/core/sass_extensions/functions/inline_image.rb', line 3

def inline_image(path, mime_type = nil)
  path = path.value
  real_path = File.join(Compass.configuration.images_path, path)
  inline_image_string(data(real_path), compute_mime_type(path, mime_type))
end