pub fn theme_toggle()Expand description
Wires up every [name=theme-toggle] checkbox on the page: applies the
resolved theme (see [prefers_color_scheme]) as each control’s initial
checked state, and attaches a click listener that flips
data-theme between the control’s declared checked/unchecked values
(value="light,dark") — or between its single value and "default"
if no comma is present.
Calling this more than once (e.g. a rerun use_effect) is safe: a
control that’s already wired up is left alone rather than gaining a
duplicate listener.
§Panics
Panics if called outside a browser main-thread context (no window, or
no document on it).