Hey there, I'm working with a CSS class that applies a red border to an input field when it is required and invalid, and changes to green when it becomes valid.
CSS
.ng-valid[required], .ng-valid.required {
border-left: 5px solid #42A948; /* green */
}
.ng-invalid:not(form) {
border-left: 5px solid #a94442; /* red */
}
HTML
<input
type="text"
class="form-control"
placeholder="Vehicle Code"
[formControl]="codeControl"
required
/>
Now, I'm looking to change the left border color to something else when the input field hasn't been touched yet. Currently, on page load, the default left border is red and changes to green when validated.