1
0
mirror of https://github.com/tabler/tabler.git synced 2026-08-10 13:22:22 +04:00
Files
tabler/preview/pages/_includes/ui/icon.html
T
Paweł Kuna cb278c762d Add segmented control component (#2087)
* Add segmented control component and update related files

* Implement segmented navigation component and update related styles

* Create grumpy-flowers-act.md

* Refactor .gitignore and move playground pages to preview directory

* Enhance segmented navigation with hover state and class support

* Refactor segmented control layout for improved responsiveness and alignment
2025-02-06 18:02:46 +01:00

33 lines
1.2 KiB
HTML

{% assign icon-name = include.icon %}
{% assign icon-type = include.type | default: "outline" %}
{% assign replace-to = "icon" %}
{% if include.class %}
{% assign replace-to = replace-to | append: ' ' | append: include.class %}
{% endif %}
{% if include.color %}
{% assign replace-to = replace-to | append: ' text-' | append: include.color %}
{% endif %}
{% if include.inline %}
{% assign replace-to = replace-to | append: ' icon-inline' %}
{% endif %}
{% if include['size'] %}
{% assign replace-to = replace-to | append: ' icon-' | append: include['size'] %}
{% endif %}
{% assign replace-to = 'class="' | append: replace-to | append: '"' %}
{% if site.useIconfont %}
<i class="icon ti ti-{{ icon-name }}{% if include.color %} {{ include.color }}{% endif %}{% if include.class %} {{ include.class }}{% endif %}"></i>
{% elsif icons[icon-name] %}
<!-- Download SVG icon from http://tabler.io/icons/icon/{{ icon-name }} -->
{% assign svg-icon = icons[icon-name].svg[icon-type] | default: '' %}
{% assign svg-icon = svg-icon | replace: '<path stroke="none" d="M0 0h24v24H0z" fill="none"/>', '' %}
{{ svg-icon | replace_regex: 'class=\"[^"]+\"', replace-to }}
{% endif %}