Skip to content

Dark Mode

Dark mode is built into Starlight. The header menu lets readers choose dark, light, or automatic mode, persists the selection, and otherwise follows the operating-system preference.

No application component was needed for the theme switch. This sample’s custom.css defines accent tokens for both themes, and the same switch also selects matching Expressive Code colors.