Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 10 - Remove background color on mat-select

Just take a look to the image:

mat-option

Basically, I want to change/remove the background color (the gray one) on this mat-option element. I also tried with the browser inspector in order to find the class that has the background-color line, but I couldn't find nothing.

Any idea?

like image 507
Bugpirasi Avatar asked Jun 16 '26 20:06

Bugpirasi


2 Answers

You'll need to either:

  1. deprecated ng-deep
  2. turn off component view encapsulation
  3. use a global style
::ng-deep .mat-form-field-appearance-fill .mat-form-field-flex {
    background-color: #fff; 
}
like image 173
jenson-button-event Avatar answered Jun 19 '26 11:06

jenson-button-event


You can try:

.mat-form-field-appearance-fill .mat-form-field-flex {
   background-color: red;
}

That did the trick for me.

like image 37
acincognito Avatar answered Jun 19 '26 09:06

acincognito



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!