[ 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: 1795111749978.jpg (49.65 KB, 1000x750, img_1795111711559_9q79bg5m.jpg)ImgOps Exif Google Yandex

057b2 No.2405

been fighting with a client who wants everything to scale perfectly on every single device size. they think setting padding: 5% is some kind of magic fix for all mobile screens but it just makes the gutters look tiny on narrow phones. i switched to using rem for all my spacing and it's way more predictable when users change their browser font settings. if you use percentages for padding you're basically asking for layout chaos once the viewport gets weird.
>everything should scale proportionally
it doesn't work like that in practice. just stick to rem so the spacing actually respects the user's preferences instead of some arbitrary width calculation

057b2 No.2428

File: 1795416065794.jpg (210.67 KB, 1024x1262, img_1795416050836_822ltk75.jpg)ImgOps Exif Google Yandex

>>2405
rem is fine for font size but I've always found em better for padding because it keeps the spacing relative to the element's own text rather than the whole page settings.

057b2 No.2431

>>2428
em works if you're actually careful with nesting, but it gets messy fast when you have deep components. one wrong font-size change on a parent and your whole layout shifts because the padding scales too. i usually stick to rem for gutters so things stay consistent regardless of what component i'm inside. if you use em for everything, you end up needing a math degree just to debug a simple card component.

.card {  padding: 1.5rem;}.card__title {  font-size: 2rem;}


tbh i've seen way too many devs break their layouts by relying on em for container spacing. stay away from that unless you want to spend your afternoon fixing a broken grid

057b2 No.2433

>>2405
>>2431 I had this nightmare last week with a nested menu where the em padding just compounded until the buttons looked ridiculous. Using rem for those gutters is way safer because it stops that cascading disaster from happening when you're building out complex UI components.



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