The @property trick that makes sibling-index() more useful

Kevin Powell on YouTubeWatch on YouTube

SaveMark complete

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

IntermediateUI8 min

About this video

This video shows how to stagger both the cards and the children inside each card using sibling-index(). It explains that registering a custom property locks in the computed value so every child can use it. It suits web designers and front-end developers who already know basic CSS.

What you’ll learn

  • Apply sibling-index() to stagger a set of cards
  • Register a custom property to reuse a computed sibling-index() value
  • Stagger the child elements inside each card