With support for CSS :has() function finally arriving in most browser, I thought I'd try to see how it can be used specifically with HTML forms. I found four pretty compelling use-cases:
Inline input validation feedback
Conditional content rendering
Custom card inputs
Visual validation feedback for submit buttons.
Links:
"How to Build HTML Forms Right" blog posts - https://austingil.com/how-to-build-ht...
Documentation - https://developer.mozilla.org/en-US/d...
GitHub repo - https://github.com/AustinGil/has-bett...
Watch Austin's Livestreams here:
YouTube: / heyaustingil
Twitch: / heyaustingil
Website: https://austingil.com/
Chapters:
0:00 - Introduction
0:14 - Using CSS :has() with HTML forms
9:11 - Conclusion
#html #webdevelopment #css #htmlforms