What this thread does
The case
You want the app to follow the user's light or dark setting, offer a manual toggle that remembers the choice, use one set of colour tokens everywhere, and not flash the wrong theme on reload. Stack: Tailwind v4 with shadcn/ui, Next.js for the reload fix.
This is a map, not new advice: linked rows point to existing WhatWorks threads. Nobody here ran this whole build; the Status column says what each linked thread rests on. "Tried" would need a linked trial report; the DESIGN.md thread now links a lab-tested package, which does not establish an end-to-end trial.
Parts, in the order people do them
| Part | What to use | Status | Link |
|---|---|---|---|
| Light, dark and system toggle | Class or data-theme approach in Tailwind v4 | Documented: vendor or primary source, not tried (no linked trial) | How do I add a light, dark and system theme toggle with Tailwind v4? |
| No wrong-theme flash on reload | Inline script before paint (next-themes pattern) | Documented: vendor or primary source, not tried (no linked trial) | Why does my Next.js site flash light before dark mode on reload? |
| Tokens from the design file | Figma MCP using your tokens, not hard-coded colours | Documented: vendor or primary source, not tried (no linked trial) | How do I make Figma MCP code use my design tokens? |
| Tokens written down for the agent | DESIGN.md spec with lint and export | Lab-tested package: clean-project checks passed; full build not tried | How do I give my agent a DESIGN.md so every screen matches? |
| Agent writes old Tailwind syntax | Upgrade-guide fix for v3 habits | Documented: vendor or primary source, not tried (no linked trial) | My agent keeps writing Tailwind v3 code in my v4 project: fix? |
| Component library choice | MUI or shadcn when the agent writes the UI | Untried: community post or suggestion only, no linked trial | MUI or shadcn for an internal dashboard when the agent writes it? |
| Several brand themes from one codebase | No tested answer yet | No tested answer yet | none (see open request) |
Where it breaks
- Page flashes light then dark -> Why does my Next.js site flash light before dark mode on reload?
- Generated code ignores your colour tokens -> How do I make Figma MCP code use my design tokens?
- Dark variant classes do nothing -> My agent keeps writing Tailwind v3 code in my v4 project: fix?
Open questions
- Parts marked "No tested answer yet" are gaps in WhatWorks; ask for them with the request tool so an editor can look: multiple brand themes (white-label) from one token set.
Sources
Each linked WhatWorks thread cites its own primary sources; this page adds none of its own. Status labels were checked against the linked thread pages on 15 November 2026.
As of October 2026. a records table, see case-expense-table-nextjs-supabase-filters-sort-csv-export; admin screens, see case-admin-panel-roles-nextjs-supabase-who-can-see-what.
Started from a post by @WhatWorks editors, packaged by the editor.