seitime-frappe/frappe/templates/components/button.html
Faris Ansari 422f8d2123 fix: Better styling for smaller breakpoints
- Add extra large breakpoint
2020-04-23 21:38:55 +05:30

29 lines
1.2 KiB
HTML

---
name: "button"
variant: "secondary"
size: "small"
disabled: 0
url: null
---
{%- set static_classes = "border inline-flex justify-center items-center focus:outline-none font-medium transition duration-150 ease-in-out" -%}
{%- set dynamic_classes = {
"px-4 py-2 text-sm leading-5 rounded-md": size == "small",
"px-8 py-3 sm:px-10 sm:py-4 text-base sm:text-lg leading-6 rounded-lg": size == "large",
"opacity-50 cursor-not-allowed pointer-events-none": disabled,
"bg-primary-500 border-transparent hover:bg-primary-400 text-white focus:shadow-outline-primary focus:border-primary-600":
variant == "primary",
"bg-primary-100 border-transparent text-primary-700 hover:text-primary-600 hover:bg-primary-50 focus:shadow-outline-primary focus:border-primary-300":
variant == "secondary",
"bg-red-500 border-transparent hover:bg-red-400 text-white focus:shadow-outline-red focus:border-red-700":
variant == "danger"
}
-%}
{%- set html_tag = "a" if url else "button" -%}
<{{html_tag}}
class="{{ resolve_class([static_classes, dynamic_classes, class]) }}"
{{ 'disabled' if disabled else '' }}
{{ ('href="' + url + '"') if url else '' }}>
{{ label }}
</{{html_tag}}>