所以,我有一个现有的 mat-form-field,我想更改特定字段的背景颜色。我已经在 css 中尝试过这段代码,但它改变了我表单中所有字段的背景颜色:
::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline {
background-color: lightgray !important;
border-radius: 5px;
}
这是我的 mat-form-field 的代码:
<mat-label>Filing Time</mat-label><br />
<mat-form-field appearance="outline" class="width-1">
<input
matInput
readonly
formControlName="filingTime"
[ngModel]="filingDate | date: 'HH:mm'"
/>
</mat-form-field>