The theme switcher in Leyline follows a simple rule: on the first visit, match the user’s OS preference. Once they tap the toggle, lock to their choice via localStorage.

This avoids two common annoyances: a site that ignores prefers-color-scheme, and a site that resets to its default every time you come back.