首页 > 解决方案 > mat-form-field legacy 更改边框颜色

问题描述

我目前正在尝试更改 legacy 的下划线mat-form-field。现在我测试了很多,包括以下内容:

.mat-form-field-appearance-legacy .mat-form-field-underline,
.mat-form-field-appearance-legacy .mat-form-field-ripple,
.mat-form-field-appearance-legacy.mat-focused .mat-form-field-underline,
.mat-form-field-appearance-legacy.mat-focused .mat-form-field-ripple,
.mat-form-field-appearance-legacy.mat-focused .mat-form-field-legacy-thick {
    color: red
}

但是我的下划线仍然是蓝色的。这是我的定义mat-input-field

<mat-form-field class="block">
    <input type="text" matInput placeholder="{{ 'AUTH.username' | translate }}" formControlName="username" required>
    <mat-error *ngIf="submittedForm && loginForm.controls.username.invalid">{{ getErrorMessage('username') }}</mat-error>
</mat-form-field>

提前致谢。

标签: angularangular-material

解决方案


推荐阅读