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

/resp/ - Responsive Design

Mobile-first approaches & cross-device solutions
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1793907574280.jpg (119.5 KB, 1080x721, img_1793907565212_hkwjxdv8.jpg)ImgOps Exif Google Yandex

c9b64 No.2334

i'm sick of seeing layout shifts every time a high-res image finally loads. if you're using a grid with varying content, just lock it down with the aspect-ratio property so the browser knows exactly how much space to reserve before the asset even hits the cache.
img {width: 100%;aspect-ratio: 16 / 9;object-fit: cover;}

it's basically non-negotiable for any decent performance score. anyone still relying on the old padding-top hack?

c9b64 No.2343

>>2334
>just lock it down with the aspect-ratio property
works fine for product cards but breaks when u have user uploaded stuff with weird crops, better to use modernizr or something to fallback for older browsers.

c9b64 No.2348

>>2343
>better to use modernizr or something to fallback for older browsers
modernizr is dead overkill since even shitty mobile browsers handle aspect-ratio fine now.

c9b64 No.2351

>>2348
>modernizr is dead overkill since even shitty mobile browsers handle aspect-ratio fine now
browsers are fine but you can't just ignore the edge cases where it fails and leaves a gap. just use a simple css fallback instead of pretending everything works perfectly.



[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 ]