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(Button): Add min-width to small size button #5141

Conversation

francinelucca
Copy link
Contributor

Closes https://github.com/github/primer/issues/3422

Ports over the fix made in view components for inaccessible target size.

When a button size is small and it's content is too small (for example, a single character), the button may fall below target size standards for accessibility due to not having a minimum width set. This PR enforces a minimum width of 28px on small buttons.

Before:
image

After:
image

Changelog

Changed

  • Added min-width to small button size styles in packages/react/src/Button/ButtonBase.module.css and packages/react/src/Button/styles.ts

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

Copy link

changeset-bot bot commented Oct 17, 2024

🦋 Changeset detected

Latest commit: 0074573

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

Copy link
Contributor

Uh oh! @francinelucca, the image you shared is missing helpful alt text. Check your pull request body.

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

🤖 Beep boop! This comment was added automatically by github/accessibility-alt-text-bot.

@francinelucca francinelucca added staff Author is a staff member component: Button Issues related to the Button component labels Oct 17, 2024
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Oct 17, 2024
Copy link
Contributor

github-actions bot commented Oct 17, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 97 KB (-0.02% 🔽)
packages/react/dist/browser.umd.js 97.4 KB (+0.01% 🔺)

…on-the-button-component-which-can-lead-to-target-size-failure' of github.com:primer/react into francinelucca/3422-prcbutton-no-minimum-width-enforced-on-the-button-component-which-can-lead-to-target-size-failure
@francinelucca
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Button Issues related to the Button component integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant