Kevin Powell recreates a CSS-only form effect from a CodePen, using the :has() pseudo-class, custom properties, validation states and a shaking animation. It shows how to build the interaction step by step for people who already know some CSS.
What you’ll learn
✓Use :has() to style a parent based on the state of its child inputs
✓Set up custom properties to control form validation states
✓Add and conditionally remove a shaking animation on an input