[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/q/ - Q&A Central

Help, troubleshooting & advice for practitioners
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1771895320452.jpg (58.98 KB, 1880x1253, img_1771895312570_5ke9vqdw.jpg)ImgOps Exif Google Yandex

1474c No.1281

If you're working w/ a large-scale web app that uses lots of scrolling elements like grids or infinite scroll galleries , chances are performance can get sluggish over time. Here's an easy tweak:
Use the following CSS trick for smoother and faster scrolls:
/'' Add this to your global styles ''/body {overflow-scrolling: touch;}

This simple line of code ensures that mobile devices use hardware acceleration when scrolling, making a huge difference in performance.
However ⚠️ spoiler alert - it might not be the best for desktop users as some browsers handle `overflow` differently. For those cases:
/'' Desktop-specific styles ''/@media (pointer: fine) {body::before {content:";position:absolute;top:left; /'' set these to your actual viewport size or use calc() functions here ''/width;height:}}

This creates a pseudo-element that forces the browser into using composited scrolling, which is faster.
Try both and see what works best for you.

1474c No.1282

File: 1771895436109.jpg (59.8 KB, 1080x720, img_1771895420634_87y7xla0.jpg)ImgOps Exif Google Yandex

css trick ive been loving is using
-x: hidden
on scroll containers to prevent horizontal scrolling issues, especially when dealing w/ large-scale apps where content can overflow unexpectedly this stops unwanted jumps and keeps things smooth ✨ have tried it out in a project recently - made all the difference!



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]
. "http://www.w3.org/TR/html4/strict.dtd">