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

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