Skip to content

fix(material-experimental/mdc-form-field): add padding to subscript t… #21265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
}
}

// We need to define our own typography for the subscript because we don't include MDC's
// helper text in our MDC based form field
@mixin mat-mdc-private-form-field-subscript-typography($config-or-theme) {
$config: mat-get-typography-config($config-or-theme);
// The unit-less line-height from the font config.
Expand All @@ -59,12 +61,15 @@
// combination of the subscript's margin and line-height, but we need to multiply by the
// subscript font scale factor since the subscript has a reduced font size.
$subscript-min-height: ($subscript-margin-top + $line-height) * $subscript-font-scale;
// The horizontal padding between the edge of the text box and the start of the subscript text.
$subscript-horizontal-padding: 16px;

// The subscript wrapper has a minimum height to avoid that the form-field
// jumps when hints or errors are displayed.
.mat-mdc-form-field-subscript-wrapper {
min-height: $subscript-min-height;
font-size: $subscript-font-size;
margin-top: $subscript-margin-top;
padding: 0 $subscript-horizontal-padding;
}
}