Skip to content

Commit

Permalink
fix(typography): deprecation warning if null font family is passed in (
Browse files Browse the repository at this point in the history
…angular#9002)

* Fixes a deprecation warning that gets logged by `mat-font-family` if the consumer passes in `null` as the `font-family`.
* Adds better handling if any of the typography properties are null.

Fixes angular#8973.
  • Loading branch information
crisbeto authored and jelbourn committed Jan 8, 2018
1 parent 5a800d7 commit fcaa3c4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lib/core/typography/_typography-utils.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
$font-family: _mat-get-type-value($config, $level, font-family);
}

@return unquote($font-family);
@return if($font-family == null, $font-family, unquote($font-family));
}

// Converts a typography level into CSS styles.
Expand All @@ -41,7 +41,11 @@
@if ($font-size == inherit or
$font-weight == inherit or
$line-height == inherit or
$font-family == inherit) {
$font-family == inherit or
$font-size == null or
$font-weight == null or
$line-height == null or
$font-family == null) {

font-size: $font-size;
font-weight: $font-weight;
Expand Down

0 comments on commit fcaa3c4

Please sign in to comment.