Revealing ‘back to top’ button
Such a clever minimalist use of CSS!
Don’t let the title fool you—this isn’t just for parallax scrolling (thank goodness!)—it’s for triggering any CSS updates based on scroll position. Using CSS custom properties makes a lot of sense. The JavaScript/CSS bridge enabled by custom properties is kind of their superpower. (That’s one of the reasons why I don’t like calling them “CSS variables” which makes them sound like Sass variables—they’re so much more than that!)
Such a clever minimalist use of CSS!
This is a useful technique that future me is almost certainly going to need at some point.
I didn’t know about scroll-margin-top! I wonder if you could apply a universal rule …like, say you’ve got a fixed header that’s 2em in height, couldn’t you declare:
:target {
scroll-margin-top: 2em;
}
Jeremy Wagner offers a deep dive into lazy loading images (and video) with some advice for considering the no-JavaScript situation too.
This looks like a handy JavaScript library for scroll-based events. But “scrollytelling?” No. Just …no.
It’s not you, Twitter, it’s me.
Once again, Safari has fucked up its implementation.
How to make the distance of link underlines proportional to the line height of the text.
Make your links beautiful and accessible.
Some styles I re-use when I’m programming with CSS.