Good problem to solve, but this particular solution is a fast path to hell for everyone involved.<p>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.<p>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.<p>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.<p>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.
That's the testing matrix we have to do for iOS and Android apps today. The screen sizes don't go all the way up to ultrawide, but 13" iPad (portrait and landscape) down to 4" iPhone Mini, at every "Dynamic Type" display setting is required.<p>It's not <i>that</i> tough, but there can be tricky cases.
This is supporting something that already exists for native phone apps. My phone has separate options for display size and text size.<p>And so I have it set to have smaller buttons but still a normal-size font.
In addition, desktop Firefox has had support for "zoom text only" for about 20 years or so (can be enabled in settings). It works fine.<p>Don't know about mobile, probably works there too.
Well, it does what it says, if that's what you mean by "works". But I don't think my grandpa is going to be happy with the results.<p>Here's NYT with that firefox "zoom text only" enabled: <a href="https://i.imgur.com/zp7pDW3.png" rel="nofollow">https://i.imgur.com/zp7pDW3.png</a><p>See the chopped "rld" on the left? That's the link to the "World" section. To the left of that <i>off the screen</i> should be the "U.S." section. But there's no horizontal scroll bar or any way to get to it, or any way to even know it exists. Categories spill off the right too, and you can't get to those either. This anti-feature, in the name of accessibility has actually just made things worse.<p>For reference, here's the totally sensible result if you just don't enable "zoom text only": <a href="https://i.imgur.com/Kkd5aOu.png" rel="nofollow">https://i.imgur.com/Kkd5aOu.png</a>
> This is already how it works on Windows, and it is definitely the best path to happiness for all.<p>Actually Windows has a newish independent text scale accessibility setting that is different than display scale.<p>Yea, sometimes you have to update your UI to account for that, but it’s not a big deal most of the time.<p><a href="https://learn.microsoft.com/en-us/windows/apps/develop/input/text-scaling" rel="nofollow">https://learn.microsoft.com/en-us/windows/apps/develop/input...</a>
Seriously.<p>Browsers originally <i>had</i> text zoom -- <i>only</i> text zoom -- until page zoom was invented, I can't remember by which browser. And then page zoom quickly became the "main" zoom mechanism across all browsers because it was obviously so much better -- icons, layout, everything adjusted together. (And for those who remember, when there was only text zoom, it was a common practice/workaround to define everything in em rather than px, precisely to "fake" page zoom with text zoom.)<p>I'm baffled by the idea of trying to bring text zoom back. Just no, a million times. We tried it. It was bad.
Page zoom is fine for relatively minor adjustments, but if you're browsing with a high page zoom setting you'll still run into a ton of problems.<p>Stuff like "page overlays become so large that they overflow the bounds of the screen, but are fixed position so you can't even scroll them to make the X button visible."<p>Or in the slightly better case, "most of the screen is obscured by the enlarged floating header, the layout of which is totally broken by the relatively narrow viewport relative to content size, and with your large page zoom setting the remaining half of the screen can fit about five words on it at a time."<p>Either way websites need to do accessibility testing and clearly most of them don't.<p>Safari has a setting for "Never use font sizes smaller than __" which used in combination with a not as high page zoom setting is a little less likely to make pages completely fucked, because it's only acting on text that was small to begin with.
There's no expectation that sites ought to work perfectly with 500% zoom, even though a browser supports that as a zoom value. The same way there's no expectation they work with a horizontal viewport size of 50px. Because they're the same thing, and when you push <i>any</i> design too far it breaks. That's just reality.<p>And with page overlays, text zoom isn't necessarily going to fix anything. Sometimes the button to dismiss is at the bottom, and the larger text will just push that off-screen downwards. (I do agree that pop-ups/overlays designed for a screen larger than yours are a problem, but that's often less about zoom than just assuming small/short phone screens no longer exist.)
Oh, and there's TWO page zooms btw: the one you activate with +/- (or ctrl + +/-), and another one available with touchpad pitch-to-zoom / touchscreens (you can't use it on desktops without touchpad/touchscreen).
My memory that far back is hazy but I seem to recall being able to do full-page zoom in Opera circa 2003.
[dead]
> 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.<p>So, for margin and padding, one should use px? Or is there a better unit?
> how do we get large text to scale at a lower rate than body text<p>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.
> 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!<p>Android 14 has this in non-linear text scaling -<p>> To prevent large text elements on screen from scaling too large, the system applies a nonlinear scaling curve.<p><a href="https://developer.android.com/about/versions/14/features#non-linear-font-scaling" rel="nofollow">https://developer.android.com/about/versions/14/features#non...</a>
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.<p>(Also "light mode" apps are painful for him to view, and most of the major apps have skipped out on offering dark mode)
As someone whose eyesight is getting worse, thank you for helping make this happen
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.<p>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.<p>I really don't think we should bend over backwards to cater to accessibility offenders such as LinkedIn.
Most any site should work with zoom. This is about the scale of the text separate from the level of the zoom. The latter breaks a lot of sites because many common layouts assume the layout space for the text will always grow along with the text, as seen in zoom.
They can, and they do. Opera does great zoom + text reflow since ≈2010 and counting.
Why is this set as a meta tag rather than via CSS with html{text-scale:scale} for example?
The linked explainer [1] gets into this:<p>"The new CSS env(preferred-text-scale) variable provides a mechanism for authors to respect the user’s text scale setting that they’ve set either in their operating system or web browser settings. Authors can use it to scale the font-size and alter the layout accordingly.<p>Note: See the env(preferred-text-scale) Explainer [2] for a comparison of the various ways users can scale content and examples of how to use the environment variable.<p>However, if authors have already used font-relative units like rem and em to conform to the Resize Text guideline, the browser could automatically incorporate the OS-level text scale setting into those font-relative units. This would allow authors to avoid having to determine the precise elements to apply the env() variable to.<p>We propose a new HTML meta tag that tells the user agent to apply the scaling factor from env(preferred-text-scale) to the entire page. We expect it will become best practice for authors to use this meta tag, just as they would use the viewport meta tag. The environment variable would be reserved for atypical use cases."<p>There's no need for a text-scale CSS property because font-size already exists. The latter explainer [2] suggests that developers use font-size: calc(100% * env(preferred-text-scale)) to get the desired effect, if they are doing this in CSS rather than with just the meta tag.<p>[1] <a href="https://github.com/w3c/csswg-drafts/blob/main/css-env-1/explainers/meta-text-scale.md" rel="nofollow">https://github.com/w3c/csswg-drafts/blob/main/css-env-1/expl...</a> [2] <a href="https://github.com/w3c/csswg-drafts/blob/main/css-env-1/explainers/env-preferred-text-scale.md" rel="nofollow">https://github.com/w3c/csswg-drafts/blob/main/css-env-1/expl...</a>
Actually I don't think the explainer gets into the full story. The reality is it's not CSS's problem. It's the browsers that have historically made text scaling weird on each platform that they support.<p>And now just like with the viewport meta tag, we need a meta tag to say, 'Stop doing that please. Make the default font size in my CSS work the way it always should have'.<p>The other reason why the flag can't be in CSS is because it needs to make em and rem units in media queries get affected by the user's text scale. See the explainer for more info on that.
Speculation on my part: Your site either supports accessible text scaling, or it doesn't. If only partly supports it – it might as well not at all.
I'm pretty sure this will only get supported by perhaps 5% of websites, making the feature effectively 'broken' for the user 95% of the time.
Should have been tied to the window.devicePixelRatio instead of another input parameter that breaks the layout for some hidden reason.
This is a <i>terrible</i> 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.<p>In other words this is going to make things worse for exactly the group of people it purports to help.
I wish this could be met with universal approval, but this is quite a few fingerprinting bits to add to the bucket.
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.<p>Just one more reason I think the web is a dumpster fire, I guess.
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.