[X] Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
13
Description
Any line-height set on a parent of an inline mat-icon with a larger font size results in clipping. As an example, let's add mat-typography on body which sets the font of the element it is placed on to body-1. This includes setting line-height to 20px. .mat-icon-inline sets line-height to inherit. This results in the line height being set to 20px and any font size larger than 20px causing clipping.
This problem was hidden by the fact that in earlier versions, the mat-icon overflowed so no clipped occurred. However, since #12429, overflow is set to hidden and clipping occurs.
A fix
The fix I found is removing line-height: inherit which allows .material-icons's line-height: 1 to apply. I can make a PR to make this change.
Reproduction
Steps to reproduce:
Set line height on body
Add an inline mat-icon with font-size larger than the line height set previously
Is this a regression?
The previous version in which this bug was not present was
13
Description
Any
line-height
set on a parent of an inlinemat-icon
with a larger font size results in clipping. As an example, let's addmat-typography
onbody
which sets the font of the element it is placed on tobody-1
. This includes settingline-height
to 20px..mat-icon-inline
setsline-height
toinherit
. This results in the line height being set to 20px and any font size larger than 20px causing clipping.This problem was hidden by the fact that in earlier versions, the mat-icon overflowed so no clipped occurred. However, since #12429, overflow is set to hidden and clipping occurs.
A fix
The fix I found is removing
line-height: inherit
which allows.material-icons
'sline-height: 1
to apply. I can make a PR to make this change.Reproduction
Steps to reproduce:
See https://stackblitz.com/edit/components-issue-vwhnst?file=src/app/example-component.html
Before v14 (overflowing mat-icon) This mat-icon has 38.4 margin top and bottom and a font-size of 76.8px.
Since v14
Expected Behavior
The icon should scale with font-size without clipping.
In this screenshot, the line-height is set to 1, the margin is correctly applied, and no clipping occurs.
Actual Behavior
The icon is clipped due to the line-height not being 1. This is caused by
line-height: inherit
.Environment
Angular CLI: 14.1.3 Node: 16.18.1 Package Manager: npm 8.19.2 OS: linux x64
Angular: 14.1.3 ... animations, cdk, cli, common, compiler, compiler-cli, core ... forms, language-service, material, material-moment-adapter ... platform-browser, platform-browser-dynamic, router
Package Version
@angular-devkit/architect 0.1401.3 @angular-devkit/build-angular 14.1.3 @angular-devkit/core 14.1.3 @angular-devkit/schematics 14.1.3 @schematics/angular 14.1.3 rxjs 6.6.7 typescript 4.7.4