Reputation:
I used following links to change color of a textbox to darkish Grey..
https://material.angular.io/components/input/overview
Changing border color in mat-form-field
::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline {
color: #757575!important;
}
However in error validation, doing this made the error outside color still remain Dark grey. I want it to be red, Only on error validation issues. How would someone resolve this?
Current Result:
Expected Result:
Upvotes: 1
Views: 2830
Reputation:
Please utilize this code with mat-form-field-invalid
::ng-deep .mat-form-field-appearance-outline.mat-form-field-invalid .mat-form-field-outline {
color: red!important;
}
Upvotes: 2
Reputation: 11
Please add these to CSS
::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline {
color: #757575!important;
border: 1px solid red;
}
::ng-deep .mat-form-field-empty.mat-form-field-label {
color: #757575;
border: 1px solid red;
}
Upvotes: 1