Browse Source

icon_helper style solid

main
pvincent 5 months ago
parent
commit
ca4001a1a7
  1. 2
      app/helpers/icon_helper.rb
  2. 6
      app/views/layouts/_navbar.html.erb

2
app/helpers/icon_helper.rb

@ -1,6 +1,6 @@
# Font Awesome Helper # Font Awesome Helper
module IconHelper module IconHelper
def fa_icon(name, extra_class = nil, style: :regular, size: nil)
def fa_icon(name, extra_class = nil, style: :solid, size: nil)
content_class = "fa-#{style.to_s.dasherize} fa-#{name.to_s.dasherize}" content_class = "fa-#{style.to_s.dasherize} fa-#{name.to_s.dasherize}"
content_class << " fa-#{size.to_s.dasherize}" if size content_class << " fa-#{size.to_s.dasherize}" if size
content_class << " #{extra_class}" if extra_class content_class << " #{extra_class}" if extra_class

6
app/views/layouts/_navbar.html.erb

@ -1,12 +1,10 @@
<nav> <nav>
<ul> <ul>
<li> <li>
A<%=fa_icon :magnifying_glass, style: :solid, size: '4x'%>
A<%=fa_icon :magnifying_glass, size: '4x'%>
B<%=fa_icon :user, size: '4x'%> B<%=fa_icon :user, size: '4x'%>
<%=fa_icon :user, 'text-blue-400', style: :solid, size: '10x' %>
<%=fa_icon :user, style: :solid, size: '10x' %>
<%=fa_icon :user, 'text-blue-400', style: :regular, size: '10x' %>
<%=fa_icon :user, size: '10x' %> <%=fa_icon :user, size: '10x' %>
<%=fa_icon :user, size: '10x', style: :brands %>
</li> </li>
<li>C<i class="fa-regular fa-user"></i></li> <li>C<i class="fa-regular fa-user"></i></li>
<li>D<i class="fa-solid fa-user"></i></li> <li>D<i class="fa-solid fa-user"></i></li>

Loading…
Cancel
Save