zeus.ugent.be/lib/helpers/font_awesome.rb

13 lines
328 B
Ruby
Raw Normal View History

2016-08-04 19:17:45 +02:00
module FontAwesomeHelper
def fa(icon, size: nil, li: false, stack: nil, inverse: false)
2016-08-04 19:17:45 +02:00
classes = ['fa', "fa-#{icon}"]
classes << "fa-#{size}" if size
classes << 'fa-li' if li
classes << "fa-stack-#{stack}" if stack
classes << 'fa-inverse' if inverse
2016-08-04 19:17:45 +02:00
"<i class='#{classes.join(' ')}'></i>"
end
end