Skip to content

Commit 8992161

Browse files
committed
fix(material-experimental/mdc-typography): update components using incorrect typography levels
1 parent 6e9dc70 commit 8992161

File tree

4 files changed

+31
-4
lines changed

4 files changed

+31
-4
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@import '@material/list/variables.import';
33
@import '@material/theme/functions.import';
44
@import '@material/theme/mixins.import';
5+
@import '@material/typography/mixins.import';
56
@import '../../mdc-helpers/mdc-helpers';
67
@import '../../../material/core/theming/theming';
78

@@ -43,6 +44,14 @@
4344

4445
@mixin mat-mdc-option-typography($config-or-theme) {
4546
$config: mat-get-typography-config($config-or-theme);
47+
48+
@include mat-using-mdc-typography($config) {
49+
// MDC uses the `subtitle1` level for list items, but the spec shows `body1` as the correct
50+
// level. Class is repeated for increased specificity.
51+
.mat-mdc-option {
52+
@include mdc-typography(body1, $query: $mat-typography-styles-query);
53+
}
54+
}
4655
}
4756

4857
@mixin mat-mdc-option-density($config-or-theme) {

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@import '@material/theme/variables.import';
55
@import '@material/textfield/mixins.import';
66
@import '@material/textfield/variables.import';
7+
@import '@material/typography/mixins.import';
78
@import '../mdc-helpers/mdc-helpers';
89
@import 'form-field-density';
910
@import 'form-field-subscript';
@@ -22,8 +23,8 @@
2223

2324
.mdc-text-field--focused {
2425
@include mdc-text-field-focused_($query);
25-
2626
}
27+
2728
.mdc-text-field--invalid {
2829
@include mdc-text-field-invalid_($query);
2930
}
@@ -67,8 +68,13 @@
6768
@include mdc-line-ripple-core-styles($query: $mat-typography-styles-query);
6869
@include mat-mdc-private-form-field-subscript-typography($config);
6970

70-
.mat-mdc-form-field {
71-
@include mat-typography-level-to-styles($config, input);
71+
// MDC uses the `subtitle1` level for the input label and value, but the spec shows `body1` as
72+
// the correct level.
73+
.mat-mdc-input-element,
74+
.mat-mdc-form-field label,
75+
.mat-mdc-form-field-prefix,
76+
.mat-mdc-form-field-suffix {
77+
@include mdc-typography(body1, $query: $mat-typography-styles-query);
7278
}
7379
}
7480
}

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@import '@material/list/variables.import';
55
@import '@material/theme/functions.import';
66
@import '@material/theme/mixins.import';
7+
@import '@material/typography/mixins.import';
78
@import '../mdc-helpers/mdc-helpers';
89

910
@mixin mat-mdc-menu-color($config-or-theme) {
@@ -47,10 +48,16 @@
4748
@include mat-using-mdc-typography($config) {
4849
@include mdc-menu-surface-core-styles($mat-typography-styles-query);
4950

50-
.mat-mdc-menu-content, .mat-mdc-menu-item {
51+
.mat-mdc-menu-content {
5152
// Note that we include this private mixin, because the public
5253
// one adds a bunch of styles that we aren't using for the menu.
5354
@include mdc-list-base_($mat-typography-styles-query);
55+
56+
// MDC uses the `subtitle1` level for list items, but the spec shows `body1` as the correct
57+
// level.
58+
.mat-mdc-menu-item {
59+
@include mdc-typography(body1, $query: $mat-typography-styles-query);
60+
}
5461
}
5562
}
5663
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@import '@material/list/mixins.import';
33
@import '@material/theme/variables.import';
44
@import '@material/select/variables.import';
5+
@import '@material/typography/mixins.import';
56
@import '../mdc-helpers/mdc-helpers';
67

78
// Gets the color to use for some text that is highlighted while a select has focus.
@@ -89,6 +90,10 @@
8990
// a bunch of styles that we aren't using for the select panel.
9091
@include mdc-list-base_($mat-typography-styles-query);
9192
}
93+
94+
.mat-mdc-select-value {
95+
@include mdc-typography(body1, $query: $mat-typography-styles-query);
96+
}
9297
}
9398
}
9499

0 commit comments

Comments
 (0)