bouton.html 11 lignes · 870 octets
{# Boutons (charte §3 ; design.md : button-primary, button-outline, icon-button).
   Ces macros produisent seulement les classes, pour garder les attributs hx-* libres :
   <button class="{% call b::classes("default") %}{% endcall %}" hx-post="…">…</button> #}
{% macro classes(variante) -%}
inline-flex items-center justify-center gap-xs text-base transition-colors disabled:cursor-not-allowed disabled:opacity-60
{%- if variante == "default" %} h-10 rounded-xl bg-primary px-md text-primary-foreground hover:bg-primary/90
{%- else if variante == "outline" %} h-10 rounded-xl border border-ink px-[15px] text-ink hover:bg-muted
{%- else if variante == "destructive" %} h-10 rounded-xl bg-destructive px-md text-on-primary hover:bg-destructive/90
{%- else if variante == "icone" %} size-10 shrink-0 rounded-full text-ink hover:bg-muted
{%- endif %}
{%- endmacro %}