Skip to content

Instantly share code, notes, and snippets.

@e-oz
Created July 21, 2024 11:26
Show Gist options
  • Save e-oz/a0ad79c40706004d6b0ad6d6c7c14af5 to your computer and use it in GitHub Desktop.
Save e-oz/a0ad79c40706004d6b0ad6d6c7c14af5 to your computer and use it in GitHub Desktop.
Center the icon inside an Angular Material mat-icon-button
// If you use some "CSS reset" (Tailwind, Bootstrap,
// modern-normalize...), then mat-icon inside the
// Angular Material mat-icon-button will not be centered
// correctly - it will be shifted 2 pixels down.
// Here is the fix:
.mdc-icon-button {
display: flex !important;
flex-flow: row;
align-items: center;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment