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 - austingil.com/how-to-build-ht...
Documentation - developer.mozilla.org/en-US/d...
GitHub repo - github.com/AustinGil/has-bett...
Watch Austin's Livestreams here:
RU-vid: / heyaustingil
Twitch: / heyaustingil
Website: austingil.com/
Chapters:
0:00 - Introduction
0:14 - Using CSS :has() with HTML forms
9:11 - Conclusion
#html #webdevelopment #css #htmlforms
10 июл 2024