Viktor Kukurba
Viktor Kukurba

Reputation: 1370

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!

Upvotes: 16

Views: 4814

Answers (1)

Serge Rosenberg
Serge Rosenberg

Reputation: 336

caret-color works for me:

input:-webkit-autofill {
  caret-color: white;
}

Upvotes: 21

Related Questions