Skip to content

Commit f1f89d4

Browse files
committed
fix(material/core): allow mixins to handle 2018 typography configs
1 parent e436479 commit f1f89d4

File tree

56 files changed

+96
-71
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+96
-71
lines changed

src/material-experimental/mdc-autocomplete/_autocomplete-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}
1212

1313
@mixin mat-mdc-autocomplete-typography($config-or-theme) {
14-
$config: mat-get-typography-config($config-or-theme);
14+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
1515
@include mat-using-mdc-typography($config) {
1616
@include mdc-menu-surface-core-styles($mat-typography-styles-query);
1717

src/material-experimental/mdc-button/_button-theme.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ $mat-button-state-target: '.mdc-button__ripple';
167167
}
168168

169169
@mixin mat-mdc-button-typography($config-or-theme) {
170-
$config: mat-get-typography-config($config-or-theme);
170+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
171171
@include mat-using-mdc-typography($config) {
172172
@include mdc-button-without-ripple($query: $mat-typography-styles-query);
173173
}
@@ -253,7 +253,7 @@ $mat-button-state-target: '.mdc-button__ripple';
253253
}
254254

255255
@mixin mat-mdc-fab-typography($config-or-theme) {
256-
$config: mat-get-typography-config($config-or-theme);
256+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
257257
@include mat-using-mdc-typography($config) {
258258
@include mdc-fab-without-ripple($query: $mat-typography-styles-query);
259259
}
@@ -326,7 +326,7 @@ $mat-button-state-target: '.mdc-button__ripple';
326326
}
327327

328328
@mixin mat-mdc-icon-button-typography($config-or-theme) {
329-
$config: mat-get-typography-config($config-or-theme);
329+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
330330
@include mat-using-mdc-typography($config) {
331331
@include mdc-icon-button-without-ripple($query: $mat-typography-styles-query);
332332
}

src/material-experimental/mdc-card/_card-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
}
3333

3434
@mixin mat-mdc-card-typography($config-or-theme) {
35-
$config: mat-get-typography-config($config-or-theme);
35+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
3636
@include mat-using-mdc-typography($config) {
3737
@include mdc-card-without-ripple($query: $mat-typography-styles-query);
3838

src/material-experimental/mdc-checkbox/_checkbox-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
}
8484

8585
@mixin mat-mdc-checkbox-typography($config-or-theme) {
86-
$config: mat-get-typography-config($config-or-theme);
86+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
8787
@include mat-using-mdc-typography($config) {
8888
@include mdc-checkbox-without-ripple($query: $mat-typography-styles-query);
8989
@include mdc-form-field-core-styles($query: $mat-typography-styles-query);

src/material-experimental/mdc-chips/_chips-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
}
5757

5858
@mixin mat-mdc-chips-typography($config-or-theme) {
59-
$config: mat-get-typography-config($config-or-theme);
59+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
6060
@include mdc-chip-set-core-styles($query: $mat-typography-styles-query);
6161
@include mat-using-mdc-typography($config) {
6262
@include mdc-chip-without-ripple($query: $mat-typography-styles-query);

src/material-experimental/mdc-core/option/_optgroup-theme.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
}
2020
}
2121

22-
@mixin mat-mdc-optgroup-typography($config-or-theme) {
23-
$config: mat-get-typography-config($config-or-theme);
24-
}
22+
@mixin mat-mdc-optgroup-typography($config-or-theme) {}
2523

2624
@mixin mat-mdc-optgroup-density($config-or-theme) {
2725
$density-scale: mat-get-density-config($config-or-theme);

src/material-experimental/mdc-core/option/_option-theme.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@
4141
}
4242
}
4343

44-
@mixin mat-mdc-option-typography($config-or-theme) {
45-
$config: mat-get-typography-config($config-or-theme);
46-
}
44+
@mixin mat-mdc-option-typography($config-or-theme) {}
4745

4846
@mixin mat-mdc-option-density($config-or-theme) {
4947
$density-scale: mat-get-density-config($config-or-theme);

src/material-experimental/mdc-dialog/_dialog-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010

1111
@mixin mat-mdc-dialog-typography($config-or-theme) {
12-
$config: mat-get-typography-config($config-or-theme);
12+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
1313
@include mat-using-mdc-typography($config) {
1414
@include mdc-dialog-core-styles($query: $mat-typography-styles-query);
1515
}

src/material-experimental/mdc-form-field/_form-field-subscript.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
}
4545

4646
@mixin mat-mdc-private-form-field-subscript-typography($config-or-theme) {
47-
$config: mat-get-typography-config($config-or-theme);
47+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
4848
// The unit-less line-height from the font config.
4949
$line-height: mat-line-height($config, input);
5050
// The amount to scale the font for the subscript.

src/material-experimental/mdc-form-field/_form-field-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
}
6060

6161
@mixin mat-mdc-form-field-typography($config-or-theme) {
62-
$config: mat-get-typography-config($config-or-theme);
62+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
6363
@include mat-using-mdc-typography($config) {
6464
@include mdc-text-field-without-ripple($query: $mat-typography-styles-query);
6565
@include mdc-floating-label-core-styles($query: $mat-typography-styles-query);

src/material-experimental/mdc-input/_input-theme.scss

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
@include mat-using-mdc-theme($config) {}
66
}
77

8-
@mixin mat-mdc-input-typography($config-or-theme) {
9-
$config: mat-get-typography-config($config-or-theme);
10-
@include mat-using-mdc-typography($config) {}
11-
}
8+
@mixin mat-mdc-input-typography($config-or-theme) {}
129

1310
@mixin mat-mdc-input-density($config-or-theme) {}
1411

src/material-experimental/mdc-list/_list-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
}
5353

5454
@mixin mat-mdc-list-typography($config-or-theme) {
55-
$config: mat-get-typography-config($config-or-theme);
55+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
5656
@include mat-using-mdc-typography($config) {
5757
@include mdc-list-without-ripple($query: $mat-typography-styles-query);
5858
@include mat-mdc-private-list-option-typography-styles();

src/material-experimental/mdc-menu/_menu-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
}
4444

4545
@mixin mat-mdc-menu-typography($config-or-theme) {
46-
$config: mat-get-typography-config($config-or-theme);
46+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
4747
@include mat-using-mdc-typography($config) {
4848
@include mdc-menu-surface-core-styles($mat-typography-styles-query);
4949

src/material-experimental/mdc-paginator/_paginator-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
}
4848

4949
@mixin mat-mdc-paginator-typography($config-or-theme) {
50-
$config: mat-get-typography-config($config-or-theme);
50+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
5151
.mat-mdc-paginator {
5252
@include mat-using-mdc-typography($config) {
5353
@include mdc-typography(caption, $query: $mat-typography-styles-query);

src/material-experimental/mdc-radio/_radio-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
}
4242

4343
@mixin mat-mdc-radio-typography($config-or-theme) {
44-
$config: mat-get-typography-config($config-or-theme);
44+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
4545
@include mat-using-mdc-typography($config) {
4646
@include mdc-radio-without-ripple($query: $mat-typography-styles-query);
4747
@include mdc-form-field-core-styles($query: $mat-typography-styles-query);

src/material-experimental/mdc-select/_select-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
}
8181

8282
@mixin mat-mdc-select-typography($config-or-theme) {
83-
$config: mat-get-typography-config($config-or-theme);
83+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
8484
@include mat-using-mdc-typography($config) {
8585
@include mdc-menu-surface-core-styles($mat-typography-styles-query);
8686

src/material-experimental/mdc-slide-toggle/_slide-toggle-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
}
8080

8181
@mixin mat-mdc-slide-toggle-typography($config-or-theme) {
82-
$config: mat-get-typography-config($config-or-theme);
82+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
8383
@include mat-using-mdc-typography($config) {
8484
@include mdc-switch-without-ripple($query: $mat-typography-styles-query);
8585
@include mdc-form-field-core-styles($query: $mat-typography-styles-query);

src/material-experimental/mdc-slider/_slider-theme.scss

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,7 @@
2222
}
2323
}
2424

25-
@mixin mat-mdc-slider-typography($config-or-theme) {
26-
$config: mat-get-typography-config($config-or-theme);
27-
@include mat-using-mdc-typography($config) {
28-
// TODO: disabled until we implement the new MDC slider.
29-
// @include mdc-slider-core-styles($query: $mat-typography-styles-query);
30-
}
31-
}
25+
@mixin mat-mdc-slider-typography($config-or-theme) {}
3226

3327
@mixin mat-mdc-slider-density($config-or-theme) {}
3428

src/material-experimental/mdc-snack-bar/_snack-bar-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
}
3535

3636
@mixin mat-mdc-snack-bar-typography($config-or-theme) {
37-
$config: mat-get-typography-config($config-or-theme);
37+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
3838
@include mat-using-mdc-typography($config) {
3939
@include mdc-snackbar-core-styles($query: $mat-typography-styles-query);
4040
}

src/material-experimental/mdc-table/_table-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
}
4444

4545
@mixin mat-mdc-table-typography($config-or-theme) {
46-
$config: mat-get-typography-config($config-or-theme);
46+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
4747
@include mat-using-mdc-typography($config) {
4848
@include mdc-data-table-core-styles($query: $mat-typography-styles-query);
4949
}

src/material-experimental/mdc-tabs/_tabs-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
}
9696

9797
@mixin mat-mdc-tabs-typography($config-or-theme) {
98-
$config: mat-get-typography-config($config-or-theme);
98+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
9999
@include mat-using-mdc-typography($config) {
100100
@include mdc-tab-without-ripple($query: $mat-typography-styles-query);
101101
@include mdc-tab-indicator-core-styles($query: $mat-typography-styles-query);

src/material-experimental/mdc-typography/_all-typography.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
@mixin angular-material-mdc-typography($config-or-theme: null) {
44
$config: if(mat-private-is-theme-object($config-or-theme),
5-
mat-get-typography-config($config-or-theme), $config-or-theme);
5+
mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme)),
6+
$config-or-theme);
67

78
// If no actual color configuration has been specified, create a default one.
89
@if $config == null {

src/material-experimental/popover-edit/_popover-edit.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
@import '../../material/core/style/private';
44
@import '../../material/core/theming/palette';
55
@import '../../material/core/theming/theming';
6+
@import '../../material/core/typography/typography';
67
@import '../../material/core/typography/typography-utils';
78

89
@function mat-edit-hover-content-background($direction, $background-color) {
@@ -143,7 +144,7 @@
143144
}
144145

145146
@mixin mat-popover-edit-typography($config-or-theme) {
146-
$config: mat-get-typography-config($config-or-theme);
147+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
147148
[mat-edit-title] {
148149
@include mat-typography-level-to-styles($config, title);
149150
}

src/material/badge/_badge-theme.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// no style sheet support for directives.
44
@import '../core/theming/palette';
55
@import '../core/theming/theming';
6+
@import '../core/typography/typography';
67
@import '../core/typography/typography-utils';
78
@import '../../cdk/a11y/a11y';
89

@@ -188,7 +189,7 @@ $mat-badge-large-size: $mat-badge-default-size + 6;
188189
}
189190

190191
@mixin mat-badge-typography($config-or-theme) {
191-
$config: mat-get-typography-config($config-or-theme);
192+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
192193
.mat-badge-content {
193194
font-weight: $mat-badge-font-weight;
194195
font-size: $mat-badge-font-size;

src/material/bottom-sheet/_bottom-sheet-theme.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@import '../core/style/private';
2+
@import '../core/typography/typography';
23
@import '../core/typography/typography-utils';
34
@import '../core/theming/palette';
45
@import '../core/theming/theming';
@@ -16,7 +17,7 @@
1617
}
1718

1819
@mixin mat-bottom-sheet-typography($config-or-theme) {
19-
$config: mat-get-typography-config($config-or-theme);
20+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
2021
.mat-bottom-sheet-container {
2122
@include mat-typography-level-to-styles($config, body-1);
2223
}

src/material/button-toggle/_button-toggle-theme.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@import '../core/style/private';
33
@import '../core/theming/palette';
44
@import '../core/theming/theming';
5+
@import '../core/typography/typography';
56
@import '../core/typography/typography-utils';
67
@import '../core/density/private/compatibility';
78
@import './button-toggle-variables';
@@ -85,7 +86,7 @@
8586
}
8687

8788
@mixin mat-button-toggle-typography($config-or-theme) {
88-
$config: mat-get-typography-config($config-or-theme);
89+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
8990
.mat-button-toggle {
9091
font-family: mat-font-family($config);
9192
}

src/material/card/_card-theme.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@import '../core/theming/palette';
22
@import '../core/theming/theming';
33
@import '../core/style/private';
4+
@import '../core/typography/typography';
45
@import '../core/typography/typography-utils';
56

67

@@ -26,7 +27,7 @@
2627
}
2728

2829
@mixin mat-card-typography($config-or-theme) {
29-
$config: mat-get-typography-config($config-or-theme);
30+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
3031
.mat-card {
3132
font-family: mat-font-family($config);
3233
}

src/material/checkbox/_checkbox-theme.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@import '../core/theming/theming';
2+
@import '../core/typography/typography';
23
@import '../core/typography/typography-utils';
34

45

@@ -96,7 +97,7 @@
9697
}
9798

9899
@mixin mat-checkbox-typography($config-or-theme) {
99-
$config: mat-get-typography-config($config-or-theme);
100+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
100101
.mat-checkbox {
101102
font-family: mat-font-family($config);
102103
}

src/material/chips/_chips-theme.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@import '../core/style/private';
22
@import '../core/theming/palette';
33
@import '../core/theming/theming';
4+
@import '../core/typography/typography';
45
@import '../core/typography/typography-utils';
56

67
$mat-chip-remove-font-size: 18px;
@@ -87,7 +88,7 @@ $mat-chip-remove-font-size: 18px;
8788
}
8889

8990
@mixin mat-chips-typography($config-or-theme) {
90-
$config: mat-get-typography-config($config-or-theme);
91+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
9192
.mat-chip {
9293
font-size: mat-font-size($config, body-2);
9394
font-weight: mat-font-weight($config, body-2);

src/material/core/option/_optgroup-theme.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@import '../theming/palette';
22
@import '../theming/theming';
3+
@import '../typography/typography';
34
@import '../typography/typography-utils';
45

56
@mixin mat-optgroup-color($config-or-theme) {
@@ -16,7 +17,7 @@
1617
}
1718

1819
@mixin mat-optgroup-typography($config-or-theme) {
19-
$config: mat-get-typography-config($config-or-theme);
20+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
2021
.mat-optgroup-label {
2122
@include mat-typography-level-to-styles($config, body-2);
2223
}

src/material/core/option/_option-theme.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@import '../theming/palette';
22
@import '../theming/theming';
3+
@import '../typography/typography';
34
@import '../typography/typography-utils';
45

56
@mixin mat-option-color($config-or-theme) {
@@ -47,7 +48,7 @@
4748
}
4849

4950
@mixin mat-option-typography($config-or-theme) {
50-
$config: mat-get-typography-config($config-or-theme);
51+
$config: mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme));
5152
.mat-option {
5253
font: {
5354
family: mat-font-family($config);

src/material/core/typography/_all-typography.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
// Includes all of the typographic styles.
4141
@mixin angular-material-typography($config-or-theme: null) {
4242
$config: if(mat-private-is-theme-object($config-or-theme),
43-
mat-get-typography-config($config-or-theme), $config-or-theme);
43+
mat-private-typography-normalized-config(mat-get-typography-config($config-or-theme)),
44+
$config-or-theme);
4445

4546
// If no actual color configuration has been specified, create a default one.
4647
@if not $config {

0 commit comments

Comments
 (0)