Skip to content

Commit

Permalink
refactor(material/icon): consolidate styles to ignore text-spacing
Browse files Browse the repository at this point in the history
Updates previous change to consolidate the important styles that
were added to ignore any externally placed text-spacing styles
be added to be targeted by all .mat-icon situations.

Fixes b/250063405
  • Loading branch information
essjay05 committed Oct 7, 2024
1 parent 248f39f commit 1901dea
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/material/icon/icon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ mat-icon {
}
}

.mat-icon:has(div[style*='letter-spacing:']):has(div[style*='word-spacing:']) {
// Apply styles to avoid text spacing
letter-spacing: 0 !important;
word-spacing: 0 !important;
line-height: 1 !important;
}

// Icons that will be mirrored in RTL.
[dir='rtl'] .mat-icon-rtl-mirror {
transform: scale(-1, 1);
Expand Down Expand Up @@ -81,6 +74,11 @@ mat-icon {
.mat-mdc-form-field .mat-icon,
.mat-grid-tile .mat-icon,
.mat-mdc-list-item .mat-icon,
.mat-mdc-list-option .mat-icon {
.mat-mdc-list-option .mat-icon,
.mat-icon:has(div[style*='letter-spacing:']):has(div[style*='word-spacing:']) {
overflow: visible;
// Apply styles to avoid text spacing
letter-spacing: 0 !important;
word-spacing: 0 !important;
line-height: 1 !important;
}

0 comments on commit 1901dea

Please sign in to comment.