3 ms·
I think the actual problem that is being described is mostly solved by the device-independent pixel, where the size of `16 px` varies based on the device and do
by tester89 6y ago
I think the actual problem that is being described is mostly solved by the device-independent pixel, where the size of `16 px` varies based on the device and doesn't actually correspond to 16 physical pixels (imagine that on a Retina display!).
I think the more interesting thing we should work towards is achieving metric typography—not just converting to millimetres, but actually measuring font-size based on x-height rather than total height.
- kmeisthax 6y agoNo, it isn't. Physical pixels (as in, pixels being a physical measurement) decouple the pixel density from the size of the layout, so that things don't get smaller when you buy a higher-resolution monitor. What the article is talking about is changing the physically-valued font size to maintain, say, a particular line length. For example, if you have a blog site, you probably want to have your content in one column with line lengths around, say, 50-70 characters. This is because very long lines are difficult to keep track of and short lines tire your eyes. But you also want your content to fill the screen. If we had some kind of a constraint solver in CSS, you could say something like that and have the stylesheet resolve into something that changes the font size based on the viewport width, because that's the undetermined variable when you fix line length and box width. However, we don't have that, so the author instead has to explicitly say, "make the font size 1% the width of the viewport".