Building a progress-indicating scroll-to-top button in HTML and CSS

I noticed a nice detail on theneedledrop.com . They have a square scroll-to-top button with an arrow pointing right. The button s border is black, and the background color is white. When you scroll, the arrow points up, and the background color turns gradually yellow as you scroll. That s nothing too special, but it caught my attention because it looks nice and I realized we can build this without…