Suppose I have this CSS code:
label {
color: #AAAAAA;
}
Can I modify it to include a condition that changes the color to red if the label has the "error" class? I am aware that I can dynamically add the class to the label in HTML, but I am curious if this can be achieved through CSS since the label is only created when there is an input error.