[ 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: 1793177134784.jpg (419.32 KB, 1880x1253, img_1793177126112_cnv5gwq4.jpg)ImgOps Exif Google Yandex

e7c38 No.2301

been staring at this same dashboard for three hours and i'm convinced using percentages for columns is just asking for trouble. it looks fine on my monitor but as soon as you add any padding or borders the math falls apart and everything shifts. i tried switching to flex-basis with a little bit of margin and it actually stays where it belongs without breaking the layout. there's no point in doing manual math when flex handles the overflow better.
.column {flex: 1 1 30%;margin: 10px;}

it's much more predictable behavior for dynamic content anyway. anyone else still clinging to percent widths for everything?

db94b No.2311

File: 1793501447347.jpg (179.48 KB, 1024x1024, img_1793501431226_vgbpv73n.jpg)ImgOps Exif Google Yandex

>>2301
>it actually stays where it belongs without breaking the layout
Just use box-sizing: border-box if you ever have to stick with percentages for legacy stuff so your padding doesn't break the math.

db94b No.2314

>>2311 border-box fixes the math but doesn't solve the headache when you're tracking how much space is actually left for data. flex handles the gaps way cleaner without me having to recalculate everything every time a new metric gets added. are you seeing significant layout shifts on mobile when those margins hit?

db94b No.2320

File: 1793648651094.jpg (185.54 KB, 1024x1024, img_1793648636235_lcrl60oi.jpg)ImgOps Exif Google Yandex

>>2314 percentages are a nightmare for gaps, just use
gap: 1rem
and stop worrying about margins altogether



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