Skip to content

Fix: restore color prop functionality for StyledOcticon - #1781

Merged
rezrah merged 2 commits into
mainfrom
fix/styled-octicon-color-prop
Jan 10, 2022
Merged

Fix: restore color prop functionality for StyledOcticon#1781
rezrah merged 2 commits into
mainfrom
fix/styled-octicon-color-prop

Conversation

@rezrah

Copy link
Copy Markdown
Contributor

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 pksjceJanuary 7, 2022 14:26
@changeset-bot

changeset-botBot commented Jan 7, 2022

Copy link
Copy Markdown

🦋 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
NameType
@primer/reactPatch

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
@rezrah
rezrah temporarily deployed to visual-testing January 7, 2022 14:27 Inactive
@github-actions

github-actionsBot commented Jan 7, 2022

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
dist/browser.esm.js59.94 KB (+0.04% 🔺)
dist/browser.umd.js60.3 KB (+0.04% 🔺)

@siddharthkpsiddharthkp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice! Ship it

@siddharthkp

siddharthkp commented Jan 7, 2022

Copy link
Copy Markdown
Member

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
Copy Markdown
ContributorAuthor

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
Copy Markdown
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:

letsystemProps=Object.values(pick(propsByNameObject))

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

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

@rezrah@siddharthkp@maximedegreve