Skip to content

Commit fffd46e

Browse files
committed
fix(material-experimental/mdc-form-field): fix notch visual artifact
1 parent b5c935a commit fffd46e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,21 @@
122122
box-sizing: border-box;
123123
}
124124

125+
// This fixes an issue where the notch appears to be thicker than the rest of the outline when
126+
// zoomed in on Chrome. The border inconsistency seems to be some kind of rendering artifact that
127+
// arises from a combination of the fact that the notch contains text, while the leading and
128+
// trailing outline do not, combined with the fact that the border is semi-transparent.
129+
// Experimentally, I discovered that adding a transparent left border fixes the inconsistency.
130+
// In addition some negative left margin is added to compensate for the transparent border and
131+
// fully fix the issue.
132+
// TODO(mmalerba): port this fix into MDC
133+
.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field {
134+
.mdc-notched-outline__notch {
135+
border-left: 1px solid transparent;
136+
margin-left: -1px;
137+
}
138+
}
139+
125140
// In order to make it possible for developers to disable animations for form-fields,
126141
// we only activate the animation styles if animations are not explicitly disabled.
127142
.mat-mdc-form-field:not(.mat-form-field-no-animations) {

0 commit comments

Comments
 (0)