Challa Rashmitha
Challa Rashmitha

Reputation: 21

Angular 16 version matformfield is not allowing to change the border

I have encountered a problem where I want to create a input inside mat-form-field with mat-autocomplete but facing issues in unable to change styles such as border,background-color and don't know why it gives a space at the bottom unable to fix the changes, any suggestions could be useful.

Here is the stackblitz for the problem I'm facing: https://stackblitz.com/edit/6pam3o-qppvkt?file=src%2Fexample%2Fautocomplete-auto-active-first-option-example.html,src%2Fexample%2Fautocomplete-auto-active-first-option-example.css,src%2Fexample%2Fautocomplete-auto-active-first-option-example.ts

I'm expecting to remove the border,background-clour and extra space assigned at the bottom

Upvotes: 0

Views: 54

Answers (1)

Arnaud Flaesch
Arnaud Flaesch

Reputation: 669

If you want to override CSS properties of Material classes such as mat-mdc-form-field-focus-overlay, mat-mdc-form-field, etc. you need to put the css rules in your styles.scss file with the !important attribute. It won't work in the component style file because they will be ignored.

Upvotes: 0

Related Questions