Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
C0D4669026y@Alice
position:fixed; toggled on scroll top-offset.
Or maybe I'm old school.
But I've never seen it done with padding 🤔 -
Wombat102446y@theKarlisK you misunderstood the point. It was about storytelling, not a sticky ui element.
-
Wombat102446y@Alice @C0D4 padding is probably the most inefficient way to achieve a sticky position. It triggers repaint on every change. If compatibility is important I would go with transform: translateY and css transitions.
Related Rants
Hi @dfox, hi @trogus
Why have you decided to achive a sticky avatar on the rant page by increasing padding-top on scroll on the web app?
I try to understand your decision, because I would have choosen position sticky.
devrant
javascript
css
position sticky
avatar