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

File: 1792931697402.jpg (195.21 KB, 1024x1024, img_1792931689790_d4i0k8t4.jpg)ImgOps Exif Google Yandex

2ec01 No.2282[Reply]

been trying to center a simple nav but some idiot set min-width: 100% on the child elements. now it's just overflowing everything and ignoring the justify-content: center property entirely.
>it'll just wrap naturally if you don't overconstrain it
tbh it's basically impossible to debug when people treat flexbox like a magic box that fixes their bad sizing logic


File: 1792437130425.jpg (201.12 KB, 1024x1024, img_1792437122314_u91h4twf.jpg)ImgOps Exif Google Yandex

8a876 No.2255[Reply]

been seeing way too many people ditching aspect-ratio in favor of that old padding-top hack. it's honestly such a messy workaround when you have actual modern support to rely on. i was looking at this legacy codebase today and it's just full of:
.card {height: 0;padding-bottom: 56.25%;}

it makes the css so hard to read when you're trying to figure out the actual height of an element. i don't get why people are still clinging to this stuff for everything. if you aren't targeting prehistoric browsers, there's no reason to deal with that math. anyone still using the padding trick for anything other than extreme edge cases?

8a876 No.2275

>>2255
>if you aren't targeting prehistoric browsers, there's no reason to deal with that math

still gotta use it for some client dashboards on safari 13 or 14. can't just ignore the spec support gap for a living. i usually just wrap the whole thing in a utility class so the mess stays out of my main component files. keeps the
padding-bottom
logic away from the actual content styles. tbh it's less about hating math and more about not breaking the layout for users on old ipad minis.

8a876 No.2281

File: 1792925993303.jpg (283.79 KB, 1024x1024, img_1792925943684_31ojbojn.jpg)ImgOps Exif Google Yandex

>>2275
The utility class idea is smart for keeping things clean. I've had to do something similar because our legacy marketing site still has some weird dependencies on older mobile browsers. It's a pain when you have to use relative percentages just to keep the layout from collapsing.



File: 1792888840439.jpg (216.74 KB, 1024x1024, img_1792888831105_9dji2a7o.jpg)ImgOps Exif Google Yandex

6aeb2 No.2279[Reply]

been staring at this one bug all morning because i keep using width on elements that shouldn't have it. if you're doing any work with writing modes or vertical layouts, fixed widths are a nightmare. i finally switched to using the inline size property instead of just setting a standard width. it's much cleaner when things rotate.
>width: 300px;

that old way is such a headache once you move away from horizontal text. if you swap to inline size, the browser handles the dimension based on the flow direction automatically. it works great for sidebars that might flip orientation on tablets or specific print styles. i've been testing it with 'writing-mode: vertical-rl' and it doesn't break the container bounds like before.

.sidebar {inline-size: 250px;block-size: auto;}


it basically keeps your dimensions tied to the text flow. i still forget it exists sometimes. anyone else still relying on width for everything?


File: 1792761176755.jpg (152.12 KB, 1024x1024, img_1792761167431_88027e2j.jpg)ImgOps Exif Google Yandex

21a53 No.2272[Reply]

been messing with this side nav for an hour and it's driving me crazy. i changed the layout to a column stack for mobile but now the padding on the main content area looks totally broken. i tried setting a specific percentage for the left margin but that just makes things look weird on tablets.
>it just shifts everything to the right
the spacing is totally inconsistent when the screen width hits 768px. i even tried using a media query to reset it to zero
@media (max-width: 768px) {.content {padding-left: 0;}}

but now the text is hitting the very edge of the screen and looks like a mistake. anyone else dealt with this when switching from row to column?


File: 1792559557463.jpg (132.01 KB, 1024x1024, img_1792559549519_26ng6tqv.jpg)ImgOps Exif Google Yandex

a3660 No.2261[Reply]

I noticed some weird lag on our primary call to action button during testing on older Android devices. It felt like the click was delayed by a split second after the tap. I realized the browser was still waiting to see if the user was actually trying to scroll or zoom instead of just tapping. Adding touch action none to the css for those specific interactive elements fixed it immediately. Now the tap responds instantly without that weird hesitation. It is a small change but makes a huge difference in how snappy the interface feels.

a3660 No.2268

>>2261
>Adding touch action none to those specific interactive elements fixed it immediately.

just be careful with that on larger tap targets. i used a similar trick for a cafe site's menu button but broke the ability to pinch-zoom on the whole container, which pissed off my client. stick to applying it only to the actual button element and leave the parent div alone so people can still zoom in on text.

a3660 No.2269

>>2268
>i used a similar trick for a cafe site's menu button but broke the ability to pinch-zoom on the whole container
Applying it to just the button won't stop the parent container from being unzoomable if you messed up the CSS properties higher up the tree.

a3660 No.2271

>>2269 if you're messing up the whole tree then your selector logic is probably garbage anyway. just use touch-action: manipulation and call it a day



File: 1792192523161.jpg (131.64 KB, 1024x1024, img_1792192513883_j8ttlxwt.jpg)ImgOps Exif Google Yandex

c6a7e No.2234[Reply]

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



File: 1792681945594.jpg (67.82 KB, 1000x780, img_1792681937229_mnpbdg7a.jpg)ImgOps Exif Google Yandex

84e74 No.2266[Reply]

the vh unit is totally broken when the keyboard slides up on ios. it's like everything just breaks and shifts the whole footer way too high. tried using dvh but the layout still jumps around like crazy when i focus an input.
height: 100vh;overflow: hidden;

it's driving me insane lmao


File: 1792645142509.jpg (206.29 KB, 1024x1024, img_1792645135676_ejkuhh1f.jpg)ImgOps Exif Google Yandex

9d268 No.2265[Reply]

i've been trying to use dense for this gallery but the layout looks totally broken when images are different sizes. it's great for filling gaps but now my content order is a complete mess. anyone actually find a way to make it work without losing the logical reading flow?


File: 1792076697336.jpg (103.89 KB, 1080x720, img_1792076688909_4hsf5v4a.jpg)ImgOps Exif Google Yandex

e31bc No.2226[Reply]

trying to get my cards to align their headers perfectly but the content height is all over the place. even with subgrid enabled on the child items, it's not grabbing the row tracks from the parent correctly. i tried setting the grid-template-rows to match the main container but everything just collapses.
.card {display: grid;grid-template-rows: subgrid;}

tbh it feels like the browser is just ignoring the tracks when the parent has dynamic content. i've tried setting a fixed min-height on the rows but that's a terrible hack for a fluid layout. some weird overlap happening with the footer too.

e31bc No.2252

>>2226
the footer overlap is such a classic headache. sounds like your parent grid is missing auto rows. if you don't explicitly define how the tracks expand in the main container, subgrid has nothing to inherit. i ran into this last week on a dashboard project where everything just stacked on top of each other. check if you actually have grid-template-rows: repeat(auto-fill, minmax(.)) or something similar on the container. without that, there are no actual tracks for the child to latch onto. it's basically trying to align to nothing.

e31bc No.2254

File: 1792430136069.jpg (250.47 KB, 1024x1024, img_1792430121934_f6yu66e2.jpg)ImgOps Exif Google Yandex

>>2252
>if you don't explicitly define how the tracks expand in the main container, subgrid has nothing to inherit

unlikely to be an issue with auto rows here. if the parent is just using implicit tracks, subgrid still pulls from those existing tracks. @2226 check your grid-template-rows on the. card itself though. if you have any extra row definitions in the child that aren't part of the subgrid setup, it breaks the alignment for everything else. usually i see people accidentally adding a
1fr
or something to the card container which messes up the inheritance from the parent tracks. just stick to the bare minimum on the child so it doesn't try to override the parent's track sizing.

e31bc No.2257

>>2252
>if you don't explicitly define how the tracks expand in the main container, subgrid has nothing to inherit

I had this happen when I was building a pricing table. The parent grid needs
grid-template-rows: auto
or specific sizes for the rows you want shared; if it defaults to just stacking implicit tracks, the child won't find anything to latch onto. You might also need to check if your card has any
padding
or
margin
messing with the alignment of those inherited tracks.



File: 1791911186923.jpg (114.59 KB, 1024x1024, img_1791911178614_ibc995tl.jpg)ImgOps Exif Google Yandex

bf8eb No.2218[Reply]

i'm so tired of seeing people jump straight to media queries just to fix a tiny bit of internal spacing. it makes no sense when you've got a component that lives in both a sidebar and a main content area. if the container is narrow, the padding should shrink regardless of the viewport size. i've been using @container for months now and it's much cleaner. you don't end up with this massive mess of breakpoints that only apply to one specific element.
>it works everywhere regardless of screen size
that's literally the point of a component-driven workflow. if you aren't using them yet, you're basically just making life harder for yourself. it's not that hard to learn. i hate seeing codebases where every single margin adjustment is tied to the global window width.
@container (min-width: 300px) {.card {padding: 2rem;}}

it's just better logic for modern layouts. what's your go-to strategy for handling component padding in dense grids?

bf8eb No.2240

File: 1792264872215.jpg (120.56 KB, 1024x1024, img_1792264856500_okpvgwkv.jpg)ImgOps Exif Google Yandex

>>2218
>if you aren't using them yet, you're basically just making life harder for yourself.

Spot on. I hate when people ignore the container and end up with broken kerning because they're trying to force a specific font size via viewport units instead of letting the component breathe. It makes my eyes bleed when the letter spacing looks totally wonky just because someone didn't bother setting a proper container threshold for their typography scales.

bf8eb No.2256

File: 1792444864208.jpg (139.68 KB, 1024x1024, img_1792444848603_ve888shq.jpg)ImgOps Exif Google Yandex

>>2218
>if you aren't using them yet, you're basically just making life harder for yourself
do you still use a polyfilled fallback for the older safari versions or just let it break?



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