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

Button.counter does not have disabled styles #1955

Merged
merged 5 commits into from
Mar 16, 2022
Merged

Button.counter does not have disabled styles #1955

merged 5 commits into from
Mar 16, 2022

Conversation

pksjce
Copy link
Collaborator

@pksjce pksjce commented Mar 14, 2022

Describe your changes here.

Add disabled color and background to Button.Counter.

Screenshots

Before

image

After

image

Please provide before/after screenshots for any visual changes

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • 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.

@pksjce pksjce requested review from a team and siddharthkp March 14, 2022 07:15
@changeset-bot
Copy link

changeset-bot bot commented Mar 14, 2022

🦋 Changeset detected

Latest commit: b9a29d9

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

@pksjce pksjce requested a review from colebemis March 14, 2022 07:17
@github-actions
Copy link
Contributor

github-actions bot commented Mar 14, 2022

size-limit report 📦

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

@@ -22,7 +22,11 @@ export const getVariantStyles = (variant: VariantType = 'default', theme?: Theme
},
'&:disabled': {
color: 'primer.fg.disabled',
backgroundColor: 'btn.disabledBg'
backgroundColor: 'btn.disabledBg',
'[data-component="ButtonCounter"]': {
Copy link
Member

@siddharthkp siddharthkp Mar 14, 2022

Choose a reason for hiding this comment

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

optional: If it helps to make the code look nicer, you don't need the quotes:

[data-component="ButtonCounter"] is equivalent to [data-component=ButtonCounter]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice! I guess the quotes are only needed if there's special characters in the selector there.

@@ -22,7 +22,11 @@ export const getVariantStyles = (variant: VariantType = 'default', theme?: Theme
},
'&:disabled': {
color: 'primer.fg.disabled',
backgroundColor: 'btn.disabledBg'
Copy link
Member

@siddharthkp siddharthkp Mar 14, 2022

Choose a reason for hiding this comment

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

btn.disabledBg doesn't exist 🤔 , it falls back to btn.bg which is the right background anyways, so we can remove this line :)

image

@@ -89,6 +96,7 @@ export const getVariantStyles = (variant: VariantType = 'default', theme?: Theme
backgroundColor: 'btn.danger.disabledBg',
borderColor: 'btn.danger.disabledBorder',
'[data-component="ButtonCounter"]': {
color: 'btn.danger.disabledText',
Copy link
Member

Choose a reason for hiding this comment

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

Optional: As this is the same as the disabled button color, we could use color: inherit so that matches the parent even when we change the color value for the parent

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.

Looks good!

Mentioned 1 bug (not user facing though) and a couple of optional changes

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.

:shipit:

@pksjce pksjce merged commit 77e123f into main Mar 16, 2022
@pksjce pksjce deleted the pk/button-counter branch March 16, 2022 09:28
@primer-css primer-css mentioned this pull request Mar 16, 2022
pksjce added a commit that referenced this pull request Mar 17, 2022
* Add disabled styles to counter and add storybook

* Update with PR review comments

* Create yellow-planes-decide.md
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

3 participants