site documentation
Posted in
12092
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
320
This Month
1746
This Year
3489
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
alpine js apps c css factorio font awesome images linux quick modals sqlite site bugs site updates slick slider sliders testing windows apps apache api apps asp bat bootstrap bootstrap templates charts cookies core css css filters css grid design elements docker domains emoji fancybox fonts foundation framework gimp git html icons ideas image formatting images javascript javascript functions jquery js linux mac misc modals mysql nginx node php php errors php function php functions php simple html dom pi400 python react regex sections simple_html_dom simplepie php site bugs site documentation slick slider sql sqlite ssh sublime svg svg css templates tools virtual box vscode vue webdev windows windows 11 windows commands wordpress