vendor/shopware/storefront/Resources/views/storefront/utilities/icon.html.twig line 1

Open in your IDE?
  1. {%- block utilities_icon -%}
  2.     {% set styles = [ size, color, rotation, flip, class ] %}
  3.     {%- if pack is not defined -%}
  4.         {% set pack = 'default' %}
  5.     {%- endif -%}
  6.     {%- if namespace is not defined -%}
  7.         {% set namespace = 'Storefront' %}
  8.     {%- endif -%}
  9.     {%- if themeIconConfig[pack] is defined -%}
  10.         <span class="icon icon-{{ pack }} icon-{{ pack }}-{{ name }}{% for entry in styles %}{% if entry != "" %} icon-{{ entry }}{% endif %}{% endfor %}">
  11.             {% set icon =  source('@' ~ themeIconConfig[pack].namespace ~ '/' ~ themeIconConfig[pack].path ~'/'~ name ~ '.svg', ignore_missing = true) %}
  12.             {{ icon|sw_icon_cache|raw }}
  13.         </span>
  14.     {%- else -%}
  15.         <span class="icon icon-{{ name }}{% for entry in styles %}{% if entry != "" %} icon-{{ entry }}{% endif %}{% endfor %}">
  16.             {% set icon = source('@' ~ namespace ~ '/assets/icon/'~ pack ~'/'~ name ~'.svg', ignore_missing = true) %}
  17.             {{ icon|sw_icon_cache|raw }}
  18.         </span>
  19.     {%- endif -%}
  20. {%- endblock -%}