Skip to content

Commit eb32025

Browse files
authored
fix(material-experimental/mdc-form-field): add padding to subscript to align with spec (#21265)
1 parent dfe3236 commit eb32025

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
}
4444
}
4545

46+
// We need to define our own typography for the subscript because we don't include MDC's
47+
// helper text in our MDC based form field
4648
@mixin mat-mdc-private-form-field-subscript-typography($config-or-theme) {
4749
$config: mat-get-typography-config($config-or-theme);
4850
// The unit-less line-height from the font config.
@@ -59,12 +61,15 @@
5961
// combination of the subscript's margin and line-height, but we need to multiply by the
6062
// subscript font scale factor since the subscript has a reduced font size.
6163
$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;
6266

6367
// The subscript wrapper has a minimum height to avoid that the form-field
6468
// jumps when hints or errors are displayed.
6569
.mat-mdc-form-field-subscript-wrapper {
6670
min-height: $subscript-min-height;
6771
font-size: $subscript-font-size;
6872
margin-top: $subscript-margin-top;
73+
padding: 0 $subscript-horizontal-padding;
6974
}
7075
}

0 commit comments

Comments
 (0)