Project focuses on showing the page in both dark and light theme.
- Develop an app which receives user preference about dark or light theme. In accordance with user's choice switch between dark & light theme.
- Dark-mode app is made by using React,
- Theme information is stored in local storage then assigned to a state variable,
- With the help of useEffect, everytime user changes the state variable component re-renders, theme changes and local storage is updated.
I used;
- React
- DOM manipulation,
- Local storage, useState, useEffect hooks.
- document.documentElement.className DOM element is quite useful for assigning global styles.