Loading...
input.touched:valid {
border-color: green;
}input:user-valid {
border-color: green;
}:user-valid tracks interaction itself, so no JavaScript class is needed to delay success styles.
:user-valid, so untouched fields don't show as valid on load.After the user changes the value and commits it, for example by leaving the field, or after a submit attempt. Before that, it matches neither :user-valid nor :user-invalid.
It can. An optional field the user clears and leaves is still valid, so add :not(:placeholder-shown) if success marks need a value.