How is this possible with CSS only?!

Kevin Powell on YouTubeWatch on YouTube

SaveMark complete

Sign in to save videos and track what you’ve finished.

IntermediateUIWeb Design20 min

About this video

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