谷歌浏览器表单自动填充颜色修改(antd)


antd中设置了-webkit-autofill,发现效果并不理想。后来发现antd中针对ant-input有别的设置,代码如下:

//global.less

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0px 1000px rgba(225, 233, 255, 0) inset !important; //设置为透明色时不要写transparent,否则不生效,可自行调整其他颜色

-webkit-text-fill-color: #fff !important; //字体颜色
 -webkit-transition-delay: 99999s; -webkit-transition: color 99999s ease-out, background-color 99999s ease-out;
} .ant-input-affix-wrapper input.ant-input:focus { //这个在antd中需要单独覆盖 background: transparent !important; box-shadow: none !important;
}

 如有问题,还请及时指正。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM