mirror of
https://github.com/tabler/tabler.git
synced 2025-12-21 17:34:25 +04:00
32 lines
1.8 KiB
HTML
32 lines
1.8 KiB
HTML
{% removeemptylines %}
|
|
{% assign spinner-class = false %}
|
|
|
|
{% assign color = include.color | default: 'secondary' %}
|
|
{% if include.color == false %}
|
|
{% assign color = null %}
|
|
{% endif %}
|
|
|
|
{% assign provider = include.provider | default: 'fe' %}
|
|
{% if include.text %}{% assign spinner-class="mr-2" %}{% endif %}
|
|
|
|
{% assign href = '#' %}
|
|
{% if include.href %}
|
|
{% if include.external %}
|
|
{% assign href = include.href %}
|
|
{% else %}
|
|
{% assign href = site.base | append: '/' | append: include.href %}
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
{% assign e = include.element | default: 'a' %}
|
|
<{{ e }}{% if e == 'a' %} href="{{ href }}"{% endif %}{% if include.type %} type="{{ include.type }}"{% endif %} class="btn{% if include.height %} btn-{{ include.height }}{% endif %}{% if color %} btn-{% if include.outline %}outline-{% endif %}{{ color }}{% endif %}{% if include.disabled %} disabled{% endif %}{% if include.square %} btn-square{% endif %}{% if include.pill %} btn-pill{% endif %}{% if include['size'] %} btn-{{ include['size'] }}{% endif %}{% if include.class %} {{ include.class }}{% endif %}{% if include.block %} btn-block{% endif %}{% if include.link %} btn-link{% endif %}{% if include.icon-only %} btn-icon{% endif %}"{% if include.external %} target="_blank" rel="noreferrer"{% endif %}{% if include.modal %} data-toggle="modal" data-target="#modal-{{ include.modal }}"{% endif %}>
|
|
{% if include.spinner %}
|
|
{% include ui/spinner.html color=false size="sm" class=spinner-class element="span" %}{% endif %}
|
|
{% if include.icon %}{% include ui/icon.html icon=include.icon use-svg=true color=include.icon-color %}{% endif %}
|
|
{% unless include.icon-only %}
|
|
{{ include.text | default: "Button" }}
|
|
{% if include.icon-right %}{% include ui/icon.html icon=include.icon-right use-svg=true right=true %}{% endif %}
|
|
{% endunless %}
|
|
</{{ e }}>
|
|
{% endremoveemptylines %}
|