buttons-table.html 1.6 KB

12345678910111213141516171819202122232425262728293031323334
  1. {% assign prefix = include.prefix | default: 'btn-' %}
  2. {% assign show-link = include.show-link | default: false %}
  3. {% assign show-states = include.show-states | default: false %}
  4. {% assign hide-labels = include.hide-labels | default: false %}
  5. {% assign variants = include.variants | default: site.theme-colors %}
  6. {% for state in site.button-states %}
  7. {% if show-states or state.class == null %}
  8. <div class="row g-2 align-items-center">
  9. {% unless hide-labels %}<div class="col-12 col-xl-2 font-weight-semibold">{{ state.title }}</div>{% endunless %}
  10. {% for type in variants %}
  11. {% if show-link or type[0] != 'link' %}
  12. <div class="col-6 col-sm-4 col-md-2 col-xl{% if include.auto-columns %}-auto{% endif %}{% if type[0] == 'light' %} bg-dark{% endif %} py-3">
  13. {% if include.icon or include.icon-only %}
  14. {% assign icon = type[1].icon %}
  15. {% endif %}
  16. {% assign class = prefix | append: type[0] %}
  17. {% if state.class %}
  18. {% assign class = class | append: ' ' | append: state.class %}
  19. {% endif %}
  20. {% if include.class %}
  21. {% assign class = class | append: ' ' | append: include.class %}
  22. {% endif %}
  23. {% assign text = type[1].title %}
  24. {% assign color = type[0] %}
  25. {% include "ui/button.html" block=true color=false class=class icon=icon icon-only=include.icon-only text=text %}
  26. </div>
  27. {% endif %}
  28. {% endfor %}
  29. </div>
  30. {% endif %}
  31. {% endfor %}