From 4fcfbccc3c702a06bb9b83c990205fd1592acf74 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Thu, 1 Dec 2022 10:19:49 +0100 Subject: [PATCH] fix(material/button): ensure svg icon is centered Fixes that SVG icons sometimes weren't centered in an icon button. Fixes #26126. --- src/material/button/icon-button.scss | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/material/button/icon-button.scss b/src/material/button/icon-button.scss index 1eaca64d6b0f..694d2736e482 100644 --- a/src/material/button/icon-button.scss +++ b/src/material/button/icon-button.scss @@ -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.