durfdoen-2.0/lib/helpers/font_awesome.rb

15 lines
457 B
Ruby
Raw Normal View History

2020-02-27 23:10:55 +01:00
#totaal geen plagiaat
module FontAwesomeHelper
def fa(icon, opts = {})
classes = ['fa', "fa-#{icon}"]
classes << "fa-#{opts[:size]}" if opts[:size]
classes << 'fa-li' if opts[:li]
classes << "fa-stack-#{opts[:stack]}" if opts[:stack]
classes << 'fa-inverse' if opts[:inverse]
classes << 'fa-fw' if opts[:fw]
classes << opts[:class]
"<i class='#{classes.reject(&:nil?).join(' ')}'></i>"
end
end