@@ -17,84 +17,26 @@ $mat-base-styles-without-animation-query:
17
17
$mat-theme-styles-query : color ;
18
18
$mat-typography-styles-query : typography;
19
19
20
- // Mappings between Angular Material and MDC's typography levels.
21
- // TODO: delete once all MDC components have migrated to using the 2018 mappings.
22
- $mat-typography-2014-level-mappings : (
23
- mdc-to-mat : (
24
- headline1 : display- 4,
25
- headline2 : display- 3,
26
- headline3 : display- 2,
27
- headline4 : display- 1,
28
- headline5 : headline,
29
- headline6 : title,
30
- subtitle1 : subheading- 2,
31
- subtitle2 : subheading- 1,
32
- body1 : body- 2,
33
- body2 : body- 1,
20
+ // Mappings from Angular Material's typography levels to MDC's typography levels.
21
+ $mat-typography-mdc-level-mappings : (
22
+ headline-1 : headline1,
23
+ headline-2 : headline2,
24
+ headline-3 : headline3,
25
+ headline-4 : headline4,
26
+ headline-5 : headline5,
27
+ headline-6 : headline6,
28
+ subtitle-1 : subtitle1,
29
+ subtitle-2 : subtitle2,
30
+ body-1 : body1,
31
+ body-2 : body2,
34
32
caption : caption ,
35
33
button : button,
36
- overline : null
37
- ),
38
- mat-to-mdc : (
39
- display-4 : headline1,
40
- display-3 : headline2,
41
- display-2 : headline3,
42
- display-1 : headline4,
43
- headline : headline5,
44
- title : headline6,
45
- subheading-2 : subtitle1,
46
- subheading-1 : subtitle2,
47
- body-2 : body1,
48
- body-1 : body2,
49
- caption : caption ,
50
- button : button,
51
- input : null
52
- )
53
- );
54
-
55
- // Mappings between Angular Material and MDC's typography levels.
56
- $mat-typography-2018-level-mappings : (
57
- // Maps from MDC typography levels (e.g. body1) to Angular Material typography levels
58
- // (e.g. body-1).
59
- mdc-to-mat : (
60
- headline1 : headline- 1,
61
- headline2 : headline- 2,
62
- headline3 : headline- 3,
63
- headline4 : headline- 4,
64
- headline5 : headline- 5,
65
- headline6 : headline- 6,
66
- subtitle1 : subtitle- 1,
67
- subtitle2 : subtitle- 2,
68
- body1 : body- 1,
69
- body2 : body- 2,
70
- caption : caption ,
71
- button : button,
72
- overline : overline
73
- ),
74
- // Maps from Angular Material typography levels (e.g. body-1) to MDC typography levels
75
- // (e.g. body1).
76
- mat-to-mdc : (
77
- headline-1 : headline1,
78
- headline-2 : headline2,
79
- headline-3 : headline3,
80
- headline-4 : headline4,
81
- headline-5 : headline5,
82
- headline-6 : headline6,
83
- subtitle-1 : subtitle1,
84
- subtitle-2 : subtitle2,
85
- body-1 : body1,
86
- body-2 : body2,
87
- caption : caption ,
88
- button : button,
89
- overline : overline
90
- )
34
+ overline : overline
91
35
);
92
36
93
37
// Converts an Angular Material typography level config to an MDC one.
94
38
@function mat-typography-level-config-to-mdc ($mat-config , $mat-level ) {
95
- $mappings : if (mat-private-typography-is-2018-config ($mat-config ),
96
- $mat-typography-2018-level-mappings , $mat-typography-2014-level-mappings );
97
- $mdc-level : map-get (map-get ($mappings , mat-to-mdc ), $mat-level );
39
+ $mdc-level : map-get ($mat-typography-mdc-level-mappings , $mat-level );
98
40
99
41
@return map-merge (
100
42
if ($mdc-level ,
@@ -119,13 +61,10 @@ $mat-typography-2018-level-mappings: (
119
61
}
120
62
121
63
// Converts an Angular Material typography config to an MDC one.
122
- @function mat-typography-config-to-mdc ($mat-config : mat-typography-config () ) {
64
+ @function mat-typography-config-to-mdc ($mat-config ) {
123
65
$mdc-config : ();
124
66
125
- $mappings : if (mat-private-typography-is-2018-config ($mat-config ),
126
- $mat-typography-2018-level-mappings , $mat-typography-2014-level-mappings );
127
-
128
- @each $mdc-level , $mat-level in map-get ($mappings , mdc-to-mat ) {
67
+ @each $mat-level , $mdc-level in $mat-typography-mdc-level-mappings {
129
68
$mdc-config : map-merge (
130
69
$mdc-config ,
131
70
($mdc-level : mat-typography-level-config-to-mdc ($mat-config , $mat-level )));
0 commit comments