File tree Expand file tree Collapse file tree 5 files changed +38
-9
lines changed
src/material-experimental Expand file tree Collapse file tree 5 files changed +38
-9
lines changed Original file line number Diff line number Diff line change 4343
4444@mixin mat-mdc-option-typography ($config-or-theme ) {
4545 $config : mat-get-typography-config ($config-or-theme );
46+
47+ @include mat-using-mdc-typography ($config ) {
48+ // MDC uses the `subtitle1` level for list items, but the spec shows `body1` as the correct
49+ // level. Class is repeated for increased specificity.
50+ .mat-mdc-option {
51+ @include mdc-typography (body1, $query : $mat-typography-styles-query );
52+ }
53+ }
4654}
4755
4856@mixin mat-mdc-option-density ($config-or-theme ) {
Original file line number Diff line number Diff line change 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' ;
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 }
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}
Original file line number Diff line number Diff line change 99@mixin mat-mdc-private-text-field-structure-overrides () {
1010 // Unset the border set by MDC. We move the border (which serves as the Material Design
1111 // text-field bottom line) into its own element. This is necessary because we want the
12- // bottom-line to span across the whole form-field (including prefixes and suffixes). Also
13- // we ensure that font styles are inherited for input elements. We do this because inputs by
14- // default have explicit font styles from the user agent, and we set the desired font styles
15- // in the parent `mat-form-field` element (for better custom form-field control support).
12+ // bottom-line to span across the whole form-field (including prefixes and suffixes).
1613 .mat-mdc-input-element {
17- font : inherit ;
1814 border : none ;
1915 }
2016
17+ // In order to ensure proper alignment of the floating label, we reset its line-height.
18+ // The line-height is not important as the element is absolutely positioned and only has one line
19+ // of text.
20+ .mat-mdc-form-field .mdc-floating-label {
21+ line-height : normal ;
22+ }
23+
2124 // Reset the height that MDC sets on native input elements. We cannot rely on their
2225 // fixed height as we handle vertical spacing differently. MDC sets a fixed height for
2326 // inputs and modifies the baseline so that the textfield matches the spec. This does
Original file line number Diff line number Diff line change 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 ) {
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}
Original file line number Diff line number Diff line change 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.
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
You can’t perform that action at this time.
0 commit comments