About this block
data-theme-toggle on any element flips the page between light and dark. The runtime sets data-theme on the page root, remembers the choice for the next visit and applies it before the page paints. The site needs a dark palette in its theme for the colours to change.
How to customize it
- Place it in the header or footer. Any element can carry the attribute; a button is the accessible choice, so keep its aria-label.
- The icons swap with the [[data-theme=dark]_&]: variant, which matches when the page root has data-theme=dark.
- Add a dark palette from the Theme tab (or the dark block in theme.css); without one the toggle changes the attribute and nothing else.