Problemsclip-path Reveal Transitions
09Medium

clip-path Reveal Transitions

CSS / Animation

CSSclip-pathAnimationTransitionsPerformance

Context

The position-aware search component reveals a results drawer when expanded. Instead of animating `height` (layout reflow on every frame) or `max-height` (broken easing, guessed values), `clip-path: inset()` handles the reveal entirely on the GPU compositor.

The Concept

`clip-path: inset()` clips an element's visible area geometrically without affecting layout. Transitioning from `inset(0 0 100% 0)` to `inset(0)` reveals an element without triggering layout reflow.

Task

The `.drawer` is always in the DOM but must be hidden until `.is-open` is added. Use `clip-path: inset()` to clip 100% from the bottom (hiding it), reveal it fully when open, and transition smoothly between states.

styles.css
Hints0/3 revealed