3 ms·
I think you have some good points, but others just don't make sense. > you don't know the font metrics of that are and then it turns out that stuff breaks beca
by kevincox 3y ago
I think you have some good points, but others just don't make sense.
> you don't know the font metrics of that are and then it turns out that stuff breaks because the font is tons wider or whatnot
Your site breaks so you make the text too small for the user to read? Browsers also have accessibility options to override website's custom fonts. So your site is broken either way, best to fix it an let the user have their preferred experience than mitigate it for some users and leave other users broken.
> This is why browsers have zoom, which solves the problem without tons of downsides
Zoom is great as well. But what downsides does it avoid? If the user wants their text wider your layout that assumes a max width for text is still going to break. The main downside that it avoids is web developers assuming that 12px text is easy to read.
I could argue that zoom is a hack to mitigate websites that use px for things that need to be readable. It scales px, which fixes a problem that wouldn't exist in the first place if the developer just used em.
> All browsers
Not all browsers. But most common browsers.
But I think at the end is what is the point of all of this? You are dismissing an approach with clear upsides without arguing what advantages the px approach brings. Sure, maybe most browsers are 1rem == 16px and maybe zoom is a good enough mitigation. But what advantage do you get by relying on this? I think you are right that browsers have done lots of good work to mitigate sites that set the body text to 12px, but it still seems that doing that doesn't have any advantages over just using em.