Turn your Gatsby website from light mode to dark mode with Material-UI
- How to use localStorage to save a user's theme preference
- How to use Material-UI to apply a dark theme and light theme
- How to use Gatsby's
gatsby-browser
andgatsby-ssr
to avoid css style conflicts on rehydration with server side rendering (SSR) - How to use a single Mui Theme file to serve both dark/light theme variants ("single source of truth")
- How to use React's
useReducer
,useContext
,createContext
, andContext.Provider
https://snappywebdesign.net/blog/how-to-use-a-dark-theme-with-material-ui