Skip to content

How to Use a Dark Theme with Material UI and Gatsby js using useReducer and useContext via Snappy Web Design

Notifications You must be signed in to change notification settings

SnappyWebDesign/material-ui-dark-mode

Repository files navigation

by Snappy Web Design

Material-UI

How to Use a Dark Theme with Material UI

Turn your Gatsby website from light mode to dark mode with Material-UI

In this Material-UI tutorial, you'll learn

  • 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 and gatsby-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, and Context.Provider

View the tutorial

https://snappywebdesign.net/blog/how-to-use-a-dark-theme-with-material-ui

About

How to Use a Dark Theme with Material UI and Gatsby js using useReducer and useContext via Snappy Web Design

Topics

Resources

Stars

Watchers

Forks