Reverse-engineering a scrollytelling sticky effect
Mike Solomon built a scrollytelling piece for Esquire and wrote up the process, documenting each step toward getting position: sticky; working alongside negative margins, wrapper divs, backgrounds, and a small amount of JavaScript-based measuring. What his write-up lacks is a standalone demo of the effect, so Chris Coyier attempted a reverse engineering of it: "Sticky Figcaption with Protruding Figure."
The recreation relies on plenty of magic numbers so that the exit produces the "tuck behind" effect. For cases where that behavior isn't needed, a cleaner version exists.
The result is probably not exactly what Solomon had, as the precise details of his intent aren't fully documented. His final GIF:

A short video captured from the article itself is offered as further inspiration for trying a different approach.
The overlooked takeaway: sticky's offset
After a conversation with Solomon, the main point — which had initially been missed — came through: "sticky isn't just for the top of the screen." In the finished piece, the sticky element becomes sticky well before it reaches the top of the screen — closer to the middle. That behavior is controlled by the top value on position: sticky;, and in a demo where the goal is to have the element slide in and out of an image, tuning it gets tricky.
After some back and forth forking, the result was reached.



