4 ms·
Um, what's so bad about that?
by Trufa 6y ago
Um, what's so bad about that?
- xfour 6y agoYea, seems like it would center it without much fuss. That might be a bit too big for mobile browsers, so choosing that width might be a bit of an odd choice.
- lhorie 6y agoSome people see `px` and assume it's physical pixels and because they know some devices have different pixel densities, they go complaining about how coding in terms of pixels instead of `em` doesn't account for density, unaware that `px` refers logical pixels[0] [0] https://blogs.perficient.com/2014/12/24/css-pixel-ratio-or-how-big-is-my-phone https://blogs.perficient.com/2014/12/24/css-pixel-ratio-or-h...
- GoblinSlayer 6y agoFirst, that article is about smartphones. Second, even on smartphones, logical or physical, pixels are not related to text, they are related to the screen resolution.
- lhorie 6y agoNot sure what argument you're trying to make; can you clarify? This article is also partially about smartphones (dark mode, responsiveness, etc). Back when `em` was not a thing yet, text was measured in `px`, where 16px was considered to be the "default" size for readability purposes (and `em` sizes are a function of a base value in `px`). Saying that pixels are unrelated to text isn't really accurate, since text obviously occupies space and pixels are a unit of space, and back in the day, expressing layout relationships in terms of pixels was fairly standard.
- GoblinSlayer 6y agoIf the font size is different, em width adapts to that, px width doesn't. Text occupies space in pixels, but not vice versa.
- lhorie 6y agoYes I'm aware of that. But regardless of whether you mean this in the sense of adapting to user stylesheets or the idea that disparate elements' font sizes should relate to each other, they both strike me as maintainability trade-offs that can reasonably go either way. An elitist tone seems a bit unnecessary in that context.
- GoblinSlayer 6y agoThe font size can change due to zoom, which is a must, because 16px is too small text and unreadable.
- lhorie 6y agocmd+"+" has always worked regardless of what unit is used, though?
- GoblinSlayer 6y agoElements measured in pixels (like images) don't change size when text changes size.
- GoblinSlayer 6y agoMax width and font size are wrong. Text isn't measured in pixels.