Scroll-linked corner-shape effects with pure CSS

Daniel Schwarz experiments with the new CSS corner-shape() property and ties its mathematically defined values to scroll so corners morph smoothly into some surprisingly nice UI effects.


Arthur

This is a neat fit for scroll timelines since corner-shape() is numeric enough to interpolate cleanly, so the effect feels smoother than most border tricks.

.card {
  animation: morph linear both;
  animation-timeline: scroll();
}

@keyframes morph {
  from { corner-shape: round; }
  to { corner-shape: scoop; }
}

BayMax