Skip to content

Commit 6a829ff

Browse files
committed
fix(material/button): ensure svg icon is centered
Fixes that SVG icons sometimes weren't centered in an icon button. Fixes #26126.
1 parent 2e5fab6 commit 6a829ff

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/material/button/icon-button.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@
4545
border-radius: 50%;
4646
}
4747

48+
// Ensures that the icons are centered.
49+
.mat-icon {
50+
text-align: center;
51+
52+
svg {
53+
vertical-align: baseline;
54+
}
55+
}
56+
4857
// MDC adds some styles to icon buttons that conflict with some of our focus indicator styles
4958
// and don't actually do anything. This undoes those conflicting styles.
5059
&.mat-unthemed,

0 commit comments

Comments
 (0)