|
8 | 8 | .mat-mdc-form-field-subscript-wrapper { |
9 | 9 | box-sizing: border-box; |
10 | 10 | width: 100%; |
11 | | - // prevents multi-line errors from overlapping the control. |
12 | | - overflow: hidden; |
| 11 | + position: relative; |
| 12 | + } |
| 13 | + |
| 14 | + .mat-mdc-form-field-hint-wrapper, |
| 15 | + .mat-mdc-form-field-error-wrapper { |
| 16 | + position: absolute; |
| 17 | + top: 0; |
| 18 | + left: 0; |
| 19 | + right: 0; |
| 20 | + } |
| 21 | + |
| 22 | + .mat-mdc-form-field-bottom-align { |
| 23 | + line-height: normal; |
| 24 | + } |
| 25 | + |
| 26 | + .mat-mdc-form-field-bottom-align::before { |
| 27 | + content: '\200B'; |
| 28 | + vertical-align: bottom; |
13 | 29 | } |
14 | 30 |
|
15 | 31 | // Scale down icons in the subscript to be the same size as the text. |
16 | | - .mat-mdc-form-field-subscript-wrapper .mat-icon { |
17 | | - width: 1em; |
18 | | - height: 1em; |
19 | | - font-size: inherit; |
20 | | - vertical-align: baseline; |
| 32 | + .mat-mdc-form-field-subscript-wrapper, |
| 33 | + .mat-mdc-form-field label { |
| 34 | + .mat-icon { |
| 35 | + width: 1em; |
| 36 | + height: 1em; |
| 37 | + font-size: inherit; |
| 38 | + } |
21 | 39 | } |
22 | 40 |
|
23 | 41 | // Clears the floats on the hints. This is necessary for the hint animation to work. |
|
47 | 65 | // helper text in our MDC based form field |
48 | 66 | @mixin mat-mdc-private-form-field-subscript-typography($config-or-theme) { |
49 | 67 | $config: mat-get-typography-config($config-or-theme); |
50 | | - // The unit-less line-height from the font config. |
51 | | - $line-height: mat-line-height($config, input); |
52 | | - // The amount to scale the font for the subscript. |
53 | | - $subscript-font-scale: 0.75; |
54 | | - // Font size to use for the subscript text. |
55 | | - $subscript-font-size: $subscript-font-scale * 100%; |
56 | | - // The space between the bottom of the text-field area and the subscript. Mocks in the spec show |
57 | | - // half of the text size, but this margin is applied to an element with the subscript text font |
58 | | - // size, so we need to divide by the scale factor to make it half of the original text size. |
59 | | - $subscript-margin-top: 0.5em / $subscript-font-scale; |
60 | | - // The minimum height applied to the subscript to reserve space for subscript text. This is a |
61 | | - // combination of the subscript's margin and line-height, but we need to multiply by the |
62 | | - // subscript font scale factor since the subscript has a reduced font size. |
63 | | - $subscript-min-height: ($subscript-margin-top + $line-height) * $subscript-font-scale; |
64 | | - // The horizontal padding between the edge of the text box and the start of the subscript text. |
65 | | - $subscript-horizontal-padding: 16px; |
66 | 68 |
|
67 | 69 | // The subscript wrapper has a minimum height to avoid that the form-field |
68 | 70 | // jumps when hints or errors are displayed. |
69 | | - .mat-mdc-form-field-subscript-wrapper { |
70 | | - min-height: $subscript-min-height; |
71 | | - font-size: $subscript-font-size; |
72 | | - margin-top: $subscript-margin-top; |
73 | | - padding: 0 $subscript-horizontal-padding; |
| 71 | + .mat-mdc-form-field-subscript-wrapper, |
| 72 | + .mat-mdc-form-field-bottom-align::before { |
| 73 | + @include mdc-typography(caption, $query: $mat-typography-styles-query); |
74 | 74 | } |
75 | 75 | } |
0 commit comments