Dark Mode Toggle
Advanced
35 XP
You can try this as a guest. Sign in to hand it in and keep your progress.
Sign in
Implement a dark/light mode toggle using CSS custom properties.
Requirements:
- Define a complete color system using CSS custom properties (--bg, --text, --primary, etc.).
- Light mode is the default. A
.dark-mode class on the body switches to dark.
- All colors must reference variables — no hardcoded colors in component styles.
- Include smooth transitions when toggling.
- Style the toggle switch itself as a pill/slider.
- Respect
prefers-color-scheme: dark as the initial default.
To pass
- Page should use CSS variable for background
- Cards should use CSS variable for background
- Toggle slider should be pill-shaped