I want to show @ and password icon in my login fields using a background-image
property, inside my input[type="email"]
and input[type="password"]
. Using this CSS :
input.InputText--icon {
padding-left: 32px;
&[type="email"], &[type="email"]:-internal-autofill-selected {
background-image: url("/ressources/img/email.svg") !important;
}
&[type="password"], &[type="password"]:-internal-autofill-selected {
background-image: url("/ressources/img/password.svg") !important;
}
}
But if credentials are add using autofilling through Chrome, the following background-image: none !important;
property overrides it and I lose my background.
// chrome user agent stylesheet
input:-internal-autofill-selected {
background-color: rgb(232, 240, 254) !important;
background-image: none !important;
color: -internal-light-dark-color(black, white) !important;
}
Do you have any hacky ideas to go through this problem, so that my background-images always shows up. Even if :-internal-autofill-selected event is triggered.
I have seen this idea of using a wrapper (https://stackoverflow.com/a/35573069/7647916 ). But is it possible to do it without using a wrapper ?
Thank you !