{% comment %}Light/dark toggle. `apply()` sets the `dark` class, persists the choice and (in system mode) follows the OS. Pair with in to avoid a flash on load. Icons are overridable via the `light` / `dark` / `system_icon` slots.{% endcomment %}
{% if variant == 'headless' %} {% comment %}Bring your own UI. Slot content lives inside the x-data scope above, so any element can call set('light'|'dark'|'system') / toggle() and read `mode` / `isDark`.{% endcomment %} {{ slot }} {% elif variant == 'menu' %} {% comment %}Dropdown menu (shadcn-style): a trigger showing the current scheme, opening to Light / Dark / System rows. `:system` toggles whether the System row is offered.{% endcomment %}
{% if system %} {% endif %}
{% elif variant == 'switch' %} {# Sliding-pill switch: the thumb carries the current icon and slides on toggle. #} {% else %} {# Two-way icon button: flips light <-> dark #} {% endif %}