Skip to content

Commit c388758

Browse files
committed
fix(material/button): ensure svg icon is centered (#26146)
Fixes that SVG icons sometimes weren't centered in an icon button. Fixes #26126. (cherry picked from commit 1d2d7e1)
1 parent 61ea0f9 commit c388758

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/material/button/icon-button.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@
3131
// Prevent the button from shrinking since it's always supposed to be a circle.
3232
flex-shrink: 0;
3333

34+
// Ensure the icons are centered.
35+
text-align: center;
36+
37+
svg {
38+
vertical-align: baseline;
39+
}
40+
3441
@include button-base.mat-private-button-disabled() {
3542
// The color is already dimmed when the button is disabled. Restore the opacity both to
3643
// help with the color contrast and to align with what we had before switching to the new API.

0 commit comments

Comments
 (0)