Good problem to solve, but this particular solution is a fast path to hell for everyone involved.
You just can't scale text size independently of layout and interface. The size of the text is fundamentally related to the structural layout of the page. The number of columns, the size of images, the relative placement of buttons and UI elements -- it's all inextricably tied to the size of the text.
Good news is that we already have a solution for this: responsive design, aka page zoom. Every serious site already gracefully handles a wide range of viewport widths. When you zoom in, you are simply simulating a narrower viewport width. This type of constraint and flexibility is already well tested. Zooming in makes the text bigger. And, zooming in makes the layout adapt to a single column when that's all that will fit. It all works harmoniously together, because we test and accommodate for all viewport sizes, which is the same as all zoom levels.
The proposal at hand to scale text alone is bad for everyone. Developers now have a geometric set of permutations to test. What about an ultra-wide viewport with large text? What about a small viewport with large text? What about a wide viewport with small text? It's so much that it won't make business sense to invest in all of the testing, and all of the design and implementation work to accommodate all of the cases. And so, it will be bad for end users who will set their text size to their preference, and then find that actually usability and readability are now worse.
In the end the answer is simple: when users set their text size to be larger in the OS, browser vendors should increase the default zoom in browsers. This is already how it works on Windows, and it is definitely the best path to happiness for all.
> how do we get large text to scale at a lower rate than body text. It's great that the body text can scale up from 16px to 32px, but does heading text need to scale up from 32px to 64px? It's already huge. If you have any thoughts, please do let me know!
Android 14 has this in non-linear text scaling -
> To prevent large text elements on screen from scaling too large, the system applies a nonlinear scaling curve.
I wish Android apps were better citizens when it comes to accessibility. My friend has very poor eyesight and I set his phone up to make things bigger for him, but most of the apps are a horrible janky mess of overlapping everything.
(Also "light mode" apps are painful for him to view, and most of the major apps have skipped out on offering dark mode)
After reading it, I'm still left asking why browsers can't do this for the user on mobile as well. User preferences should be respected by default and not require an opt-in step from the webmaster of all parties.
I tried using a bunch of zoom on my most frequented sites and they mostly worked just fine. At my day job everything is tested to work at 200% zoom as a baseline.
I really don't think we should bend over backwards to cater to accessibility offenders such as LinkedIn.
What we need on mobile is the ability to pinch zoom on images to scale the page and pinch zoom on text with font scaling. This needs to work universally without depending on developers to include a CSS magic incantation. It's already ridiculous that a user agent will refuse to zoom at all because of the page design.
I dont' follow. The argument is that browsers can't respect a user's text size settings because LinkedIn has a terrible design that limits it to using less than 1/3 of the available screen space.
Just one more reason I think the web is a dumpster fire, I guess.
This is a terrible idea. This meta tag will get copied and pasted by people who don't know what it means and the site will look just fine to the web developer, but whenever someone with larger text size tries to use the site it will be broken.
In other words this is going to make things worse for exactly the group of people it purports to help.
> how do we get large text to scale at a lower rate than body text
Express the header text size with CSS calc function with a sum of em (relative) and px (absolute) values. Depending on their ratio, element will be more or less scalable. 100% em -> scales like body text, 100% px -> no scaling.
> Text scaling doesn't need to replicate zoom. If you use font-relative units like em and rem everywhere that you set a length, everything will scale up the same way as browser zoom.
> Instead, only use font-relative units on things like text, images and icons. You don't need to use it on properties like margin, padding or gap.
> If you do that, there's more room for the content, which is especially important on portrait mobile devices.
So, for margin and padding, one should use px? Or is there a better unit?
Old timers remember that this was the old way of doing things, until at some point they changed to do full-page zooms, to the joy of developers.
Now they're adding support for this again, but `:root{font-size: 16px}` breaks it, so you're guaranteed to see that in CSS resets everywhere because there's nothing that managers hate more than inconsistencies
"QA user X mentioned that the text overflows when text zoom is at 300%. Fix it."
I didn't even realise it was a issue util now. Thinking about it, this should have been done years ago. never the less this is a great step forward and hope get's implemented soon.
21 comments
[ 1.8 ms ] story [ 44.6 ms ] threadYou just can't scale text size independently of layout and interface. The size of the text is fundamentally related to the structural layout of the page. The number of columns, the size of images, the relative placement of buttons and UI elements -- it's all inextricably tied to the size of the text.
Good news is that we already have a solution for this: responsive design, aka page zoom. Every serious site already gracefully handles a wide range of viewport widths. When you zoom in, you are simply simulating a narrower viewport width. This type of constraint and flexibility is already well tested. Zooming in makes the text bigger. And, zooming in makes the layout adapt to a single column when that's all that will fit. It all works harmoniously together, because we test and accommodate for all viewport sizes, which is the same as all zoom levels.
The proposal at hand to scale text alone is bad for everyone. Developers now have a geometric set of permutations to test. What about an ultra-wide viewport with large text? What about a small viewport with large text? What about a wide viewport with small text? It's so much that it won't make business sense to invest in all of the testing, and all of the design and implementation work to accommodate all of the cases. And so, it will be bad for end users who will set their text size to their preference, and then find that actually usability and readability are now worse.
In the end the answer is simple: when users set their text size to be larger in the OS, browser vendors should increase the default zoom in browsers. This is already how it works on Windows, and it is definitely the best path to happiness for all.
... he writes, on a site that forces horizontal scrolling on mobile.
If I make HN font readable size on portrait phone using just zoom, the page is 4 screens wide.
Android 14 has this in non-linear text scaling -
> To prevent large text elements on screen from scaling too large, the system applies a nonlinear scaling curve.
https://developer.android.com/about/versions/14/features#non...
(Also "light mode" apps are painful for him to view, and most of the major apps have skipped out on offering dark mode)
I tried using a bunch of zoom on my most frequented sites and they mostly worked just fine. At my day job everything is tested to work at 200% zoom as a baseline.
I really don't think we should bend over backwards to cater to accessibility offenders such as LinkedIn.
Just one more reason I think the web is a dumpster fire, I guess.
In other words this is going to make things worse for exactly the group of people it purports to help.
Express the header text size with CSS calc function with a sum of em (relative) and px (absolute) values. Depending on their ratio, element will be more or less scalable. 100% em -> scales like body text, 100% px -> no scaling.
So, for margin and padding, one should use px? Or is there a better unit?
Old timers remember that this was the old way of doing things, until at some point they changed to do full-page zooms, to the joy of developers.
Now they're adding support for this again, but `:root{font-size: 16px}` breaks it, so you're guaranteed to see that in CSS resets everywhere because there's nothing that managers hate more than inconsistencies
"QA user X mentioned that the text overflows when text zoom is at 300%. Fix it."