Put in order · Next.js course · Module 3: Styling and Visual Optimization
Dark Mode implementation steps
Arrange the Dark Mode implementation steps described in the lesson in the correct order:
Items to put in order
- Save the user's choice in localStorage
- Define CSS variables in :root and in the .dark-theme class
- Check system preference via matchMedia
- Toggle the .dark-theme class on the html element (classList.toggle)
You can check the correct answer by solving this task in the CodeWorlds game.