All mdc mat-form-field examples have gray/whitesmoke background. How can I change it?
how to customize background color for mat-form-field?
1k views Asked by Ya. At
3
There are 3 answers
1
On
Angular 15 and greater below property in root styles.css allows to control the background of text fields
/* Angular 15 adds grey background on mat form components */
/* below removes that background color */
/* Manipulate initial background color*/
.mdc-text-field--filled:not(.mdc-text-field--disabled) {
background-color: transparent !important;
}
/*Manipulate background color on hover and focus*/
.mat-mdc-form-field-focus-overlay {
background-color: transparent !important;
}
you can try
or
in your styles.css