🔍 Search query: "mobile friendly without javascript"

🖥️ Results: "Check out this JS library"

I see.

Follow

@polychrome CSS @media queries mostly, wouldn't mind taking a look if you have a concrete casus?

@f0x had some trouble deciphering how to recognize when a device is mobile using @media queries because it only gives me resolutions and orientation, both of which not really distinct from a PC display :think_unamused:

@f0x I'm probably going to have to give in and use some minimal JS to guess by agent strings.

@polychrome @f0x yeah, if you really need to know specifically mobile vs desktop, media queries won’t give you that, only a heuristic

that said, what specifically makes you need to know device type and not just viewport/resolution? (not an “i think you don’t really need that and i’m going to be a prick about it” question, i’m genuinely curious!)

@alexis @f0x mouse presence, the way the user holds (or doesn't hold) the hardware, it affects usability expectations.

Also the need to make a guess when a system could provide accurate answers annoys me out of principle.

@polychrome @f0x yeah, you’re gonna need user agent analysis or javascript for that, sorry

(also agreed, i guess the idea for the js api/browser designers is that they want to require inspection of specific features to be used, instead of letting jquery chuds go “oh it’s an iphone let’s do some dumb shit” but i mean chuds will be chuds and that’s no reason to forbid subtlety)

@polychrome @alexis I guess (a combination off) @media rules, such as orientation, pointer, hover could give more info.
I wonder why there's not just an @media phone|tablet|desktop tho

@f0x @polychrome could also look at the InputDeviceCapabilities api to see if there are touch input events happening, that plus viewport dimensions might make a start on a fairly good heuristic, especially if you also see device motion events

@f0x @polychrome ...on second thought, motion events are preference (not prompt) gated and default off from ios 12.2 and maybe also on android, because advertisers are scum and why we can’t have nice things, so i guess never mind that one sorry ._.

@polychrome @f0x ...that said, is there a reason not to simply ask the user what she’s using and present the experience matching her answer?

Sign in to participate in the conversation
Pixietown

Small server part of the pixie.town infrastructure. Registration is closed.