Module: Iconpark::Helpers

Defined in:
lib/iconpark/helpers.rb

Instance Method Summary collapse

Instance Method Details

#icon(name, theme: Iconpark.default_theme, **html_options) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/iconpark/helpers.rb', line 4

def icon name, theme: Iconpark.default_theme, **html_options
  html_options.force_array! :class
  Iconpark.default_html_options.force_array! :class

  html_options.reverse_deep_merge! Iconpark.default_html_options

  html_options[:class] << theme
   'svg', **html_options do
    tag 'use', href: asset_path("#{name}.svg##{name}")
  end
end