Skip to content

Commit af695e4

Browse files
committed
fixup! refactor(material/theming): clean up theme file and use mdc typography everywhere
1 parent f81f64e commit af695e4

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

src/material/core/typography/_typography.scss

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -88,23 +88,30 @@
8888
// New components should not use this function.
8989
@function mat-private-typography-to-2014-config($config) {
9090
@if $config == null {
91-
@return null
91+
@return null;
9292
}
9393
@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),
107107
);
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...);
108115
}
109116
@return $config;
110117
}
@@ -115,7 +122,7 @@
115122
// 2018 - https://material.io/design/typography/the-type-system.html#type-scale
116123
@function mat-private-typography-to-2018-config($config) {
117124
@if $config == null {
118-
@return null
125+
@return null;
119126
}
120127
@if mat-private-typography-is-2014-config($config) {
121128
@return (

0 commit comments

Comments
 (0)