Google Chrome <input /> 自动填充背景颜色在 72.0 版中是否更改?

is Google Chrome <input /> Auto fill background color changed in Version 72.0?

我最近在 Google Chrome 中注意到它为所有自动填充值的输入元素显示蓝色背景

是的,它变成了浅蓝色。

是 Google 将自动填充预览的背景颜色更改为 GoogleBlue50。您可以在此处找到问题:https://bugs.chromium.org/p/chromium/issues/detail?id=935991

自 Google Chrome 72 起,新的自动填充颜色为 #E8F0FE / rgb(232, 240, 254)。直到 Google Chrome 72 自动填充字段用 #FAFFBD / rgb(250, 255, 189):

着色

input {
  border: 1px solid black;
  padding: 4px 3px;
}
.show-autofill-new {
  background-color: #E8F0FE !important;
  background-image: none !important;
  color: #000000 !important;
}
.show-autofill-old {
  background-color: #FAFFBD !important;
  background-image: none !important;
  color: #000000 !important;
}
<input class="show-autofill-new" placeholder="since 72" type="text">
<input class="show-autofill-old" placeholder="until 72" type="text">

注意:如果您想覆盖自动填充颜色,您可以使用针对此问题提供的解决方案之一:

  • Google Chrome form autofill and its yellow background
  • Removing input background colour for Chrome autocomplete?

未来计划split the CSS rules for autofill previewed and autofill selected:

  • 自动填充已预览(将鼠标悬停在自动填充建议中时会填充字段)。
  • 已选择自动填充(字段由自动填充建议填充)。

是的,Google 出于某种未知原因更改了此设置。

正在对其进行跟踪,但未说明更改原因:https://bugs.chromium.org/p/chromium/issues/detail?id=935991

更新已进入 Chrome 版本 72.0.3626.119

在我看来,它看起来太像残疾人风格了。我想每个使用 Chrome 的人都已经习惯了自动填充输入的黄色背景,所以现在这可能会给用户带来很多困惑。

然而,就像所有事物一样,人们最终会习惯新颜色。如果你真的想要它回来,你可以使用以下 css:

input:-webkit-autofill, input:focus:-webkit-autofill {
   -webkit-box-shadow: 0 0 0 100px rgb(250, 255, 189) inset;
}

注: 这将覆盖您已经应用于输入的任何框阴影。