Video wird geladen...
Video konnte nicht geladen werden
soon: CSS only sticky scroll hide/reveal 🧑🍳 .atc { position: fixed; bottom: 0; transition: translate 0.26s cubic-bezier(.55,0,.67,1.25); /* hide on scroll down */ @container scroll-state(scrolled: bottom) { translate: 0 100%; transition-delay: 0.5s; } }
66,423 Aufrufe • vor 1 Jahr •via X (Twitter)
13 Kommentare

Top top!!

@readytorelease it’s at the bottom though 🥁😅

wow - is it also possible to build a scrolled bottom once?

like a tuck away and forget after scrolling from the top but towards the bottom? you could do a scroll animation that triggers a translation at a certain point that then wouldn’t trigger again until scrolling back up

One current limitation is the inability to specify an offset. For instance, in our case we would like to hide a header after scrolling for a given amount. Having a way to define scroll-state(scrolled: bottom by 100px) for instance would be nice! Is this something being planned?

yeah, agreed 💯 it kinda feels like you'd want something a bit like scroll-margin/padding-top to have an effect on the scroll-state trigger 🤔

Exactly. Using scroll-margin/padding was actually my first intuition, but this did not work!

Is it fully supported finally?

You may achieve a similar behaviour using custom properties and style queries

find this one unreliable unfortunately, it’s easy to get into a state where it doesn’t appear when you want it to

Css is beautiful

Is it possible to have a sticky block hide/reveal as you scroll, rather than through a transition animation?

Cool. I think it's somewhat possible with scroll/view states already.
