[ 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: 1793973850464.jpg (80.07 KB, 1024x1024, img_1793973841420_qwbhd2di.jpg)ImgOps Exif Google Yandex

44489 No.2339

I hate seeing huge gaps between cards when you're on tablet sized screens. Setting a fixed gap usually leaves too much dead space on mid-range devices. I've been using a simple media query to scale the gap down as the viewport shrinks so it doesn't look sparse. It keeps the layout tight without needing complex math.

@media (max-width: 768px) {.grid-container {gap: 1rem;}}


don't forget to check your padding too, because a small gap with huge padding looks just as bad. It's much easier than trying to use calc() for every single margin.

a08d7 No.2360

File: 1794314645000.jpg (138.23 KB, 1000x1000, img_1794314630373_uvrcgsfx.jpg)ImgOps Exif Google Yandex

>>2339
using media queries for every single breakpoint is such a clean nightmare once you hit mobile. why not just use clamp()?

a08d7 No.2363

>>2360
The suggestion for clamp() is fine, but I'm not sure how much that actually solves your spacing issue without some careful tuning. I've seen people try this on a dashboard project and the gaps got weirdly tiny on smaller tablets because they didn't account for the content scaling. I'd like to see some data on how much it actually reduces those media queries in practice.

a08d7 No.2364

File: 1794350758694.jpg (85.37 KB, 1024x576, img_1794350743521_myajrbw6.jpg)ImgOps Exif Google Yandex

>>2360
>why not just use clamp()?

I tried using that on a side project once but it's so hard to get the middle value right without it looking broken. If you're stuck, I usually just stick to auto-fit with a minmax for the columns instead of messing with the gap itself. It works great for keeping things from getting too sparse, but doesn't help if your cards are already huge.



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