{# @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