3 ms·
Why is it not a thing to query the literal screen size in cm? Instead we have to work with fake pixel measures and scaling factors and a whole bunch of bullshit
by bruce343434 3y ago
Why is it not a thing to query the literal screen size in cm? Instead we have to work with fake pixel measures and scaling factors and a whole bunch of bullshit and edge cases.
- dontlaugh 3y agoOr even more accurately, arcseconds at typical viewing distance. This would cover TVs and phones with the same measurement.
- pjc50 3y agoFor desktop systems the EDID data is not always reliable. Besides, you don't want the screen size, you want the viewport size and the DPI.
- bruce343434 3y agoI think I want the arc length of the viewport. Fonts should have a minimum size based on that, certainly not 11pt or whatever.
- Wowfunhappy 3y ago> Besides, you don't want the screen size, you want the viewport size and the DPI. ...I can think of at least one case where you really would want the screen size, although perhaps it's specialized enough to warrant a separate API. As a user, I have often wished there was a reliable way to view an image on the web at "actual size". Examples would include purchasing band-aids on Amazon, or reading a Wikipedia article about insects. As far as I know, there's currently no good way for websites to offer this, and there really should be!
- chrismorgan 3y agoDevice diversity is such that that’s useless for general content. People use devices at less than arm’s length and at multiple metres away. Firefox used to have an experimental resolution-independent millimetre unit mozmm, but devices simply don’t tend to expose what you need so most of the time it wasn’t accurate. Browser makers considered standardising such a thing, but consensus was that (a) it wasn’t possible to make it accurate far too much of the time, and (b) it’s almost never what you want anyway (about the only legitimate uses: simulating a ruler, and physically-accurate sizing for comparison with physical artefacts; certainly never on general-purpose web pages), so it was just dropped.
- kevincox 3y agoIt's also worth noting that CSS "pixels" are not real pixels. There are somewhat scaled to the relative size. But even better you can set your breakpoints in terms of `rem` which is the user's default font size. This usually gives a pretty good intuition to how big UI components need to be to be easily readable to the user. This can also handle differences such as a user with great vision on a small device (they set a tiny font to get the most of the limited screen space) compared to a user with limited vision on a large screen far away (their text size may be cranked high so that they can see it).
- zuprau 3y agoSeems logical, but as a user, I can already choose the size of the content of the screen, I don't want you to choose it for me. So we all agreed that "16px text" is ok and we started designing the world around that. As a practical example: my iPhone lets me chose between "native" and "scaled up" sizing. This affects the whole OS including the browser. Where does your "cm" measurement fit in that? Do you want to override my (user) choice? Additionally, every browser lets me scale the content up and down between 50% and 200%, so "cm" is broken once more. "pixels" haven't been "pixels" for a very long time, and that's ok, they're now just a logical unit.