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

Add color blind themes #1474

Merged
merged 5 commits into from
Sep 28, 2021
Merged

Add color blind themes #1474

merged 5 commits into from
Sep 28, 2021

Conversation

colebemis
Copy link
Contributor

@colebemis colebemis commented Sep 28, 2021

@changeset-bot
Copy link

changeset-bot bot commented Sep 28, 2021

🦋 Changeset detected

Latest commit: 56ed28a

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

This PR includes changesets to release 1 package
Name Type
@primer/components 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 Sep 28, 2021

size-limit report 📦

Path Size
dist/browser.esm.js 55.34 KB (+7.03% 🔺)
dist/browser.umd.js 55.63 KB (+6.99% 🔺)

Comment on lines 54 to 62
const colorSchemes = Object.entries(primitives.colors)
.map(([name, variables]) => {
const {colors, shadows} = partitionColors(variables)
return [name, {colors: omitScale(colors), shadows: omitScale(shadows)}]
})
.reduce((acc, [name, variables]) => {
acc[name] = variables
return acc
}, {})
Copy link
Contributor Author

@colebemis colebemis Sep 28, 2021

Choose a reason for hiding this comment

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

I refactored this part of the code to get all color schemes from Primer Primitives instead of hard-coding references to them. This means that when future color schemes are published in Primer Primitives, we only need to bump the Primer Primitives version number in Primer React to make the color schemes available to Primer React consumers.

@colebemis colebemis marked this pull request as ready for review September 28, 2021 20:42
@colebemis colebemis requested review from a team and dgreif September 28, 2021 20:42
*/
const darkHighContrastShadows = omitScale(darkHighContrast.shadows)
const colorSchemes = Object.entries(primitives.colors)
.map(([name, variables]) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Non-blocking: you could collapse this map into the reduce below, if you think it'd be more readable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup. Good call. I'll do that

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.

2 participants