Skip to content

Commit

Permalink
fix(material/button): ensure svg icon is centered (angular#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 angular#26126.
  • Loading branch information
crisbeto authored and wagnermaciel committed Dec 9, 2022
1 parent 8a3cbc1 commit 1b4839c
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 1b4839c

Please sign in to comment.