Repository navigation
Button.Icon: Fix clipped icons #78614
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
Merged
mirka
merged 10 commits into
WordPress:trunk
from
macayu17:fix/78595-button-icon-viewbox
May 29, 2026
+18
−5
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e3f2645
Button.Icon: Fix clipped icons
macayu17 a5ee513
UI: Add Button.Icon changelog entry
macayu17 445e7f5
fix: address Button.Icon review
macayu17 e328b3d
Merge branch 'trunk' into fix/78595-button-icon-viewbox
macayu17 bf4771d
Button.Icon: Add icon library story
macayu17 38c8b84
Merge branch 'trunk' into fix/78595-button-icon-viewbox
mirka 50ba24d
Remove unnecessary CSS variable fallback
mirka 0ed0b42
Remove test story, change icon to `wordpress`
mirka 77aa5d9
Clarify button icon margin
mirka 755e0a1
Move changelog
mirka 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -23,6 +23,9 @@ | |
| --wp-ui-button-aspect-ratio: auto; /* Useful for overrides such as icon buttons */ | ||
| --wp-ui-button-font-size: var(--wpds-typography-font-size-md); | ||
| --wp-ui-button-min-width: calc(4ch + 2 * var(--wp-ui-button-padding-inline)); | ||
| /* Icons are rendered as 24px but need to occupy a 16px footprint */ | ||
| /* TODO: replace hardcoded values with DS size tokens once available */ | ||
| --wp-ui-button-icon-margin: calc((16px - 24px) / 2); | ||
|
Member
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. Made another tweak here to set the intended value right here, instead of turning it negative at the usage site. I think it fits the name better ( |
||
|
|
||
| /* by default, borders have the same color as the background */ | ||
| --wp-ui-button-border-color: var(--wp-ui-button-background-color); | ||
|
|
@@ -142,6 +145,10 @@ | |
| --wp-ui-button-height: 24px; | ||
| } | ||
|
|
||
| .icon { | ||
| margin: var(--wp-ui-button-icon-margin); | ||
| } | ||
|
|
||
| /* Variants (`tone` + `variant`) overrides compared to default styles */ | ||
|
|
||
| /* All outline buttons have a border */ | ||
|
|
||
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.
Thanks for the demo 👍 Since it's for testing rather than public documentation, let's remove before merging though. I can add it to the e2e Storybook if necessary.