|
88 | 88 | // New components should not use this function.
|
89 | 89 | @function mat-private-typography-to-2014-config($config) {
|
90 | 90 | @if $config == null {
|
91 |
| - @return null |
| 91 | + @return null; |
92 | 92 | }
|
93 | 93 | @if not mat-private-typography-is-2014-config($config) {
|
94 |
| - @return mat-typography-config( |
95 |
| - $display-4: map-get($config, headline-1), |
96 |
| - $display-3: map-get($config, headline-2), |
97 |
| - $display-2: map-get($config, headline-3), |
98 |
| - $display-1: map-get($config, headline-4), |
99 |
| - $headline: map-get($config, headline-5), |
100 |
| - $title: map-get($config, headline-6), |
101 |
| - $subheading-2: map-get($config, subtitle-1), |
102 |
| - $subheading-1: map-get($config, subtitle-2), |
103 |
| - $body-2: map-get($config, body-1), |
104 |
| - $body-1: map-get($config, body-2), |
105 |
| - $button: map-get($config, button), |
106 |
| - $caption: map-get($config, caption), |
| 94 | + $args: ( |
| 95 | + display-4: map-get($config, headline-1), |
| 96 | + display-3: map-get($config, headline-2), |
| 97 | + display-2: map-get($config, headline-3), |
| 98 | + display-1: map-get($config, headline-4), |
| 99 | + headline: map-get($config, headline-5), |
| 100 | + title: map-get($config, headline-6), |
| 101 | + subheading-2: map-get($config, subtitle-1), |
| 102 | + subheading-1: map-get($config, subtitle-2), |
| 103 | + body-2: map-get($config, body-1), |
| 104 | + body-1: map-get($config, body-2), |
| 105 | + button: map-get($config, button), |
| 106 | + caption: map-get($config, caption), |
107 | 107 | );
|
| 108 | + $non-null-args: (); |
| 109 | + @each $key, $value in $args { |
| 110 | + @if $value != null { |
| 111 | + $non-null-args: map-merge($non-null-args, ($key: $value)); |
| 112 | + } |
| 113 | + } |
| 114 | + @return mat-typography-config($non-null-args...); |
108 | 115 | }
|
109 | 116 | @return $config;
|
110 | 117 | }
|
|
115 | 122 | // 2018 - https://material.io/design/typography/the-type-system.html#type-scale
|
116 | 123 | @function mat-private-typography-to-2018-config($config) {
|
117 | 124 | @if $config == null {
|
118 |
| - @return null |
| 125 | + @return null; |
119 | 126 | }
|
120 | 127 | @if mat-private-typography-is-2014-config($config) {
|
121 | 128 | @return (
|
|
0 commit comments