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

Open in your IDE?
  1. {% sw_extends '@parent/storefront/utilities/icon.html.twig' %}
  2. {# ToDo: Implement fontAwesome #}
  3. {% block utilities_icon %}
  4.     {% set styles = [ size, color, rotation, flip, class ] %}
  5.     {% if pack is not defined %}
  6.         {% if name starts with 'fa-' %}
  7.             {% set pack = 'fontawesome' %}
  8.         {% else %}
  9.             {% set pack = 'default' %}
  10.         {% endif %}
  11.     {% endif %}
  12.     {% if namespace is not defined %}
  13.         {% set namespace = 'Storefront' %}
  14.     {% endif %}
  15.     {% if themeIconConfig[pack] is defined %}
  16.         <span class="icon icon-{{ pack }} icon-{{ pack }}-{{ name }}{% for entry in styles %}{% if entry != "" %} icon-{{ entry }}{% endif %}{% endfor %}">
  17.             {{ source('@' ~ themeIconConfig[pack].namespace ~ '/../' ~ themeIconConfig[pack].path ~'/'~ name ~ '.svg', ignore_missing = true) }}
  18.         </span>
  19.     {% else %}
  20.         {% if pack == 'fontawesome' %}
  21.             <span class="icon {% for entry in styles %}{% if entry != "" %} icon-{{ entry }}{% endif %}{% endfor %}" style="font-size: 22px; {{ color ? 'color: ' ~ color ~ ';' : '' }}">
  22.                 <i class="{{ class ? class : 'fas'}} {{ name }} {{ size ? 'fa-' ~ size : '' }}" style="line-height: 1"></i>
  23.             </span>
  24.         {% else %}
  25.             <span
  26.                 class="icon icon-{{ name }}{% for entry in styles %}{% if entry != "" %} icon-{{ entry }}{% endif %}{% endfor %}">
  27.                     {{ source('@' ~ namespace ~ '/../app/storefront/dist/assets/icon/'~ pack ~'/'~ name ~'.svg', ignore_missing = true) }}
  28.             </span>
  29.         {% endif %}
  30.     {% endif %}
  31. {% endblock %}