{# @description Light/dark theme toggle, or a theme menu when theme.choices is set. Renders nothing when only one theme is reachable. #}
{# @prop size:select['sm','md','lg'] | default:"sm" | description:"Icon button / toggle size." #}
{# @prop valign:select['top','bottom','left','right'] | default:"bottom" | description:"Dropdown vertical placement, used only when theme.choices is configured." #}
{# @prop halign:select['start','center','end'] | default:"end" | description:"Dropdown horizontal placement, used only when theme.choices is configured." #}
{# @prop compact:boolean | description:"Render the two-theme switcher as one square icon button instead of the icon/checkbox/icon row, for narrow slots. No effect when theme.choices is set, since that branch is already a square icon button." #}
{% load i18n %}
{% comment %}
Renders nothing when only one theme is reachable: choices that name just
the default, or no choices and a dark theme that is the default itself.
A control that switches the page to the theme it is already on does nothing.
{% endcomment %}
{% if mvp_config.theme.choices|length == 1 and mvp_config.theme.choices.0 == mvp_config.theme.default %}
{% elif not mvp_config.theme.choices and mvp_config.theme.dark == mvp_config.theme.default %}
{% elif mvp_config.theme.choices %}
{% comment %}
c-menu.item renders a
{% else %}
{% comment %}
theme-change reads this pair as "first,second". Built from configuration
so the toggle follows a project that replaces the packaged themes.
{% endcomment %}
{% if compact %}
{% else %}
{% endif %}
{% endif %}