Skip to content

Commit 04411ea

Browse files
crisbetojelbourn
authored andcommitted
fix(typography): deprecation warning if null font family is passed in (#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 #8973.
1 parent 6b2a71e commit 04411ea

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lib/core/typography/_typography-utils.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
$font-family: _mat-get-type-value($config, $level, font-family);
2727
}
2828

29-
@return unquote($font-family);
29+
@return if($font-family == null, $font-family, unquote($font-family));
3030
}
3131

3232
// Converts a typography level into CSS styles.
@@ -41,7 +41,11 @@
4141
@if ($font-size == inherit or
4242
$font-weight == inherit or
4343
$line-height == inherit or
44-
$font-family == inherit) {
44+
$font-family == inherit or
45+
$font-size == null or
46+
$font-weight == null or
47+
$line-height == null or
48+
$font-family == null) {
4549

4650
font-size: $font-size;
4751
font-weight: $font-weight;

0 commit comments

Comments
 (0)