input-color.html 841 B

12345678910111213141516171819202122
  1. {% assign colors = '' | split: ',' %}
  2. {% unless include.hide-black-white %}
  3. {% assign colors = 'dark,white' | split: ',' %}
  4. {% endunless %}
  5. {% for color in site.colors limit: 9 %}
  6. {% assign colors = colors | push: color[0] %}
  7. {% endfor %}
  8. <div class="mb-3">
  9. <label class="form-label">{{ include.label | default: 'Color Input' }}</label>
  10. <div class="row g-2">
  11. {% for color in colors %}
  12. <div class="col-auto">
  13. <label class="form-colorinput{% if color == 'white' %} form-colorinput-light{% endif %}">
  14. <input name="{{ include.name | default: 'color' }}" type="radio" value="{{ color }}" class="form-colorinput-input" {% if forloop.index == 2 %} checked{% endif %}/>
  15. <span class="form-colorinput-color bg-{{ color }}{% if include.rounded %} rounded-circle{% endif %}"></span>
  16. </label>
  17. </div>
  18. {% endfor %}
  19. </div>
  20. </div>