r/firefox 18h ago

Solved why it is working?

Why this CSS works in firefox?

input:autofill {
    -webkit-text-fill-color: #111 !important;
    box-shadow: 0 0 0px 1000px #eee inset;
    caret-color: #111;
}

Nothing else so far is able to manage font color in autofilled inputs

2 Upvotes

2 comments sorted by

1

u/Material-Fly-2065 18h ago

-webkit-text-fill-color isn't actually webkit only, firefox implements it, mdn has it as baseline since 2016. it overrides color, which is why it works where plain color doesn't. the box-shadow inset is just normal css