Skip to content

Commit f6558d6

Browse files
committed
refactor(material/icon): changes method of making icon visible with text-spacing
Updates previous fix to revert removal of overflow: hidden to remove the breaking change and updates the method of ensuring .mat-icon remains visible by applying flex-shrink to it so the icon does not get cut off and improves accessibility. Fixes b/250063405
1 parent b2011f8 commit f6558d6

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/material/button/button.scss

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
align-items: center;
2424
justify-content: center;
2525
box-sizing: border-box;
26-
min-width: min-content;
27-
min-height: min-content;
26+
min-width: 64px;
2827
border: none;
2928
outline: none;
3029
line-height: inherit;

src/material/icon/icon.scss

+9-5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ mat-icon {
2929
height: $size;
3030
width: $size;
3131

32+
// In some cases the icon elements may extend beyond the container. Clip these cases
33+
// in order to avoid weird overflows and click areas. See #11826.
34+
overflow: hidden;
35+
3236
&.mat-icon-inline {
3337
font-size: inherit;
3438
height: inherit;
@@ -40,11 +44,6 @@ mat-icon {
4044
content: attr(fontIcon);
4145
}
4246

43-
// Makes button icon overflow visible to fix b/250063405
44-
// Undoes previous fix to Issue #11826 in preference of
45-
// fixing to improve accessibility by not having the icon
46-
// get cut off
47-
overflow: visible;
4847
}
4948

5049
// Icons that will be mirrored in RTL.
@@ -65,3 +64,8 @@ mat-icon {
6564
}
6665
}
6766
}
67+
68+
// Makes button icon not cut off/shrink making the icon visible to fix b/250063405
69+
.mat-mdc-button-base .mat-icon {
70+
flex-shrink: 0;
71+
}

0 commit comments

Comments
 (0)