On a form I'm working on, Chrome is auto-filling the email and password fields. This is fine, however, Chrome changes the background colour to a pale yellow colour.
The design I'm working on is using light text on a dark background, so this really messes up the look of the form - I have stark yellow boxes and near-invisible white text. Once the field is focused, the fields return to normal.
Is it possible to stop Chrome changing the colour of these fields?
I had an issue where I couldn't use box-shadow because I needed the input field to be transparent. It's a bit of a hack but pure CSS. Set the transition to a very long amount of time.
The solution of Daniel Fairweather (Removing input background colour for Chrome autocomplete?) (I would love to upvote his solution, but still need 15 rep) works really good. There is a really huge difference with most upvoted solution : you can keep background images ! But a little modification (just Chrome check)
And you need to keep in mind, it ONLY works on visible fields !
So you if you are using $.show() for your form, you need to run this code After show() event
My full solution (I have a show/hide buttons for login form ):
Sorry again, I would prefer it to be a comment.
If you want, I can put a link to the site where I used it.
As mentioned before, inset -webkit-box-shadow for me works best.
Also code snippet to change text color:
After 2 hours of searching it seems google still overrides the yellow color somehow but i for the fix for it. That's right. it will work for hover, focus etc as well. all you have to do is add !important to it.
this will completely remove yellow from input fields
None of the solutions worked for me, the inset shadow won't work for me because the inputs have a translucent background overlaid over the page background.
So I asked myself, "How does Chrome determine what should be autofilled on a given page?"
"Does it look for input ids, input names? Form ids? Form action?"
Through my experimentation with the username and the password inputs, there were only two ways I found that would cause Chrome to not be able to find the fields that should be autofilled:
1) Put the password input ahead of the text input. 2) Give them the same name and id ... or no name and id at all.
After the page loads, with javascript you can either dynamically change the order of the inputs on the page, or dynamically give them their name and id ...
And Chrome doesn't know what hit it ... autocomplete is broken!
Crazy hack, I know. But it's working for me.
Chrome 34.0.1847.116, OSX 10.7.5
A possible workaround for the moment is to set a "strong" inside shadow: