module Sass::Images::Functions
Public Instance Methods
image_height(path)
click to toggle source
# File lib/sass/images/functions.rb, line 12 def image_height(path) image = Image.new(resolve_path path) Sass::Script::Number.new image.height, ['px'] end
image_width(path)
click to toggle source
# File lib/sass/images/functions.rb, line 7 def image_width(path) image = Image.new(resolve_path path) Sass::Script::Number.new image.width, ['px'] end
inline_image(path)
click to toggle source
# File lib/sass/images/functions.rb, line 17 def inline_image(path) image = Image.new(resolve_path path) data_uri = "data:#{image.content_type};base64,#{image.base64}" Sass::Script::String.new "url(#{data_uri})" end
Private Instance Methods
resolve_path(path)
click to toggle source
# File lib/sass/images/functions.rb, line 25 def resolve_path(path) Sass::Images.path_resolver.call(path.value) end