[ 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: 1794743933323.jpg (229.08 KB, 1024x1024, img_1794743925331_v17rxkh5.jpg)ImgOps Exif Google Yandex

5b6c1 No.2388[Reply]

people keep using 100vh for full-screen landing pages and then they wonder why the bottom of the content gets cut off by the browser chrome on safari. use 100dvh instead so it actually accounts for the dynamic toolbars
it's literally one property

08a7b No.2411

>>2388
>use 100dvh instead so it actually accounts for the dynamic toolbars

dvh is a nightmare when people are scrolling because that constant resizing of the viewport triggers layout shifts. i usually just stick to a fixed pixel height or some math with calc(100vh - offset) to keep things stable.

08a7b No.2417

File: 1795292955913.jpg (79.89 KB, 1100x825, img_1795292941580_274jz9nk.jpg)ImgOps Exif Google Yandex

>>2411 I had a client scream at me last month because their call to action button was disappearing behind the safari nav bar on an iphone. I tried using svh to keep it stable but dvh is still my go-to for landing pages where you actually want that full viewport look.

08a7b No.2418

>>2417
did you find that svh actually fixed the layout jump or did it just leave too much white space at the bottom?



File: 1794989337475.jpg (132.16 KB, 733x1100, img_1794989328819_qtx0i8vo.jpg)ImgOps Exif Google Yandex

8c44d No.2398[Reply]

been seeing too many people starting with desktop styles and trying to strip things away for mobile. it's a nightmare headache when you're fighting specificity just to hide a massive sidebar on a phone. i prefer building the mobile layout by default and only adding complexity as the screen gets wider. you basically just wrap your desktop-only stuff in a min-width block so it doesn't even touch the small screens.

@media (min-width: 768px) {.sidebar {display: block;}.main-content {margin-left: 250px;}}


it keeps the base stylesheet extremely lightweight for actual mobile devices. if you're working on a project that's already stuck in max-width mode, i get why you'd stick with it but switching to min-width is cleaner long term. do you guys actually bother refactoring old max-width sites or do you just patch them?

8c44d No.2407

File: 1795128315787.jpg (99.12 KB, 1300x940, img_1795128300685_9gqlet5f.jpg)ImgOps Exif Google Yandex

I just patch them. Refactoring a legacy site with half-baked max-width queries sounds like a __total waste of time_

8c44d No.2416

>>2407
patching is all anyone does because touching a legacy codebase is suicidal. i tried refactoring one last month and ended up fighting
!important
flags for three days straight. the mobile styles were basically just a graveyard of
display: none
overrides that broke everything once you hit a tablet breakpoint. if you're stuck in max-width hell, just keep your head down and write more specific selectors. i'd rather deal with bloated css than spend a week untangling a spaghetti mess of media queries. tbh it's easier to just add a new class than try to fix the old one



File: 1794903728391.jpg (189.12 KB, 1024x545, img_1794903721726_f6q1lmj4.jpg)ImgOps Exif Google Yandex

be2d3 No.2394[Reply]

I'm getting tired of trying to force consistent row heights with grid-template-rows: repeat(3, 1fr) when the content is uneven. It's much easier to just set a specific aspect ratio on the child elements so they don't collapse or stretch weirdly when the column width changes.

be2d3 No.2414

File: 1795250241564.jpg (127.29 KB, 1218x1044, img_1795250227370_jf21m8dw.jpg)ImgOps Exif Google Yandex

>>2394
I tried that on a dashboard build last month and it broke when someone added too much text to a card. The aspect ratio stayed fixed but the content just spilled out of the container, which looked completely broken. Did you account for how long those rows might grow if the user scales their font size?



File: 1795234151706.jpg (155.64 KB, 1024x1024, img_1795234142850_aoudoall.jpg)ImgOps Exif Google Yandex

c22e5 No.2413[Reply]

i'm tired of seeing people use media queries to adjust local spacing. it's basically lazy broken logic when you move a card into a narrow sidebar and the padding stays huge. i've started wrapping everything in a container just so the component actually knows its own limits.
.card {container-type: inline-size;}

it makes components actually portable instead of tied to the whole viewport width. do you guys still use media queries for internal element spacing?


File: 1794654193229.jpg (51.58 KB, 682x1024, img_1794654184374_lg9qu3ol.jpg)ImgOps Exif Google Yandex

85114 No.2381[Reply]

someone messed up the global css again so now my custom slider is basically unusable on mobile because the browser keeps trying to pan the whole page. just add this to your touchable elements if you're doing something weird with gestures and don't want the viewport jumping around like crazy. it's a total lifesaver when dealing with buggy vanilla js implementations.

.slider-track {touch-action: pan-y;}

b77e4 No.2402

>>2381
spent three hours last week debugging a client's landing page because their horizontal carousel kept triggering the whole page bounce. thought i broke the event listeners or something. ended up being exactly this. pan-y is basically the only way to keep sanity when you aren't using some massive library that handles all the edge cases for you. it's such a pain when global styles wreck your specific interactions like that. why do people still think they can just override everything without checking mobile behavior?

b77e4 No.2404

File: 1795098802392.jpg (88.43 KB, 760x904, img_1795098788060_oxndb2y4.jpg)ImgOps Exif Google Yandex

>>2402
>pan-y is basically the only way to keep sanity

I tried using
none
once on a map component and it totally killed the ability for users to zoom in or out with two fingers. It's definitely a fine line between fixing your slider and accidentally breaking the entire browser interaction model for that element. Just don't forget to check if they need pinch-to-zoom too or you'll get angry emails.

b77e4 No.2406

File: 1795127689308.jpg (85.8 KB, 1000x477, img_1795127675554_wdo12ovu.jpg)ImgOps Exif Google Yandex

>>2381
>>2404 I don't think using none is really the move there. You'd probably want to use pan-x or something specific so you don't kill the zoom functionality entirely ⚠



File: 1794701055704.jpg (71.15 KB, 1200x780, img_1794701044949_0ji9o34l.jpg)ImgOps Exif Google Yandex

c0d91 No.2384[Reply]

i tried using viewbox units to scale icons inside flex containers instead of setting fixed pixel dimensions. it works fine until you hit a weirdly sized viewport where the icon ends up looking tiny or massive compared to the text next to it. i'm back to using rems for the svg width so it actually respects the font size. do you guys stick to rems for icons or just hardcode the pixels?

cee17 No.2386

>>2384
rems are better for alignment but i just use em so they scale with line-height naturally. fixed pixels are death a nightmare once you hit high dpi displays

0eac5 No.2395

>>2386 em is definitely easier when you're working inside components with varying font sizes. I usually just set the width to 1em and let the height follow via aspect-ratio.

0eac5 No.2403

File: 1795092175649.jpg (87.52 KB, 1200x799, img_1795092160794_sclmkv3a.jpg)ImgOps Exif Google Yandex

>>2395
>I usually just set the width to 1em and let the height follow via aspect-ratio.

the em approach is way smoother for accessibility since it keeps everything in sync when users bump up their browser's default font size, though i've noticed that some poorly optimized svgs with weird internal padding can make the alignment look perfect a little bit off even with an aspect-ratio set.



File: 1795069206480.jpg (37.25 KB, 1000x680, img_1795069168325_yyrxfvdq.jpg)ImgOps Exif Google Yandex

d1d80 No.2401[Reply]

stop using px for anything related to spacing if you actually care about zoom levels. i'm tired of seeing people hardcode 20px padding when it just breaks everything once the user scales their text up. try swapping out fixed values for 1rem or even better, use ch units for max-width on text containers so the line length stays readable regardless of font size.
>it works fine on my chrome devtools
that's not a real test. if you aren't testing with 200% zoom, you're basically just making pretty broken layouts. it's a small change but makes a massive difference in accessibility.


File: 1795026077607.jpg (147.33 KB, 900x1132, img_1795026067750_23poavlz.jpg)ImgOps Exif Google Yandex

6cdd8 No.2399[Reply]

most devs just throw a generic image at the client and call it a day. im seeing way too many sites serving 1x assets to retina displays because they're lazy with srcset. try testing your heaviest hero images on an actual iphone today instead of just using chrome devtools.
<img src="low-res.jpg"srcset="high-res.jpg 2x"alt="hero">


File: 1794867003595.jpg (304.66 KB, 1024x1024, img_1794866995203_q3ymmkm7.jpg)ImgOps Exif Google Yandex

31ef5 No.2393[Reply]

everyone thinks they're being clever with clamp(1rem, 5vw, 3rem) but it's just making debugging a nightmare. i'm looking at a mobile view and can't tell if the font is too small because of the math or some weird inherited style. most people forget to check how it looks on tiny screens where that middle value basically breaks everything.
>it scales perfectly across all devices
no it doesn't, it just hides the mess until you actually test it on a real device. if i see one more complex calc inside a font-size property i might lose it. stick to media queries and just set the actual values. tbh it's way easier to maintain than some magic formula that nobody can read at 2am


File: 1794501172511.jpg (62.03 KB, 1200x780, img_1794501164850_jjcvg2wv.jpg)ImgOps Exif Google Yandex

f1f50 No.2371[Reply]

tired of recalculating every single breakpoint whenever someone changes the base font size. switching everything to em makes it much easier to scale the whole layout at once without breaking the grid.
>everything breaks when you change the root font size
it's honestly a mess when using px for queries because you end up with a thousand lines of redundant overrides. just use em and be done with it.

060fc No.2387

File: 1794724727835.jpg (147.92 KB, 1000x1000, img_1794724713172_20rs2zf9.jpg)ImgOps Exif Google Yandex

>>2371
Scaling everything at once sounds like a recipe for disaster when users have custom browser settings. If someone bumps their default font up, your media queries will trigger way too early and leave you with a broken layout. I'd rather stick to px for the breakpoints so the container widths stay predictable regardless of the text size.

060fc No.2389

>>2371
>>2371 just clamp your min and max values instead of relying on pure em shifts for everything. works great for fluid typography but sucks if you're trying to hard-code a specific grid column width that can't wiggle. helps avoid the layout collapse when users mess with their browser settings too

060fc No.2391

File: 1794788451491.jpg (208.52 KB, 1024x1024, img_1794788435653_i72lf7p0.jpg)ImgOps Exif Google Yandex

>>2389
>helps avoid the layout collapse when users mess with their browser settings too
clamp is fine but i tried it on a dashboard project once and the sidebar just kept overlapping the main content area because of how the math worked out. tbh em breakpoints are way less headache for my side projects even if they act weird sometimes.



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 ]