Module: FontAwesome::SassExtensions::Functions

Extended by:
ActiveSupport::Concern
Included in:
Sass::Script::Functions
Defined in:
lib/font_awesome/sass_extensions/functions.rb

Instance Method Summary collapse

Instance Method Details

#icon_character(name) ⇒ Object



27
28
29
30
31
# File 'lib/font_awesome/sass_extensions/functions.rb', line 27

def icon_character(name)
  assert_type name, :String

  Sass::Script::String.new HexCode.new(name.value).to_css, :string
end

#icon_image(name, style = nil) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/font_awesome/sass_extensions/functions.rb', line 15

def icon_image(name, style=nil)
  assert_type name, :String
  icon = Icon.new(name.value)

  unless style.nil?
    assert_type style, :String
    icon.style = style.value
  end

  Sass::Script::String.new icon.to_uri, :string
end