Module: Ustyle::Helpers::Icons

Defined in:
lib/ustyle/helpers/icon_helper.rb

Class Method Summary collapse

Class Method Details

.icon(name, size, color, role = 'presentation', pseudo = false, classes = []) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/ustyle/helpers/icon_helper.rb', line 6

def self.icon(name, size, color, role ='presentation', pseudo = false, classes = [])
  "
    <svg class='us-icon--#{name} us-icon--#{color} us-icon--#{size} #{pseudo ? "us-icon--#{pseudo}" : ""} #{classes.join(' ') unless classes.nil?}' role='#{role}' xmlns='http://www.w3.org/2000/svg'>
      <use xlink:href='/icons.svg#icon-#{name}'></use>
    </svg>
  "
end