-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(form-field): inconsistent underline height at different DPIs #11062
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/lib/form-field/form-field.scss
Outdated
@@ -144,6 +144,8 @@ $mat-form-field-default-infix-width: 180px !default; | |||
width: 100%; | |||
// Need this so that the underline doesn't block the hover effect. | |||
pointer-events: none; | |||
// We transform the height slightly higher to fix inconsistent underline height for some DPIs. | |||
transform: scaleY(1.0001); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like one of those things where it only really helps at certain screen sizes and/or DPIs. I don't think it would hurt having it, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it out at different zoom levels on my desktop and retina macbook and this definitely helped make things more consistent and made the underlines not disappear on zoom levels between 50% and 100%
src/lib/form-field/form-field.scss
Outdated
@@ -144,6 +144,8 @@ $mat-form-field-default-infix-width: 180px !default; | |||
width: 100%; | |||
// Need this so that the underline doesn't block the hover effect. | |||
pointer-events: none; | |||
// We transform the height slightly higher to fix inconsistent underline height for some DPIs. | |||
transform: scaleY(1.0001); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you able to elaborate on why adding this scale resolves the issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At zoom levels between 50% and 100% some of the form-fields would lose their underline and some would have 1px
underline. It seemec related to fractional pixels in some way (e.g. underlines with their top at x.7px
were fine, but underlines at x.8px
disappeared). The exact fractions that worked or didn't work seemed to depend on the users resolution and zoom level.
This was basically just a hunch "hey maybe making the underline barely thicker will somehow help." And on all the screens and zoom levels I tested it did indeed fix the problem. It also fixed the case where you're zoomed in to >100% and the underlines would have inconsistent thickness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the gist of that to the comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
No description provided.