Note: I am not looking to remove or customize focus styles for accessibility purposes. It is extremely difficult to replicate all the various focus styles across different browsers and operating systems.
When customizing the appearance of an input/textarea, the outline style disappears when the element is focused. This can result in strange border effects.
Why does this happen? In my opinion, it significantly hinders accessibility. How can we avoid overriding focus styles while making simple CSS changes like adjusting background color and border color?
I have tested this issue on Firefox Mac and IE 11 (Chrome seems to be working fine). You can experiment with it yourself on Codepen: https://codepen.io/lbineau/pen/dLgwoo
<label for="customized-input">Customized input</label>
<input id="customized-input" type="text" />
<label for="native-input">Native input</label>
<input id="native-input" type="text" />
Desired outcome: the default outline should remain visible even if the input border is customized.
Current outcome: the outline disappears when the input is focused.