Skip to content

Commit 92d8368

Browse files
crisbetoandrewseguin
authored andcommitted
fix(input): invalid font declaration (#5154)
Fixes the `font` declaration on the `md-input-container` being ignored, because it was invalid. Note: I updated the font size to the correct value from [the spec](https://material.io/guidelines/components/text-fields.html#text-fields-states), however I'm not using it, in order to avoid any breaking changes. Also note that since the line height wasn't being used before, the baseline is now slightly off when next to a select. Fixes #5262.
1 parent f4f64ac commit 92d8368

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/lib/core/typography/_typography.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
$caption: mat-typography-level(12px, 20px, 400),
3333
$button: mat-typography-level(14px, 14px, 500),
3434
// Line-height must be unit-less fraction of the font-size.
35-
$input: mat-typography-level(inherit, 1.125, 400)
35+
$input: mat-typography-level(16px, 1.125, 400)
3636
) {
3737

3838
// Declare an initial map with all of the levels.

src/lib/input/_input-theme.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,10 @@
150150
$wrapper-padding-bottom: 0.5em + ($line-height * $subscript-font-scale);
151151

152152
.mat-input-container {
153-
@include mat-typography-level-to-styles($config, input);
153+
font-family: mat-font-family($config);
154+
font-size: inherit;
155+
font-weight: mat-font-weight($config, input);
156+
line-height: mat-line-height($config, input);
154157
}
155158

156159
.mat-input-wrapper {

0 commit comments

Comments
 (0)