switch-icon.html 821 B

12345678910111213141516171819
  1. {% assign icon = include.icon | default: 'heart' %}
  2. {% assign icon-b = include.icon-b | default: icon | default: 'heart' %}
  3. {% assign icon-a-color = include.icon-a-color | default: 'muted' %}
  4. {% assign icon-b-color = include.icon-b-color | default: 'red' %}
  5. {% if icon == 'star' or icon == 'heart' %}
  6. {% assign icon-b-class = 'icon-filled' %}
  7. {% else %}
  8. {% assign icon-b-class = include.icon-b-class %}
  9. {% endif %}
  10. <button class="switch-icon{% if include.variant %} switch-icon-{{ include.variant }}{% endif %}{% if include.active %} active{% endif %}" data-bs-toggle="switch-icon">
  11. <span class="switch-icon-a text-{{ icon-a-color }}">
  12. {% include ui/icon.html icon=icon %}
  13. </span>
  14. <span class="switch-icon-b text-{{ icon-b-color }}">
  15. {% include ui/icon.html icon=icon-b class=icon-b-class %}
  16. </span>
  17. </button>