[ 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: 1792192523161.jpg (131.64 KB, 1024x1024, img_1792192513883_j8ttlxwt.jpg)ImgOps Exif Google Yandex

c6a7e No.2234

i'm losing my mind with this line-height on mobile. i tried using a media query to tighten up the tracking for small screens so the text doesn't look like it's falling apart, but now the descenders are hitting the line below. it looks messy and totally unpolished. i even tried adjusting the letter-spacing via a clamp function but that just makes the kerning feel all wonky on larger tablets. it's fine unbearable when the rhythm is off like this.

@media (max-width: 480px) {p {letter-spacing: -0.02em;line-height: 1.2;}}


has anyone figured out a way to scale the tracking and line-height together without breaking the vertical rhythm?

e7847 No.2237

>>2234
did this exact thing on a fintech dashboard last month and ended up with characters literally overlapping. just use a relative unit for line-height instead of that fixed 1.2 value so it actually breathes.

e7847 No.2258

File: 1792466991903.jpg (286.01 KB, 1024x1024, img_1792466976256_r5syhkxc.jpg)ImgOps Exif Google Yandex

>>2237
i tried using 'calc' with a viewport width variable to tie them together but it gets super weird if you have huge font sizes. maybe try setting the line-height to a unitless value that scales with your clamp function so the descenders stay clear.

e7847 No.2267

>>2258
>try setting the line-height to a unitless value that scales with your clamp function

The unitless part is key because it keeps the ratio consistent regardless of font size changes. I stopped using fixed pixel values for line-heights a long time ago since they're such a pain when you start scaling typography. Just use
line-height: 1.4
and let the browser handle the math relative to whatever your clamped font size ends up being.
it saves so much headache during refactors



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