-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add color modes to theming API #1112
Conversation
🦋 Changeset detectedLatest commit: 3fc66b3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/primer/primer-components/5TW2ViTVYiuPcWWZnduiThSUdwrt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made a few suggestions! One question I had that I don't think is covered by the docs - out of the box does the color scheme change at all depending on what OS color mode the user is in? Should we call out somewhere that PRC will only render in light mode unless you explicitly set up a switching mechanism using the useColorScheme
prop?
One more suggestion: should we add a glossary of terms at the top of the theme docs? 😂 |
…b.com:primer/components into update-theming-api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one typo, but otherwise this looks great 🎉
Problem
Primer React doesn't provide an easy way for consumers to change color modes in their applications.
Solution
This PR updates the Primer React theming API to provide first-class support for color modes.
👉 Click here to review the new theming documentation
Impact
Primer React consumers can now easily change color modes in their applications using the new
ThemeProvider
component.Breaking changes
You'll need to replace the
ThemeProvider
fromstyled-components
with the new Primer ReactThemeProvider
:Also, if you're customizing the theme, note that the structure of the theme object has changed to support color schemes:
cc @bscofield