Theme persistence questions
IDE
/add-plugin to get startedThemeProvider reads prefers-color-scheme once and never stores the result:
export function ThemeProvider({ children }: Props) { const prefersDark = useMediaQuery("(prefers-color-scheme: dark)"); const theme = prefersDark ? "dark" : "light";
| File | Change |
|---|---|
| db/migrations/0042_user_theme.sql | Add users.theme |
| src/theme/ThemeProvider.tsx | Read the saved value first |
Settings › Appearance now has a Light / Dark / System control, saved per user.
users.theme column, default systemThemeProvider reads the saved value first