Remove new Firefox autofill color

后端 未结 1 1200
别跟我提以往
别跟我提以往 2021-02-05 10:28

A few days ago my Firefox Developer Edition updated to version 67.0b2 (64 bit). Since then all autofilled input fields have a yellow background, on literally every website.

相关标签:
1条回答
  • 2021-02-05 10:59

    After few sleepless nights I've finally figured out how to get rid of the autofill colors!
    It's really simple, all you have to do is to add this to your css:

    input {
      filter: none;
    }
    

    It's because at the bottom of view-source:resource://gre-resources/forms.css we can see this:

    :-moz-autofill, :-moz-autofill-preview {
      filter: grayscale(21%) brightness(88%) contrast(161%) invert(10%) sepia(40%) saturate(206%);
    }
    

    Which basically messes up your colors. I'm not sure if this is new in version 67.0b2 but it's nice to know it's there.
    EDIT: This fix works for every Firefox browser with version 67.0 or higher.
    EDIT 2: If you are looking for global fix for your Firefox, not just for your website you're creating, and you don't know how to add something to your Firefox's CSS then have a look here

    0 讨论(0)
提交回复
热议问题