Skip to content

fix(material/icon): mat-icon misaligned when text-spacing is applied #30828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/dev-app/dev-app/dev-app-layout.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use '../../material/core/style/button-common';

html, body {
width: 100%;
height: 100%;
Expand Down Expand Up @@ -73,3 +75,5 @@ body {
display: flex;
align-items: center;
}

@include button-common.button-icon-no-shrink();
8 changes: 8 additions & 0 deletions src/material/core/style/_button-common.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@use './icon-common';
@use './vendor-prefixes';

// Mixin overriding default button styles like the gray background, the border, and the outline.
Expand All @@ -15,3 +16,10 @@
border: 0;
}
}

// Makes button icon not cut off/shrink making the icon visible to fix b/250063405
@mixin button-icon-no-shrink {
.mat-mdc-button-base {
@include icon-common.icon-no-shrink();
}
}
7 changes: 7 additions & 0 deletions src/material/core/style/_icon-common.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

// Use in components with icons to not cut off/shrink making the icon visible to fix b/250063405
@mixin icon-no-shrink() {
.mat-icon {
min-height: min-content; // stylelint-disable material/no-prefixes
}
}
Loading