File tree Expand file tree Collapse file tree 6 files changed +43
-13
lines changed
src/material-experimental Expand file tree Collapse file tree 6 files changed +43
-13
lines changed Original file line number Diff line number Diff line change 1
1
@import ' @material/menu-surface/mixins.import' ;
2
2
@import ' @material/list/mixins.import' ;
3
+ @import ' @material/typography/mixins.import' ;
3
4
@import ' ../mdc-helpers/mdc-helpers' ;
4
5
5
6
@mixin mat-mdc-autocomplete-color ($config-or-theme ) {
19
20
// Note that we include this private mixin, because the public one adds
20
21
// a bunch of styles that we aren't using for the autocomplete panel.
21
22
@include mdc-list-base_ ($mat-typography-styles-query );
23
+
24
+ // MDC uses the `subtitle1` level for list items, but the spec shows `body1` as the correct
25
+ // level.
26
+ .mat-mdc-option {
27
+ @include mdc-typography (body1, $query : $mat-typography-styles-query );
28
+ }
22
29
}
23
30
}
24
31
}
Original file line number Diff line number Diff line change @@ -36,11 +36,11 @@ $mat-form-field-input-box-vertical-offset: 1px;
36
36
// spacing as provided by the Material Design specification. The outlined dimensions in the
37
37
// spec section do not match with the text fields shown in the overview or the ones implemented
38
38
// by MDC. Note that we need to account for the input box offset. See above for more context.
39
- $mat-form-field-with-label-input-padding-top : 28 px - $mat-form-field-input-box-vertical-offset ;
40
- $mat-form-field-with-label-input-padding-bottom : 12 px - $mat-form-field-input-box-vertical-offset ;
39
+ $mat-form-field-with-label-input-padding-top : 24 px - $mat-form-field-input-box-vertical-offset ;
40
+ $mat-form-field-with-label-input-padding-bottom : 8 px - $mat-form-field-input-box-vertical-offset ;
41
41
42
42
// Vertical spacing of the text-field if there is no label. We manually measure the
43
43
// spacing in the specs. See comment above for padding for text fields with label. The
44
44
// same reasoning applies to the padding for text fields without label.
45
- $mat-form-field-no-label-padding-bottom : 20 px - $mat-form-field-input-box-vertical-offset ;
46
- $mat-form-field-no-label-padding-top : 20 px - $mat-form-field-input-box-vertical-offset ;
45
+ $mat-form-field-no-label-padding-bottom : 16 px - $mat-form-field-input-box-vertical-offset ;
46
+ $mat-form-field-no-label-padding-top : 16 px - $mat-form-field-input-box-vertical-offset ;
Original file line number Diff line number Diff line change 4
4
@import ' @material/theme/variables.import' ;
5
5
@import ' @material/textfield/mixins.import' ;
6
6
@import ' @material/textfield/variables.import' ;
7
+ @import ' @material/typography/mixins.import' ;
7
8
@import ' ../mdc-helpers/mdc-helpers' ;
8
9
@import ' form-field-density' ;
9
10
@import ' form-field-subscript' ;
22
23
23
24
.mdc-text-field--focused {
24
25
@include mdc-text-field-focused_ ($query );
25
-
26
26
}
27
+
27
28
.mdc-text-field--invalid {
28
29
@include mdc-text-field-invalid_ ($query );
29
30
}
67
68
@include mdc-line-ripple-core-styles ($query : $mat-typography-styles-query );
68
69
@include mat-mdc-private-form-field-subscript-typography ($config );
69
70
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 );
72
78
}
73
79
}
74
80
}
Original file line number Diff line number Diff line change 9
9
@mixin mat-mdc-private-text-field-structure-overrides () {
10
10
// Unset the border set by MDC. We move the border (which serves as the Material Design
11
11
// 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).
16
13
.mat-mdc-input-element {
17
- font : inherit ;
18
14
border : none ;
19
15
}
20
16
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
+
21
24
// Reset the height that MDC sets on native input elements. We cannot rely on their
22
25
// fixed height as we handle vertical spacing differently. MDC sets a fixed height for
23
26
// inputs and modifies the baseline so that the textfield matches the spec. This does
Original file line number Diff line number Diff line change 4
4
@import ' @material/list/variables.import' ;
5
5
@import ' @material/theme/functions.import' ;
6
6
@import ' @material/theme/mixins.import' ;
7
+ @import ' @material/typography/mixins.import' ;
7
8
@import ' ../mdc-helpers/mdc-helpers' ;
8
9
9
10
@mixin mat-mdc-menu-color ($config-or-theme ) {
47
48
@include mat-using-mdc-typography ($config ) {
48
49
@include mdc-menu-surface-core-styles ($mat-typography-styles-query );
49
50
50
- .mat-mdc-menu-content , .mat-mdc-menu-item {
51
+ .mat-mdc-menu-content {
51
52
// Note that we include this private mixin, because the public
52
53
// one adds a bunch of styles that we aren't using for the menu.
53
54
@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
+ }
54
61
}
55
62
}
56
63
}
Original file line number Diff line number Diff line change 2
2
@import ' @material/list/mixins.import' ;
3
3
@import ' @material/theme/variables.import' ;
4
4
@import ' @material/select/variables.import' ;
5
+ @import ' @material/typography/mixins.import' ;
5
6
@import ' ../mdc-helpers/mdc-helpers' ;
6
7
7
8
// Gets the color to use for some text that is highlighted while a select has focus.
88
89
// Note that we include this private mixin, because the public one adds
89
90
// a bunch of styles that we aren't using for the select panel.
90
91
@include mdc-list-base_ ($mat-typography-styles-query );
92
+
93
+ // MDC uses the `subtitle1` level for list items, but the spec shows `body1` as the correct
94
+ // level.
95
+ .mat-mdc-option {
96
+ @include mdc-typography (body1, $query : $mat-typography-styles-query );
97
+ }
91
98
}
92
99
}
93
100
}
You can’t perform that action at this time.
0 commit comments