4

Is there any way to change blue colored caret on iOS for inputs?

enter image description here

UPDATE: So caret-color property will fix this 'issue' when it will be supported in ios. check browser support when you are here in the future https://caniuse.com/#feat=css-caret-color

Joe Koker
  • 931
  • 10
  • 20

2 Answers2

0

I am not sure what the compatibility of -webkit-text-fill-color is, but if that is acceptable for compatibility you can use a combination of that, text-shadow, color, and background-color with css to create the desired input. No JS is required.

This basis for this approach was described here: https://stackoverflow.com/a/30031723/1026459

The blue can be hard to see (if you change it to white it is a little more obvious).

input{
  color: #456ce1;
  text-shadow: 0px 0px 0px red;
  -webkit-text-fill-color: transparent;
  background-color: #272b36;
}
<input value = "CHCJ"/>

Don't forget to focus the input field with your mouse.

Community
  • 1
  • 1
Travis J
  • 81,153
  • 41
  • 202
  • 273
  • 3
    Thanks for your response Travis. I know about this snippet but unfortunately it doesnt work for me on iphones. – Joe Koker Jun 04 '15 at 23:54
0

caret-color property is finally supported in ios so now you can change the color of the caret.

input {
  font-size: 20px;
  caret-color: red;
}
<input type="text">
Joe Koker
  • 931
  • 10
  • 20