Skip to content

MarkosKon/gatsby-dark-mode

Repository files navigation

Dark mode in React (Gatsby)

This repository contains the source code for the following post: https://markoskon.com/dark-mode-in-react/. The last two solutions are not mentioned in the post and they seem pretty good.

  • master: Context, no local storage
  • context-local-storage-bug: Context, save preferences in local storage with the bug in production.
  • posts: An example of how React's hydrate treats differently attributes and text.
  • context-local-storage: Context, save preferences in local storage (correct).
  • css: Dan Abramov's solution from overreacted.io
  • css-refactor: A refactor of the previous method.
  • css-refactor-hook: The refactor with a useTheme hook (not linked in the post).
  • css-context-react-controls: An example with context and a hook where React has the control (not linked in the post).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published