Skip to content
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

fix(search): adjust icon and hover styles on Close16 button for Chrome's new autofill color #4891

Merged
merged 10 commits into from
Dec 18, 2019
9 changes: 8 additions & 1 deletion packages/components/src/components/search/_search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@
}
}

.#{$prefix}--search-input:-webkit-autofill ~ .#{$prefix}--search-close {
fill: currentColor;
}

.#{$prefix}--search-input:-webkit-autofill ~ .#{$prefix}--search-close:hover {
background-color: #e5e5e5;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it OK to make this non-themeable? Also, is there really no way to override :-webkit-autofill? Some sites seem to suggest adding box-shadow to override the color.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is! I wasn't sure if we would want to remove the autofill indicator or style around it, I wanted to propose a solution so designers could weigh in on the preferred workaround

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thank you for explaining @abbeyhrt - It'll be a good discussion to see it with designers wrt what the (themable) background color of such state should be.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this specific solution, I think the autofill replacement background color might need to use the hex value since if you use any of the hover tokens, for example $hover-field it will look like this:
Screen Shot 2019-12-16 at 4 41 36 PM
which is too dark, i think. Since this only affects when the chrome autofill color is there, it shouldn't have any greater impact on the themes. I'm down to try other things though! This is just what I came up with when looking for a solution 🙂

}

.#{$prefix}--search-input[disabled] ~ .#{$prefix}--search-magnifier {
fill: $disabled;
}
Expand Down Expand Up @@ -123,7 +131,6 @@
right: 0;

&::before {
content: '';
display: block;
position: absolute;
left: 0;
Expand Down