-
Notifications
You must be signed in to change notification settings - Fork 116
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
Add min-width to small size Button #2821
Conversation
🦋 Changeset detectedLatest commit: 627b1f1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
c546607
to
d4b0359
Compare
|
@@ -128,6 +128,7 @@ summary.Button { | |||
height: var(--control-small-size); | |||
padding: 0 var(--control-small-paddingInline-condensed); | |||
gap: var(--control-small-gap); | |||
min-width: 24px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
min-width: 24px; | |
min-width: var(--control-small-size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah thank you! Sorry if this is a silly q- where are these defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not silly! You can find it in our docs: https://primer.style/foundations/primitives/size#controls. For this kind of change in particular, I would just look at what other sizing variables are used in the rest of the component CSS and try and align with that 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL! Thank you! ⭐
Co-authored-by: Katie Langerman <[email protected]>
0f1142c
to
627b1f1
Compare
I am not authorized to merge so feel free to merge this whenever :) |
Authors: Please fill out this form carefully and completely.
Reviewers: By approving this Pull Request you are approving the code change, as well as its deployment and mitigation plans.
Please read this description carefully. If you feel there is anything unclear or missing, please ask for updates.
What are you trying to accomplish?
This PR adds guardrails to ensure a min-width of 24px for
small
variant of button. When inputting one character, such asI
, the width of the button will be 21px which makes it fail the target size requirement.Before:
After:
Integration
I don't believe so.
List the issues that this change affects.
Fixes: https://github.com/github/primer/issues/3073
Risk Assessment
Anything you want to highlight for special attention from reviewers?
Are there any concerns with the
min-width
overrididing themin-width: max-content
set on the base style?I only targetted the
small
variant to keep the changes scoped.Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.