Skip to content

Commit c9e9cb7

Browse files
committed
fix(material/icon): mat-icon misaligned when text-spacing is applied
add icon css move style to a mixin move icon move overrides to demo remove import move mixin app layout remove flex shrink
1 parent a7ff33c commit c9e9cb7

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

src/dev-app/dev-app/dev-app-layout.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use '../../material/core/style/button-common';
2+
13
html, body {
24
width: 100%;
35
height: 100%;
@@ -73,3 +75,5 @@ body {
7375
display: flex;
7476
align-items: center;
7577
}
78+
79+
@include button-common.button-icon-no-shrink();

src/material/core/style/_button-common.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@use './icon-common';
12
@use './vendor-prefixes';
23

34
// Mixin overriding default button styles like the gray background, the border, and the outline.
@@ -15,3 +16,10 @@
1516
border: 0;
1617
}
1718
}
19+
20+
// Makes button icon not cut off/shrink making the icon visible to fix b/250063405
21+
@mixin button-icon-no-shrink {
22+
.mat-mdc-button-base {
23+
@include icon-common.icon-no-shrink();
24+
}
25+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
// Use in components with icons to not cut off/shrink making the icon visible to fix b/250063405
3+
@mixin icon-no-shrink() {
4+
.mat-icon {
5+
min-height: min-content; // stylelint-disable material/no-prefixes
6+
}
7+
}

0 commit comments

Comments
 (0)