Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !7052

Dark scheme overlay

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/Fabianopb/dark-scheme-overlay into master May 14, 2019
  • Overview 9
  • Commits 25
  • Pipelines 0
  • Changes 24

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:

Build error: image

Runtime error: image

Feedback is welcome!

Cheers! Closes https://github.com/facebook/create-react-app/issues/6760

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/Fabianopb/dark-scheme-overlay