Skip to content

Commit

Permalink
fix(material/button): ensure svg icon is centered (#26146)
Browse files Browse the repository at this point in the history
Fixes that SVG icons sometimes weren't centered in an icon button.

Fixes #26126.
  • Loading branch information
crisbeto committed Dec 1, 2022
1 parent 6f35599 commit 1d2d7e1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/material/button/icon-button.scss
Expand Up @@ -31,6 +31,13 @@
// Prevent the button from shrinking since it's always supposed to be a circle.
flex-shrink: 0;

// Ensure the icons are centered.
text-align: center;

svg {
vertical-align: baseline;
}

@include button-base.mat-private-button-disabled() {
// The color is already dimmed when the button is disabled. Restore the opacity both to
// help with the color contrast and to align with what we had before switching to the new API.
Expand Down

0 comments on commit 1d2d7e1

Please sign in to comment.