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; }
如有問題,還請及時指正。
