Put in order · Next.js course · Module 3: Styling and Visual Optimization

Steps for implementing dark mode in Next.js

Arrange the steps for implementing dark mode in a Next.js application in the correct order:

Items to put in order

  • Save user preference in localStorage
  • Define CSS variables for light and dark themes
  • Create a theme toggle mechanism
  • Add prefers-color-scheme media query or .dark class

You can check the correct answer by solving this task in the CodeWorlds game.