[ 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: 1791702344984.jpg (117.27 KB, 1024x1024, img_1791702336600_7u3dkzbr.jpg)ImgOps Exif Google Yandex

92354 No.2205

been fighting with a client's weird grid requirements all morning. they want cards to just "work" without manual media queries for every single breakpoint. i tried using auto-fill but it leaves those massive, awkward gaps on the right side of the screen when you don't have enough items to fill a row. honestly auto-fit is much better because it stretches the tracks to cover the space. just set your column width with a minmax value and let the browser handle the math. it's way cleaner than writing out five different media queries for different screen sizes.

grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));


tbh seeing people still manually adjusting column counts in css is painful. it's just extra code to maintain and prone to breaking when the content changes. never use fixed columns unless you actually want a broken layout on mobile. stick to the minmax approach and save yourself the headache.

92354 No.2224

>>2205
>just set your column width with a minmax value and let the browser handle the math.

did this exact same thing for a dashboard last week and my lead actually thought i was being lazy. had to explain that auto-fit is literally just less work for no reason. spent three hours fixing those gaps instead of finishing my actual tickets because i forgot how much it sucks. total nightmare when the content is dynamic.



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