原生input修改input:-internal-autofill-selected自动填入携带的背景色
当input框背景色设为其他色或者透明色的时候,chroma浏览器默认填充进入输入框会额外携带背景色,css代码如下:
input:-internal-autofill-selected {
appearance: menulist-button;
background-image: none !important;
background-color: light-dark(rgb(232, 240, 254), rgba(70, 90, 126, 0.4)) !important;
color: fieldtext !important;
}
我尝试过vue的样式穿透,但是并没有效果。
解决方案:
input:-internal-autofill-previewed,
input:-internal-autofill-selected {
-webkit-text-fill-color: #ffffff !important;
transition: background-color 5000s ease-in-out 0s !important;
}