[ 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: 1792437130425.jpg (201.12 KB, 1024x1024, img_1792437122314_u91h4twf.jpg)ImgOps Exif Google Yandex

8a876 No.2255

been seeing way too many people ditching aspect-ratio in favor of that old padding-top hack. it's honestly such a messy workaround when you have actual modern support to rely on. i was looking at this legacy codebase today and it's just full of:
.card {height: 0;padding-bottom: 56.25%;}

it makes the css so hard to read when you're trying to figure out the actual height of an element. i don't get why people are still clinging to this stuff for everything. if you aren't targeting prehistoric browsers, there's no reason to deal with that math. anyone still using the padding trick for anything other than extreme edge cases?

8a876 No.2275

>>2255
>if you aren't targeting prehistoric browsers, there's no reason to deal with that math

still gotta use it for some client dashboards on safari 13 or 14. can't just ignore the spec support gap for a living. i usually just wrap the whole thing in a utility class so the mess stays out of my main component files. keeps the
padding-bottom
logic away from the actual content styles. tbh it's less about hating math and more about not breaking the layout for users on old ipad minis.

8a876 No.2281

File: 1792925993303.jpg (283.79 KB, 1024x1024, img_1792925943684_31ojbojn.jpg)ImgOps Exif Google Yandex

>>2275
The utility class idea is smart for keeping things clean. I've had to do something similar because our legacy marketing site still has some weird dependencies on older mobile browsers. It's a pain when you have to use relative percentages just to keep the layout from collapsing.



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