Skip to content

Instantly share code, notes, and snippets.

@devstar0209
Created August 29, 2024 01:10
Show Gist options
  • Save devstar0209/4ba5266a8b2d9248741beb6c9a445ba7 to your computer and use it in GitHub Desktop.
Save devstar0209/4ba5266a8b2d9248741beb6c9a445ba7 to your computer and use it in GitHub Desktop.
Prevent autocomplete and ignore background color in autofill
autocomplete="nope"
autocomplete="new-password"
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
appearance: menulist-button;
background-color: rgb(232, 240, 254) !important; /* Light theme background color */
-webkit-text-fill-color: #ffffff !important;
-webkit-caret-color: white !important;
caret-color: white !important;
background-image: none !important; /* Remove any background image */
transition: background-color 5000s ease-in-out 0s; /* Prevent flicker on autofill */
}
input:-webkit-autofill:active {
-webkit-caret-color: white !important;
caret-color: white !important;
}
input:-internal-autofill-selected {
appearance: menulist-button;
background-color: rgba(70, 90, 126, 0.4) !important; /* Dark theme background color */
-webkit-text-fill-color: #ffffff !important;
-webkit-caret-color: white !important;
caret-color: white !important;
background-image: none !important; /* Remove any background image */
transition: background-color 5000s ease-in-out 0s; /* Prevent flicker on autofill */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment