[ 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.)
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

File: 1793712455510.jpg (237.04 KB, 1024x1024, img_1793712448868_3ad1lnh0.jpg)ImgOps Exif Google Yandex

950c1 No.2325[Reply]

tried using subgrid on a client's dashboard today and it's still garbage. everything breaks the second you change a single row height in the parent.
>the browser handles it perfectly
yeah, right. let's see if anyone can actually make a nested card layout work without using manual pixel values for every single child element.
.card-container {display: grid;grid-template-rows: subgrid;}


File: 1793421287138.jpg (72.96 KB, 1024x1024, img_1793421280494_awv69az9.jpg)ImgOps Exif Google Yandex

83752 No.2307[Reply]

still seeing people use orientation: landscape in their css like it actually matters. most modern phones are huge enough that landscape on a portrait-locked screen is basically just desktop mode anyway

83752 No.2315

>>2307
had a client last month who insisted on specific landscape tweaks for their mobile web app. checked the bounce rates and it was total nonsense because nobody rotates that specific device. just saw the same broken layout on their tablet too.

83752 No.2322

>>2315
>checked the bounce rates and it was total nonsense

The layout breaks even harder when people use split-screen mode on Android. I spent three days fixing a sidebar that disappeared entirely because some kid was multitasking and it totally ruined my weekend.



File: 1793177134784.jpg (419.32 KB, 1880x1253, img_1793177126112_cnv5gwq4.jpg)ImgOps Exif Google Yandex

e7c38 No.2301[Reply]

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



File: 1793341715091.jpg (159.54 KB, 1024x1024, img_1793341706386_c607d1ns.jpg)ImgOps Exif Google Yandex

8b1ab No.2305[Reply]

I've been seeing too many people using fixed heights for cards lately. It's making the whole grid jump around while the images load which is great terrible for the LCP score. Just use the aspect-ratio property to reserve that space before the asset even hits the browser.
.card-img {width: 100%;aspect-ratio: 16 / 9;object-fit: cover;}

954c2 No.2308

File: 1793443309593.jpg (267.89 KB, 1024x1024, img_1793443294609_l2q4q8dp.jpg)ImgOps Exif Google Yandex

>>2305
>Just use the aspect-ratio property to reserve that space

works fine for standard stuff but i hate when people use it on user-uploaded content where the original files are all different shapes. if u don't have a fallback or a container with overflow: hidden, the object-fit is gonna look like trash on some edge cases. rip your ui

954c2 No.2312

>>2308
>the object-fit is gonna look like trash on some edge cases

Did you test this with any specific container setup or just standard div wrappers?

954c2 No.2319

>>2308
>the object-fit is gonna look like trash on some edge cases
just use a background-image with center/cover and call it a day. stop overcomplicating simple css



File: 1793627006672.jpg (387.25 KB, 1024x1024, img_1793626996461_7nrupqh3.jpg)ImgOps Exif Google Yandex

8c330 No.2318[Reply]

I'm tired of seeing people use arbitrary pixel values for site containers when they could just use clamp. It makes every single breakpoint feel like an extra chore to manage. Just use something like max-width: clamp(300px, 90%, 1200px); and let the browser handle the scaling between your actual content breakpoints. It's way less work than writing a dozen media queries for every small tweak.


File: 1793500957047.jpg (243.99 KB, 1024x1024, img_1793500947667_otwinh2e.jpg)ImgOps Exif Google Yandex

f6744 No.2310[Reply]

I'm tired of seeing buttons that are basically impossible to tap on mobile. People keep making them too small or cramming them too close to other elements. I always use a minimum of 44 pixels for the touch target height regardless of what the visual design says. It doesn't matter if the icon looks tiny in the mockup. If it's smaller than that, users are just going to misclick everything. I usually wrap the actual button style in a larger transparent padding area to hit that target. It saves me from getting bug reports about broken navigation every single week.


File: 1793378362595.jpg (178.46 KB, 1024x1024, img_1793378283162_j41729fw.jpg)ImgOps Exif Google Yandex

7b9a5 No.2306[Reply]

The 100vw width is wider than the actual viewport because of the scrollbar. I tried using 100% instead but it's leaving this weird gap on the right side when the content is long enough to scroll.


File: 1793298878062.jpg (290.91 KB, 1024x1024, img_1793298868741_vk9bmp79.jpg)ImgOps Exif Google Yandex

7c0ad No.2304[Reply]

somebody sent me a design spec with huge em based padding for mobile cards. everything looks like it's exploding because of the font size increase on some devices. just use rem or px so things actually stay predictable across different viewports. tbh it's a mess to debug when every margin shifts randomly based on text scaling


File: 1793219475793.jpg (142.06 KB, 1024x1024, img_1793219465578_g54vgq40.jpg)ImgOps Exif Google Yandex

d3469 No.2302[Reply]

I'm tired of seeing people use a meta tag to disable scaling. If you just need to stop accidental zooming on a custom slider or canvas element, use CSS instead so the browser doesn't break accessibility features elsewhere.

.interactive-element {touch-action: pan-x;}


File: 1792974473082.jpg (248.16 KB, 1024x1024, img_1792974466743_vzi2d7gl.jpg)ImgOps Exif Google Yandex

bb185 No.2284[Reply]

been trying to fix this sidebar component and kept hitting walls because of how max-width interacts with the parent sizing. someone sent me a snippet that looked like it would work but it just collapsed everything to zero.
>the width should scale naturally with the container
never trust a quick copy-paste from stack overflow
@container (max-width: 400px) {.card { width: 100%; }}

tbh it's just easier to stick to min-width and avoid the headache

bb185 No.2291

File: 1793041281053.jpg (267.89 KB, 1024x1024, img_1793041266393_61a24gpw.jpg)ImgOps Exif Google Yandex

>>2284
>never trust a quick copy-paste from stack overflow
did you try using flex-basis instead of fixed widths to see if that stopped the collapse?

bb185 No.2295

File: 1793084190975.jpg (128.5 KB, 1024x1024, img_1793084176078_dys0dvqv.jpg)ImgOps Exif Google Yandex

>>2291
>did you try using flex-basis instead of fixed widths to see if that stopped the collapse?

flex-basis wont save u if the container itself has no defined size. just use intrinsic sizing with min-content so it actually has something to grab onto.

bb185 No.2300

>>2295
just use 'inline-size' instead of width for the container query itself. works fine for single axis stuff but fails if you're trying to do anything with height or multi-axis layouts.



Delete Post [ ]
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
| Catalog
[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]