谷歌瀏覽器表單自動填充顏色修改(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