by zionic · 4y ago · 0 comments
What is SO effing hard about drawing within the screen on web?! I can't tell you the number of times I've seen this issue. Just the other day I saw reddit's sign up form is totally broken on iOS, you have to swap between landscape/portrait multiple times and hope whatever garbage layout engine it uses redraws the button inside the screen.
As soon as you put real data into a website, especially if the website is a CMS that you've handed-off to a _non-technical_ client, it's going to overflow every pretty, grid-based box.
I expect it's fairly rare for the employer of a web designer to give a shit what the site looks like on a phone, which means the designers don't give a shit either.
I see this "we can't afford to test on different resolutions" excuse with games that completely break for anything that is not 16:9 a lot. Don't target a fixed size. Don't target a fixed aspect ratio. Don't target a set of aspect ratios. Make your application responsive - you don't need different devices to test that responsiveness.
[0] https://firefox-source-docs.mozilla.org/devtools-user/index....
But, as you've noticed, with more complex UI (especially modals and toolbars fixed to the screen) it becomes more important that things are built to fit horizontally and vertically. It's not necessarily hard but it does take more thought to work out how things will shrink, grow, scroll, etc.
It’s because the web’s layout primitives don’t compose well. There’s no easy way to say “this is a full-width container and nothing inside it can go off screen.” As an obvious example, any descendant of that container can use fixed positioning and do whatever it wants. But there are subtler examples that are easier to fall victim to. The way to fix this is to built your own higher-level layout primitives and have conventions or tooling to enforce that you compose them only in approved ways.
overflow: auto;
> As an obvious example, any descendant of that container can use fixed positioning and do whatever it wants.Fixed positioning is you explicitly opting out of composability.
> The way to fix this is to built your own higher-level layout primitives and have conventions or tooling to enforce that you compose them only in approved ways.
No, the way to fix it is to look at your DOM and CSS instead of adding more abstractions with broken edge cases on top of your abstractions.