Sandbox demo

Theming and Dark Mode

One source of truth for colors; system theme that just works.

A theme is a single object exporting colors, spacing, and typography. Components read from it via a hook (useTheme). When the system changes light↔dark, the hook re-evaluates and your tree re-renders. No manual conditionals scattered through screens.

Sandbox transcript
Codex · sandbox replay
Press Play to replay this transcript step-by-step.
0 / 6

The transcript is canned — no real API calls. The point is to internalize the loop: user → plan → tool → result → answer.

Check your understanding
Q1. What's the cleanest way to switch themes when the system mode changes?
· Score 100% on the quiz.