site documentation
Posted in
16
12:11 am, June 17, 2021
for auto filled fields, need to change the text and background colours
for some reason bootstrap or the browser is doing this to auto filled fields.
according to my searching there is a pseudo class added to auto filled fields
CSS
input:-webkit-autofill {
color: #444!important;
}
this option however does not seem to fix it for me.
the option that fixed it is here, apparently changing the focus and adding a shadow to the text fixes it. I found this mentioned here.
CSS
input:-webkit-autofill:focus {
-webkit-box-shadow: 0 0 0 50px #3b3b3b inset;/*your box-shadow*/
-webkit-text-fill-color: #b1b1b1;
}
Working Demo, showing auto fill not going white anymore. so you can actually read the text.
Update here is the css that worked for me
CSS
input:-webkit-autofill {
-webkit-box-shadow:0 0 0 50px white inset;
-webkit-text-fill-color: #333;
}
input:-webkit-autofill:focus {
-webkit-box-shadow: 0 0 0 50px #3b3b3b inset;
-webkit-text-fill-color: #b1b1b1;
}
CSS
/* Not Working #1 */
@media (prefers-color-scheme: dark) {
input:-webkit-autofill {
color: #b1b1b1!important;
background-color: #3b3b3b!important;
}
}
/* Not Working #2 */
input:-webkit-autofill {
color: #444!important;
}
/* This one seems to work, but the background is still white and dark text, but at least you can read the fields */
input:-webkit-autofill {
-webkit-box-shadow:0 0 0 50px white inset;
-webkit-text-fill-color: #333;
}
input:-webkit-autofill:focus {
-webkit-box-shadow: 0 0 0 50px #3b3b3b inset;
-webkit-text-fill-color: #b1b1b1;
}
View Statistics
This Week
50
This Month
417
This Year
0
Add Comment
Other Items in site documentation
function to load one latest item with a start val load_latest_single_num
make the view number zoom when mouse over or active
moving the hits widget into the post header and footer
for auto filled fields, need to change the text and background colours
use a list group for listing by category page [todo]
Comments Listing should be a custom list rather than using search
load the latest single item only
load oldest item based on insdate then update the insdate to now - load_latest_single_update
change this to a list group - other items
hero widget header - creates a nice looking hero item from a target uid and class
dropdown section
Latest from Code Widget
Related Search Terms
Other Categories in Code
c testing apache apps asp bat bootstrap bootstrap templates core css css grid design elements fancybox fonts foundation framework gimp git html icons ideas images javascript jquery js linux mac nginx node php php functions php simple html dom pi400 python react sections site bugs site documentation sql sqlite sublime svg templates tools virtual box webdev windows wordpress