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?
This will work for input, textarea and select in normal, hover, focus and active states.
Here is SCSS version of the above solution for those who are working with SASS/SCSS.
This is my solution, I used transition and transition delay therefore I can have a transparent background on my input fields.
Try this: Same as @Nathan-white answer above with minor tweaks.
I have developed another solution using JavaScript without JQuery. If you find this useful or decide to re-post my solution, I only ask that you include my name. Enjoy. – Daniel Fairweather
This code is based on the fact that Google Chrome removes the Webkit style as soon as additional text is entered. Simply changing the input field value does not suffice, Chrome wants an event. By focusing on each input field (text, password), we can send a keyboard event (the letter 'a') and then set the text value to it's previous state (the auto-filled text). Keep in mind that this code will run in every browser and will check every input field within the webpage, adjust it accordingly to your needs.
This worked for me:
All of the above answers worked but did have their faults. The below code is an amalgamation of two of the above answers that works flawlessly with no blinking.