Skip to content
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

feat(ThemeProvider): add dark, light alias for ThemeProvider #2259

Merged
merged 5 commits into from
Aug 24, 2022

Conversation

joshblack
Copy link
Member

Closes https://github.com/github/primer/issues/919

Update ThemeProvider's ColorMode to accept dark and light as aliases for night and day. Let me know if I missed any branches here that could be seeing dark or light as colorMode, was trying to following along in the source code but could easily have missed a path 👀

Question for reviewers

What would be the best way to test this in ThemeProvider.test.tsx? 👀

@joshblack joshblack requested review from a team and colebemis August 23, 2022 16:55
@changeset-bot
Copy link

changeset-bot bot commented Aug 23, 2022

🦋 Changeset detected

Latest commit: c07ffb6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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

@github-actions
Copy link
Contributor

github-actions bot commented Aug 23, 2022

size-limit report 📦

Path Size
dist/browser.esm.js 75.63 KB (+0.02% 🔺)
dist/browser.umd.js 76.24 KB (+0.02% 🔺)

@joshblack joshblack temporarily deployed to github-pages August 23, 2022 17:04 Inactive
Copy link
Contributor

@colebemis colebemis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be convenient for product teams. Thanks, @joshblack!

@colebemis
Copy link
Contributor

What would be the best way to test this in ThemeProvider.test.tsx? 👀

Maybe copy and paste these test cases and replace day/night with light/dark:

https://github.com/primer/react/blob/main/src/__tests__/ThemeProvider.test.tsx#L119-L137

@joshblack
Copy link
Member Author

@colebemis love it, done!

@joshblack joshblack temporarily deployed to github-pages August 24, 2022 16:34 Inactive
@joshblack joshblack enabled auto-merge (squash) August 24, 2022 18:20
@joshblack joshblack temporarily deployed to github-pages August 24, 2022 18:27 Inactive
@joshblack joshblack merged commit 0383f1a into main Aug 24, 2022
@joshblack joshblack deleted the 919-add-alias branch August 24, 2022 18:29
@primer-css primer-css mentioned this pull request Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants