Hacker News new | past | comments | ask | show | jobs | submit login

Equally, I don't like it when websites try to guess what kind of browser I'm in and force me into the mobile experience when I have a window take up half the screen on a 1080p monitor, ... so I guess there's really no easy win for this :(



I think proper media queries breakpoints solve this


This is hard and often done wrong- mobile phones are usually high dpi and have gotten quite large, so it can be hard to distinguish between a large phone and half a desktop screen. Some people get quite annoyed by being bumped into a mobile experience when you resize your window from fullscreen on a laptop.


> This is hard and often done wrong- mobile phones are usually high dpi and have gotten quite large, so it can be hard to distinguish between a large phone and half a desktop screen.

A tablet could be easily confused, or a phone in landscape mode, too, but for a phone in portrait mode this seems a bit hard to imagine, because DPI is taken into account when converting the display width into CSS pixels, so even a phone cramming 1080 or 1440 or whatever amount of physical screen pixels into its display width should still come in at something like 300 to 400ish CSS pixels. Or am I misunderstanding something?


You're right, and it's certainly a solvable problem but one that often is not solved correctly is my point. You may have to also introduce a (nonstandard) viewport tag to prevent mobile browsers from laying out the page at a much higher resolution and then zooming/shrinking on you https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_m... If you don't, you may falsely conclude from manual testing that you need large breakpoints for mobile.

Also, many times mobile breakpoints don't look at the device orientation and pick numbers like 800px, to capture landscape orientation on medium sized phones or something (I'm not sure where this number comes from to be honest). This obviously breaks the two windows side by side case on laptops but is a top result for me if you google the arcane syntax for how to target mobile browsers with a media query.

I am not 100% sure what all the pitfalls are with the current interface, but they exist often enough for me to run into them semi-frequently on smaller laptops.


You're goning to need <meta name="viewport" content="width=device-width, initial-scale=1"> tag for any reactive design with mobile browsers since otherwise the site will look completely different between browsers and browser versions as they use different rules for how to render sites.

The worst part of this is that simple mostly text sites without a fixed-with layout would look perfectly on mobile if this tag was the default but somehow mobile browser vendors thought it was better to hack around sites with table layouts by giving them a larger viewport (but still inconsitently scale the font sizes so you have to zoom in and out to read different parts).


> (but still inconsitently scale the font sizes so you have to zoom in and out to read different parts)

Once you start with the hack of giving non-mobile-compatible pages a larger viewport in order to not break layouts that react allergic when being squeezed into 300-something pixels, what else do you want to do?

Not scaling font sizes at all just gives you either tiny text (if you zoom out to fit the large viewport onto the small mobile screen) or loads of scrolling around if you display the page at 100 % zoom level instead.

And scaling up all text means you end up approximatively just where you started before you started resizing the viewport. It might not be absolutely exactly the same layout breakage as when squeezing an old page directly into the 300 or so pixels available on a mobile phone in portrait mode, but it will be pretty similar.

So that only leaves trying to scale up only the main body of text (which normally isn't that sensitive with regards to scaling up the font size and therefore increasing its size requirements) and leaving alone smaller bits of text like menus, the page navigation etc., which are more likely to be size-constrained and start causing layout breakage if increased by an extraordinary amount.


You have it right.


I don’t understand those people at all. If my browser window is the width of a mobile phone’s screen, than a version of the website designed for that size is exactly what I want!


Right! If you've got a window that narrow, the only way the design will even work or layout correctly is with the "mobile" layout...

The bigger problem is people hiding functionality if you're in the mobile breakpoint. That's an issue: all functionality should be enabled, at least in some way IMO. Mobile should never be a second class citizen :)


There's also a big problem where the mobile layout will tend to make controls huge to present a reasonable size touch target. This is unnecessary on the desktop, and may even result in less information fitting on screen than before switching to the mobile layout.


Thats a fun one to solve!

   @media (hover: none) and (pointer: coarse) {
That allows the dev to select for devices that do not have a mouse and such rely on touch targets, to increase the sizing. I've been implementing this myself recently in our web application, while still allowing us to change the layout to fit the narrow width!

I'm sure there are some devices it doesn't fit perfectly for though. This stuff is capital-H hard.



> capital-H hard

You mean quote-unquote Hard?


I wish.

The implementations for these have some... complications, the device sets we now deal with are huge, and making sure there are no idiosyncratic bugs that creep up when using them is legitimately a fair bit of work.


> If my browser window is the width of a mobile phone’s screen

It's not, is the thing.

I have a 23 inch screen for my 1080p screen. My phone has a 6ish inch diagonal.

When I make a window 960 x 1080, that's still something like 10 inches across and 11 inches tall. It's sheet-of-paper sized. I'm perfectly comfortable reading that as it was designed for a desktop layout.


> I have a 23 inch screen for my 1080p screen. My phone has a 6ish inch diagonal.

Do you sit as close to your monitor as you hold your phone?


I would say that half of my monitor, more accurately, is about the dimensions of an iPad at comfortable viewing distance.

Phones are far taller than half of a 1080p screen.

Half a monitor is: 960 x 1080, or 1:1.125 A iPhone is: 828 x 1792, or 1:2.164

So websites tend to shove a candybar shape into a nearly square sheet of paper and waste a lot of usable proportions for things like controls or hamburger menus.


Not GP, but yeah, about the same? From your phrasing I expect it's how close we hold our phones that differs though.


Not necessarily: the real-world size matters too. Desktop-sized UI is hard to hit on a touchscreen when shrunk; meanwhile mobile-sized UI wastes space when enlarged on a desktop monitor.


Do you also want the version for touch controls?


I also get annoyed when I get bumped to the "mobile" "experience" even when I'm on a smartphone. With reactive design, "request desktop site" generally doesn't work, either.

I really, REALLY prefer desktop mode for almost everything, relying on pinch to zoom.


> With reactive design, "request desktop site" generally doesn't work, either.

It shouldn't, because with proper reactive design therre are no "mobile" and "desktop" versions but only one version that adapts to the viewport size. If you want a larger viewport that should be solved at the browser level by providing the website with a larger viewport. Seems firefox behaves this way while chrome does something weird that increases the viewport a bit but then still "intelligently" scales some text.


Well what if you don’t WANT the interface to change between viewports? We used to use Desktop-style interfaces on 1024x768 displays, or even 640x480. Now we just get a one-dimensional mobile interface when the viewport is smaller than whatever arbitrary threshold is fashionable among designers. It’s incredibly annoying to have interfaces become downgraded (ie hyper-simplified) regardless of what the user requests just because they haven’t kept up with the resolution upgrade treadmill. Pinch and zoom (in BOTH directions) is such a powerful UI tool from the user’s perspective but its usefulness has become completely neutered by insistence on “reactive” design ripping control away from the user.


The worst part is that the other points you could use: DPI, resolution, touch capability... all of this exists on certain laptops now!

But, at least as far as I approach media queries, if you've triggered the mobile breakpoint (well, default CSS as mobile-first is the way we approach it), its because the desktop design we've used literally will break on a browser window that narrow.


Even better: Don't have media queries breaking at some arbitraty widths at all, and have a design, which is responsive for all widths without breaking suddenly, orienting size of boxes depending on the content.


As soon as you have any kind of columns in your layout you need sudden breaks at some points, explicit or not.

I agree that you should prefer flow and size-to-fit but that does not mean that break points are never the right tool.


No, it won't. There is no clear distinction between mobile and tablet first of all.


Orientation and width not enough?


When I pin a browser to the left or right side of one of my monitors, these sites will often go into mobile mode despite the fact that the browser is still wide enough that desktop mode works fine, merely because the window is now taller than it is wide. And I find that incredibly annoying.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: