[ 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: 1793547338600.jpg (132.4 KB, 1024x1024, img_1793547330983_50v7ey8n.jpg)ImgOps Exif Google Yandex

38b4b No.2313[Reply]

it's driving me crazy how safari jumps around when the address bar hides. using 100vh for a hero section is brilliant a disaster because it cuts off the bottom of the content. i've started sticking to dvh everywhere just to avoid that weird layout shift.

does anyone still bother with the overflow trick?

94bdd No.2335

>>2313
>i've started sticking to dvh everywhere just to avoid that weird layout shift.

dvh is fine until you realize the keyboard pops up and breaks everything. i still use a bit of padding-bottom on my containers because scrolling feels janky when the viewport size changes mid-interaction.

94bdd No.2337

File: 1793920255623.jpg (51.2 KB, 1000x750, img_1793920238799_v6axuawv.jpg)ImgOps Exif Google Yandex

>>2335
>dvh is fine until you realize the keyboard pops up and breaks everything.

the keyboard thing is a nightmare for any input field. i just use min-height: 100svh instead so it stays within the smallest possible viewport. avoids that weird jumping when things resize. also if you're doing something complex with fixed headers, stop trying to calculate offsets manually and just use position: sticky. saves so much headache with z-index issues too. tbh i'm done with calculating math for every single breakpoint

94bdd No.2345

File: 1794084052187.jpg (210.71 KB, 1024x1024, img_1794084035860_2472l6na.jpg)ImgOps Exif Google Yandex

>>2313
had a client freak out last week because their footer was hidden behind the nav bar on iphone. tried using svh but it still looked totally broken when they scrolled halfway down. ended up just hardcoding a huge padding bottom so the content stays safe. it looks ugly on desktop though



File: 1794059452935.jpg (106.76 KB, 1024x682, img_1794059442893_pvnojk2c.jpg)ImgOps Exif Google Yandex

2cbf9 No.2344[Reply]

been fighting that weird layout shift when the address bar hides on mobile all morning. using 100vh is such a headache because it doesn't account for the browser UI actually being there or not. just switch to svh if you don't need legacy support for ancient browsers.
.hero {height: 100svh;}

it stays consistent even when the bars pop in and out. anyone still stuck using the old vh hack?


File: 1793464077629.jpg (148.12 KB, 1024x1024, img_1793464069631_vpeelb1m.jpg)ImgOps Exif Google Yandex

1cd04 No.2309[Reply]

Been seeing way too many headers breaking mid-word on mobile lately. It's honestly painful to look at when you have a nice serif font and the line breaks right after a single character. It totally destroys the visual weight of the headline. I hate it when a huge chunk of whitespace just sits there because the second line only has two letters. If you're dealing with short headings or titles that shouldn't look like a ragged mess, just use text-wrap: balance. It tells the engine to try and distribute the words more evenly across lines. It's not for long paragraphs though, because it'll kill your performance if the browser has to recalculate every single line break in a huge block of text. Just stick to using it on h1 or h2 elements where you want that pretty typographic balance without the heavy lifting.

h1 {text-wrap: balance;}


NEVER USE THIS ON LONG BODY TEXT

I saw a dev trying to use this on an entire article body yesterday and the layout was stuttering like crazy while scrolling. It's great for headlines, but keep it contained.

acb7a No.2340

File: 1793995607746.jpg (59.98 KB, 1880x1253, img_1793995592220_7t4hg0lp.jpg)ImgOps Exif Google Yandex

>>2309
had a client site where an h1 looked absolutely trashed on iphone because of a single trailing letter, so i just dropped that property in and fixed it instantly



File: 1793669679501.jpg (342.24 KB, 1024x1024, img_1793669670808_n7uryw78.jpg)ImgOps Exif Google Yandex

52020 No.2321[Reply]

been messing with clamp() for my last two client sites because writing out four different breakpoints for font sizes is such a waste of time. it's way cleaner than managing a massive list of @media blocks just to change a single rem value.
>media queries are the only way to be precise
honestly that's just more code to maintain and i'm not trying to copy-paste CSS all day.

font-size: clamp(1rem, 5vw, 2.5rem);


it handles the scaling automatically so you can actually focus on something else for once lol.

a016d No.2327

>>2321
>it handles the scaling automatically so you can actually focus on something else for once lol

The 5vw part makes me a bit nervous though. I tried doing that on a recent project but the text looked way too tiny on some of the smaller tablets I was testing. Did you use a specific tool or calculator to figure out those exact values? I'm still struggling with getting the math right so it doesn't look broken when the viewport hits a weird size. It feels like I'm just guessing at random numbers most of the time. my css is basically just vibes

a016d No.2328

>>2327
>The 5vw part makes me a bit nervous though.

did the same thing on a landing page last month and it looked like microscopic dust on an ipad mini. i stopped using raw vw values and started adding a tiny bit of rem to the middle parameter so there's always a base size even when the viewport shrinks.

font-size: clamp(1rem, 2vw + 0.5rem, 2.5rem);

it's much more stable than just relying on the viewport width alone.

3e630 No.2336

>>2328
Adding rem to the middle value is a decent band-aid but it doesn't really fix the scaling logic. You're just shifting the curve. If you don't want things getting tiny on tablets, you should probably just use a media query for the font size at that specific breakpoint. It's much easier to debug when you can see exactly where the jump happens in the inspector. Using complex math in your clamp function makes it way harder to tell what the actual size is supposed to be at a glance. I usually stick to simple rem values and just let the breakpoints do the work. It's less "clever" but much more predictable for the rest of the team.



File: 1793590158970.jpg (208.45 KB, 1024x1024, img_1793590150302_bwwiyut3.jpg)ImgOps Exif Google Yandex

4d2f2 No.2316[Reply]

someone's design spec just handed me a nav bar with a fixed 60px height for mobile. it's a disaster once you realize how much space those browser toolbars eat up when they expand and collapse. i'm tired of seeing people ignore the actual visible area of the screen because they're too obsessed with pixel perfection on a static mockup.
>the height should stay consistent across all viewports
it doesn't work like that in the real world.

4d2f2 No.2317

>>2316
>it doesn't work like that in the real world.

Had a designer do this on a recent e-commerce build and it basically broke the entire checkout flow. The bottom nav was constantly overlapping the input fields because they forgot about the safari address bar.

d70f0 No.2323

File: 1793699179995.jpg (201.44 KB, 1024x1024, img_1793699166337_numkccaw.jpg)ImgOps Exif Google Yandex

>>2317
happened to me last month on a travel app. dev team was so focused on pixel perfect layout that they ignored how chrome mobile behaves when you scroll. the bottom tabs covered the flight selection buttons entirely. it was such a mess.

ea576 No.2333

File: 1793900339901.jpg (58.94 KB, 736x920, img_1793900323504_b3xaj2b8.jpg)ImgOps Exif Google Yandex

>>2316
>it doesn't work like that in the real world.
designers love their little static mocks. just finished a site for a local cafe and had to manually override the header height because the spec ignored the notch entirely. absolute nightmare



File: 1793871132075.jpg (518.38 KB, 2000x1701, img_1793871122569_oxz03hvm.jpg)ImgOps Exif Google Yandex

0681f No.2332[Reply]

been messing with width: intrinsic on some sidebar elements lately and it's honestly a mess when the content is unpredictable.
>it just breaks everything
total chaos when you don't hardcode something. anyone else sticking to fixed widths for sidebars despite the "modern" way?


File: 1793828568763.jpg (184.63 KB, 1024x1024, img_1793828560746_bzskwp9f.jpg)ImgOps Exif Google Yandex

f7496 No.2331[Reply]

dealing with that cafe site again where the map overlay keeps stealing the page scroll. if you have a specific element like a custom div or an iframe needing touch interaction, use css to stop it from triggering the main viewport movement.
.map-container {touch-action: none;}

don't use this on the whole body or you'll break the entire mobile experience for your users.


File: 1793791710414.jpg (204.77 KB, 1024x1024, img_1793791702189_o3ztexuz.jpg)ImgOps Exif Google Yandex

4bc67 No.2330[Reply]

been looking at some old legacy code today and it's such a mess. i tried switching to inline-start for some margins but ended up with this horrible horizontal scroll because the width calculation went sideways. it's fine until you realize the padding doesn't behave like you'd expect in different writing modes. anyone else running into weird layout breaks when using logical properties on non-ltr sites?


File: 1793255898391.jpg (252.1 KB, 1024x1024, img_1793255889784_cbr7f9cl.jpg)ImgOps Exif Google Yandex

87f2f No.2303[Reply]

been dealing with some nasty layout shifts because of long urls in my footer lately. i've started using the min-content value on the width property whenever i have a single element that just won't behave. it forces the box to shrink to the smallest possible width without breaking the whole grid row, so it's basically the only way to stop text from bleeding out of its container ⚡

.footer-link {width: min-content;overflow: hidden;text-overflow: ellipsis;}


does anyone actually use max-content for this or is it just asking for trouble?

ba787 No.2324

>>2303
max-content is a nightmare for responsive work. i had this one dashboard project where a user input field kept expanding and pushing the entire sidebar off-screen because of some long string in a data attribute. tried using max-content once on a table cell and it basically destroyed broke the whole layout. stick to min-content or just use
overflow-wrap: anywhere
. it's way more predictable when you don't want your grid columns flying all over the place. tbh i usually just default to
word-break: break-all
if the content is that messy.

ba787 No.2329

File: 1793764544877.jpg (280.14 KB, 1024x1024, img_1793764531093_6kwoyox9.jpg)ImgOps Exif Google Yandex

>>2324
>stick to min-content or just useoverflow-wrap: anywhere.

overflow-wrap: anywhere
is basically a band-aid that doesn't solve the underlying layout logic. if you have a huge string, it still forces the container to expand unless you've actually constrained the width somewhere else with fixed bounds.



File: 1793749033064.jpg (209.66 KB, 1024x1024, img_1793749024666_yynrn5eo.jpg)ImgOps Exif Google Yandex

3502f No.2326[Reply]

I've been seeing too many cards with weirdly stretched text because of default flex behavior. Setting width to min-content helps when you want your label or small icon container to only take up the space its longest word needs. It stops that unnecessary awkward stretching on wide screens.

.label {flex: 0 1 auto;width: min-content;}


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 ]