3 ms·
Device 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
by chrismorgan 3y ago
Device 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).