diff --git a/src/dev-app/input/input-demo.html b/src/dev-app/input/input-demo.html index 257ba448fd80..5e5de7526413 100644 --- a/src/dev-app/input/input-demo.html +++ b/src/dev-app/input/input-demo.html @@ -977,3 +977,39 @@

No defined label

+ + + + Basic outlined/filled fields with autofill attribue + +
+ + + + + + + +
+ + + + + + Last name + + +
+ + Home Address + + + + + Shipping + + +
+
+
+
diff --git a/src/material/form-field/form-field.scss b/src/material/form-field/form-field.scss index 00b2c60540e4..77e356700045 100644 --- a/src/material/form-field/form-field.scss +++ b/src/material/form-field/form-field.scss @@ -186,6 +186,12 @@ $_icon-prefix-infix-padding: 4px; &:has(textarea[cols]) { width: auto; } + + input:-webkit-autofill, + textarea:-webkit-autofill { + -webkit-background-clip: text; + -webkit-text-fill-color: token-utils.slot(form-field-filled-input-text-color, $fallbacks); + } } // In the form-field theme, we add a 1px left margin to the notch to fix a rendering bug in Chrome.