Created by: Fabianopb
This PR introduces the dark theme for react-error-overlay!
The theme is inferred in browsers that support the media feature prefers-color-scheme to detect the preferred theme in the user's system. This feature is still cutting-edge and should be released soon in the most used browsers.
Some important notes about this solution:
- The general idea is similar as in react-devtools, which abstracts all "themeable" variables to a theme object;
- The theme object is shared throughout react-error-overlay using the Context API;
- Most components and containers were refactor to allow the use of hooks (mostly
useContext
).
Tested with Chrome Canary and Firefox Nightly as both already support that. A few screenshots comparing the light and the dark themes:
Feedback is welcome!
Cheers! Closes https://github.com/facebook/create-react-app/issues/6760