Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing input cursor colour for Chrome autocomplete?

I've got an issue with cursor colour after Chrome autocomplete.

I have input fields (email and password) with white colour, both text and cursor are white in case when fields are empty and user types text. But when chrome uses autocomplete for this fields text is still white, but cursor is black when user types in fields cursor became white, when selects from chrome autocomplete list it is black. Text colour in chrome autocomplete list is black looks like it effects input cursor.

I've tried next styles for input but no effect.

input {
  color: white !important;
}

input:-webkit-autofill {
  -webkit-text-fill-color: white !important;
  color: white !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:active,
input:-webkit-autofill:focus {
  color: white !important;
 -webkit-text-fill-color: white !important;
}

So, can I fix it somehow?

Thanks for suggestions!

like image 897
Viktor Kukurba Avatar asked Apr 11 '16 10:04

Viktor Kukurba


People also ask

How do I remove autofill in Chrome CSS?

Autocomplete is disabled with autocomplete="off". AUTOFILL will prompt based on the address book from previously filled out similar forms on other pages. It will also highlight the fields it is changing. Autofill can be disabled with autocomplete="false".

What is autofill CSS?

The :autofill CSS pseudo-class matches when an <input> element has its value autofilled by the browser. The class stops matching if the user edits the field.


1 Answers

caret-color works for me:

input:-webkit-autofill {
  caret-color: white;
}
like image 110
Serge Rosenberg Avatar answered Oct 17 '22 17:10

Serge Rosenberg