{# A status pill, as a macro: components/badge.html (the Python Badge) and any template that marks a row or a figure. {% from "components/_badge.html" import badge %} {{ badge("Overdue", "danger") }} {{ badge("Quoted · 60 %", dashed=true, tip="Holds time for an open quote") }} icon_name is an icon() name shown before the text. text is escaped (pass Markup for intentional HTML); tone is neutral / info / success / warning / danger, anything else neutral. dashed draws the edge dashed: a mark that is not settled yet (a suggestion, an offer), still in its tone. tip is a tooltip — the browser's title with JavaScript off, the library's on hover and keyboard focus (the badge then takes focus). The text says what it means; the tone only reinforces it, and its ink/ground pair is in contrast.py's PAIRS. #} {% macro badge(text, tone="neutral", icon_name=none, dashed=false, tip=none, id=none, css_class=none) -%} {%- if icon_name %}{{ icon(icon_name, size="sm", cls="fcu-badge__icon") }}{% endif %}{{ text }} {%- endmacro %}