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: restore color prop functionality for StyledOcticon #1781

Merged
merged 2 commits into from
Jan 10, 2022

Conversation

rezrah
Copy link
Contributor

@rezrah rezrah commented Jan 7, 2022

Restores color prop functionality to StyledOcticon, which now works with both native and functional colours.

Other changes:

  • Docs updated to reflect correct usage
    • Updated prop tables to new format
    • Added component status

Before

Screenshot 2022-01-07 at 14 24 36

After

Screenshot 2022-01-07 at 14 24 47

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

@rezrah rezrah requested review from a team and pksjce January 7, 2022 14:26
@changeset-bot
Copy link

changeset-bot bot commented Jan 7, 2022

🦋 Changeset detected

Latest commit: d40abc7

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

@rezrah rezrah temporarily deployed to visual-testing January 7, 2022 14:26 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2022

size-limit report 📦

Path Size
dist/browser.esm.js 59.94 KB (+0.04% 🔺)
dist/browser.umd.js 60.3 KB (+0.04% 🔺)

Copy link
Member

@siddharthkp siddharthkp left a comment

Choose a reason for hiding this comment

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

Nice! Ship it

@siddharthkp
Copy link
Member

siddharthkp commented Jan 7, 2022

Sidenote: How does https://github.com/primer/eslint-plugin-primer-react know that it has to ignore color, which resembles a styled-system prop, on this specific component?

@rezrah
Copy link
Contributor Author

rezrah commented Jan 7, 2022

Sidenote: How does https://github.com/primer/eslint-plugin-primer-react know that it has to ignore color, which resembles a styled-system prop, on this specific component?

Looking at the rule source, there's an exclusion but interestingly color isn't defined there. It also looks like it's looking for a type signature that matches the one exported by styled-system, which this doesn't. It would probably be a bit limiting if we couldn't use props like color anymore tbh.

@siddharthkp
Copy link
Member

It also looks like it's looking for a type signature that matches the one exported by styled-system, which this doesn't.

Trying to understand the source, are you referring to this line? rules/no-system-props.js#L66:

let systemProps = Object.values(pick(propsByNameObject))

definition of pick: @styled-system/props/index.js#L45-L52

@rezrah rezrah merged commit 064828d into main Jan 10, 2022
@rezrah rezrah deleted the fix/styled-octicon-color-prop branch January 10, 2022 00:18
@primer-css primer-css mentioned this pull request Jan 10, 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.

3 participants