I'm quite surprised that I wasn't able to find anything related to this on Google.
The issue I have now is I want my form fields to highlight based on their validity, but ONLY after the user has interacted with the form. I don't want invalid fields to be red as soon as the page is loaded. I tried using the :visited and :focus-within with my form element, but the former doesn't work and latter doesn't do what I want.
Am I not asking this question the right way?
Edit:
I did come across onblur
in my search but I thought there would be an intuitive way to do this with CSS only, turns out I was wrong → Does CSS have a :blur selector (pseudo-class)?