Skip to content

Commit

Permalink
fix(material/button): ensure svg icon is centered
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 2e5fab6 commit 6a829ff
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/material/button/icon-button.scss
Expand Up @@ -45,6 +45,15 @@
border-radius: 50%;
}

// Ensures that the icons are centered.
.mat-icon {
text-align: center;

svg {
vertical-align: baseline;
}
}

// MDC adds some styles to icon buttons that conflict with some of our focus indicator styles
// and don't actually do anything. This undoes those conflicting styles.
&.mat-unthemed,
Expand Down

0 comments on commit 6a829ff

Please sign in to comment.