-
Notifications
You must be signed in to change notification settings - Fork 538
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
Corrects styling on Button
s that only have a count
and icon
#5448
Open
mperrotti
wants to merge
15
commits into
main
Choose a base branch
from
mp/iconbutton-count
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 14 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
17e1174
adds 'count' prop to IconButton
mperrotti fe74ed1
adds VRT for IconButton with trailing counter
mperrotti 6b025a8
updates IconButton component API docs
mperrotti 274d9a8
adds changeset
mperrotti be1808a
Merge branch 'main' into mp/iconbutton-count
mperrotti 001bdc8
test(vrt): update snapshots
mperrotti 6dbcecf
adds 'count' to IconButton Playground story
mperrotti ea7326a
Merge branch 'mp/iconbutton-count' of github.com:primer/react into mp…
mperrotti f4a26e4
addresses feedback to modify component API
mperrotti fe83b2d
Merge branch 'main' of github.com:primer/react into mp/iconbutton-count
mperrotti 049d430
modifies changeset
mperrotti bf5f352
reverts new IconButton VRT
mperrotti 50070c4
reverts new IconButton stories
mperrotti e46cda0
test(vrt): update snapshots
mperrotti 07f8bc9
Merge branch 'main' into mp/iconbutton-count
mperrotti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@primer/react": minor | ||
--- | ||
|
||
Corrects horizontal padding of `<Button>` when the button only contains an icon and a counter label (no button text label). |
Binary file added
BIN
+4.97 KB
...nButton.test.ts-snapshots/IconButton-Trailing-Counter-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.96 KB
.../IconButton.test.ts-snapshots/IconButton-Trailing-Counter-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.01 KB
...tton.test.ts-snapshots/IconButton-Trailing-Counter-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.97 KB
...ponents/IconButton.test.ts-snapshots/IconButton-Trailing-Counter-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.97 KB
...nButton.test.ts-snapshots/IconButton-Trailing-Counter-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.04 KB
...Button.test.ts-snapshots/IconButton-Trailing-Counter-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.06 KB
...ton.test.ts-snapshots/IconButton-Trailing-Counter-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.04 KB
...onents/IconButton.test.ts-snapshots/IconButton-Trailing-Counter-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.04 KB
...Button.test.ts-snapshots/IconButton-Trailing-Counter-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -505,6 +505,20 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||
color: inherit !important; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
/* Icon-only + Counter */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
&:where([data-has-count]):has([data-component='leadingVisual']):not(:has([data-component='text'])) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
padding-inline: var(--control-medium-paddingInline-condensed); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
&:where([data-size='small']) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
padding-inline: var(--control-xsmall-paddingInline-condensed); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
&:where([data-size='large']) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
padding-inline: var(--control-large-paddingInline-normal); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+511
to
+521
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think this will work for lint but the formatting might be off |
||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
.ConditionalWrapper { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should we add an aria-label or a Tooltip to this example?