From 92d8368aea5e236524654015c4016dff93a5c614 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Wed, 26 Jul 2017 03:09:40 +0300 Subject: [PATCH] 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. --- src/lib/core/typography/_typography.scss | 2 +- src/lib/input/_input-theme.scss | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/core/typography/_typography.scss b/src/lib/core/typography/_typography.scss index 8426c1e6b0c5..b2eb6a9a059b 100644 --- a/src/lib/core/typography/_typography.scss +++ b/src/lib/core/typography/_typography.scss @@ -32,7 +32,7 @@ $caption: mat-typography-level(12px, 20px, 400), $button: mat-typography-level(14px, 14px, 500), // Line-height must be unit-less fraction of the font-size. - $input: mat-typography-level(inherit, 1.125, 400) + $input: mat-typography-level(16px, 1.125, 400) ) { // Declare an initial map with all of the levels. diff --git a/src/lib/input/_input-theme.scss b/src/lib/input/_input-theme.scss index d184d4749992..26eeede85aa3 100644 --- a/src/lib/input/_input-theme.scss +++ b/src/lib/input/_input-theme.scss @@ -150,7 +150,10 @@ $wrapper-padding-bottom: 0.5em + ($line-height * $subscript-font-scale); .mat-input-container { - @include mat-typography-level-to-styles($config, input); + font-family: mat-font-family($config); + font-size: inherit; + font-weight: mat-font-weight($config, input); + line-height: mat-line-height($config, input); } .mat-input-wrapper {