Theme switcher
Support light, dark, and system preferences without a distracting flash.
Customize the recipe
0/1500 characters
Prompt preview
# Theme switcher Support light, dark, and system preferences without a distracting flash. ## Deliverable A working switcher with persisted choices and examples across themes. ## Stack and visual direction - Recommended starting stack: React and TypeScript with semantic CSS variables. Use Storybook when isolated examples serve the deliverable. - Glassmorphism: Layer translucent panels over a controlled background. Add opaque fallbacks and verify text contrast across the underlying image. Apply this direction to the interface while keeping data and controls easy to read. - Inspect the workspace first. Adapt to its stack when it contains a project, or use the recommended starting stack in a new workspace. ## Tools and setup · Universal Use the receiving agent’s documented skill and tool mechanisms. Match setup to the agent and workspace you actually have. Check available tools first. Propose documented project-level setup only when it materially helps and follow the host's permission prompts. If a tool or integration is unavailable, continue with the workflow below using existing tools, local fixtures or a manual check. Keep secrets in the intended configuration environment. - [React Best Practices](https://github.com/vercel-labs/agent-skills/tree/main/skills/react-best-practices) (Skill) — Review React and Next.js data loading, rendering and bundle behavior. Fallback: Inspect the existing render and data-fetch paths and compare a production baseline using the project's available tooling. - [Next.js](https://github.com/vercel/next.js) (Repository) — Use App Router conventions, server rendering, metadata and accessible route structure. [Official setup](https://nextjs.org/docs/app/getting-started/installation). - [Web Design Guidelines](https://github.com/vercel-labs/agent-skills/tree/main/skills/web-design-guidelines) (Skill) — Review frontend UI against usability and accessibility guidance. Access to the current upstream guidelines for the skill's full review. Fallback: Perform the recipe's keyboard, focus, responsive and feedback checks manually. ## Workflow 1. Define paired semantic tokens, initialize from saved or system preference, and update system mode on OS changes. Wire an accessible preference control and capture the initial load. 2. Use the simplest implementation that delivers the stated outcome. Follow the user's project constraints and treat the starting stack as a default. Reuse existing work and ask for essential input only when it would change the result. Use realistic labeled sample data when real inputs are unavailable. 3. Run the applicable checks and report what actually passed along with any checks you could not run. ## Acceptance checks - [ ] A saved explicit theme survives reload and overrides the OS preference. - [ ] System mode follows the OS and each theme keeps controls distinguishable. - [ ] Walk the primary journey with keyboard only. Check visible focus, logical order, accessible names, readable contrast, zoom and reduced motion. Use axe where available and manually check behavior that automation cannot assess. - [ ] Verify real actions and persisted data where required. Exercise relevant loading, empty, invalid, pending, failure and success states. Provide a clear recovery path. - [ ] Use fixtures to verify core flows, including a narrow-screen layout and any applicable permission boundaries.
Recipe resources
Source, setup, and compatibility details.
React Best Practices
Review React and Next.js data loading, rendering and bundle behavior.
License · MIT
Next.js
Use App Router conventions, server rendering, metadata and accessible route structure.
License · MIT
Setup guide for Next.jsWeb Design Guidelines
Review frontend UI against usability and accessibility guidance.
Access to the current upstream guidelines for the skill's full review.
License · MIT
Playwright CLI
Walk real browser interactions and collect screenshots or evidence for regressions.
Node.js and supported browser binaries. Use a local build or authorized test environment.
License · Apache-2.0
Setup guide for Playwright CLI