custom/plugins/MoorlFoundation/src/Resources/views/storefront/utilities/icon.html.twig line 1

  1. {% sw_extends '@Storefront/storefront/utilities/icon.html.twig' %}
  2. {% block utilities_icon %}
  3.     {% if name == 'icon' and fileName %}
  4.         {% set name = fileName %}
  5.     {% endif %}
  6.     {% set styles = [ size, color, rotation, flip, class, inline ] %}
  7.     {% set iconPacks = {
  8.         fab: 'fa/brands/',
  9.         far: 'fa/regular/',
  10.         fas: 'fa/solid/',
  11.         fa6b: 'fa6/brands/',
  12.         fa6r: 'fa6/regular/',
  13.         fa6s: 'fa6/solid/'
  14.     } %}
  15.     {% set inherit = true %}
  16.     {% for key, path in iconPacks %}
  17.         {% if pack == key %}
  18.             {% set inherit = false %}
  19.             <span class="icon icon-{{ pack }} icon-{{ pack }}-{{ name }}{% for entry in styles %}{% if entry != "" %} icon-{{ entry }}{% endif %}{% endfor %}">
  20.                 {% set icon = source('@MoorlFoundation/assets/icon/' ~ path ~ name ~'.svg', ignore_missing = true) %}
  21.                 {{ icon|sw_icon_cache|raw }}
  22.             </span>
  23.         {% endif %}
  24.     {% endfor %}
  25.     {% if inherit %}
  26.         {{ parent() }}
  27.     {% endif %}
  28. {% endblock %}