{#- How a value that is one of a few is drawn: a badge in its choice's tone, or green and grey for yes and no. -#} {% macro badge(item, raw, text) -%} {%- if item.widget == "checkbox" -%} {{ text }} {%- else -%} {%- set tone = item.tone_of(raw) if item.tone_of is defined else none -%} {{ text }} {%- endif -%} {%- endmacro %}