Class/Module Index [+]

Quicksearch

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

Public Instance Methods

inline_font_files(*args) click to toggle source
# 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) click to toggle source
# 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

Protected Instance Methods

inline_image_string(data, mime_type) click to toggle source
# File lib/compass/core/sass_extensions/functions/inline_image.rb, line 21
def inline_image_string(data, mime_type)
  data = [data].flatten.pack('m').gsub("\n","")
  url = "url('data:#{mime_type};base64,#{data}')"
  unquoted_string(url)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.