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

fix(sx): support Primer colors for border*Color properties #3619

Merged
merged 2 commits into from
Aug 15, 2023

Conversation

gr2m
Copy link
Contributor

@gr2m gr2m commented Aug 10, 2023

Closes #3618

Screenshots

Before

Screenshot of Box component code

After

Screenshot of Box component code

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Changes are SSR compatible
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@gr2m gr2m requested review from a team and broccolinisoup August 10, 2023 22:18
@changeset-bot
Copy link

changeset-bot bot commented Aug 10, 2023

🦋 Changeset detected

Latest commit: 968bae7

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 Patch

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


Include `border*Color` properties in sx to support named Primer colors

<!-- Changed components: _none_ -->
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case I think _all_ might have been the better option. If you agree and see that happening frequently let me know and I'll add the option to the changesets CLI

Copy link
Member

Choose a reason for hiding this comment

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

I had a few PRs that I thought "all" would make more sense but some were a bit vague 🤔 Similar to this case like it does affect almost all components but it doesn't really feel a component change to me maybe more of a system change that can be communicated with a different keyword? Curious to hear what you think!

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
dist/browser.esm.js 103.64 KB (0%)
dist/browser.umd.js 104.21 KB (0%)

Copy link
Member

@broccolinisoup broccolinisoup left a comment

Choose a reason for hiding this comment

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

🚀


Include `border*Color` properties in sx to support named Primer colors

<!-- Changed components: _none_ -->
Copy link
Member

Choose a reason for hiding this comment

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

I had a few PRs that I thought "all" would make more sense but some were a bit vague 🤔 Similar to this case like it does affect almost all components but it doesn't really feel a component change to me maybe more of a system change that can be communicated with a different keyword? Curious to hear what you think!

@gr2m gr2m added this pull request to the merge queue Aug 15, 2023
@gr2m
Copy link
Contributor Author

gr2m commented Aug 15, 2023

I had a few PRs that I thought "all" would make more sense but some were a bit vague 🤔 Similar to this case like it does affect almost all components but it doesn't really feel a component change to me maybe more of a system change that can be communicated with a different keyword? Curious to hear what you think!

I think _all_ is the right keyword here. Only consumers can ultimately know how significant a change is, I don't think we should filter out updates before they have a chance to see it.

If user feedback results in too much noise for their filtered changelogs than we can revise and think about additional keywords

Merged via the queue into main with commit d4ae582 Aug 15, 2023
@gr2m gr2m deleted the 3618-sx-border-color-type branch August 15, 2023 19:18
@primer-css primer-css mentioned this pull request Aug 15, 2023
import merge from 'deepmerge'

export type BetterCssProperties = {
[K in keyof SystemCssProperties]: K extends keyof ColorProps
? ThemeColorPaths | SystemCssProperties[K]
: K extends keyof BorderColorProps
Copy link
Collaborator

Choose a reason for hiding this comment

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

@gr2m I know this is late, but I wonder if there's some tests we can use to ensure these don't regress, or to ensure they're fully expressive of options that work, and don't include options that don't work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is a type-only change. Do you write tests for these with something like tsd?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also I feel if we added tests, we would only test behavior of styled-system?

Copy link
Collaborator

Choose a reason for hiding this comment

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

there are some other type-tests in the repo. I think since we're exposing a type that used in many places, it would be good to have some way to validate it, and ensure it's inclusive of all possible options.

I don't think tsd is used in the repo, but might be valuable to add something like it for type only assertions?

right now I think most type tests just ensure functions compile correctly - there's a bunch of files with .types.test suffixes where we do type only tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay cheers I'll send a follow up pull request, but can't say when I get to it

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.

TypeScript: Primer colors are not included in typeahead for border*Color properties in sx
3 participants