Next.js uses next-themes to implement a bright and dark theme switcher.
Bright and Dark Themes
Bright and dark themes refer to themes with light or dark color schemes. Depending on the user’s context (e.g., daytime or nighttime), providing an option to switch the overall system colors can enhance the visual comfort for users.
Git Repository
This chapter is part of the Next.js beginner course series. To view the code for this chapter, check out the following git repository and switch to the extra1 branch:
return ( <divclassName={'w-screenflexflex-rowjustify-center'}> {/* Prose ensures that headings within the text have corresponding styles. `dark:prose-invert` is used to adapt prose for dark themes. */} <divclassName={`prosedark:prose-invert`} dangerouslySetInnerHTML={{__html:html}}> </div> </div> ) }