Remix.run Logo
Try text scaling support in Chrome Canary(joshtumath.uk)
92 points by linolevan 11 hours ago | 26 comments
montroser 8 hours ago | parent | next [-]

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.

dfabulich 7 hours ago | parent | next [-]

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.

It's not that tough, but there can be tricky cases.

mananaysiempre 3 hours ago | parent [-]

Also with every relevant locale, as English UI strings are usually abnormally short.

crazygringo 6 hours ago | parent | prev | next [-]

Seriously.

Browsers originally had text zoom -- only 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.)

I'm baffled by the idea of trying to bring text zoom back. Just no, a million times. We tried it. It was bad.

wlesieutre 4 hours ago | parent | next [-]

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.

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."

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."

Either way websites need to do accessibility testing and clearly most of them don't.

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.

crazygringo 3 hours ago | parent [-]

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 any design too far it breaks. That's just reality.

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.)

gary_0 an hour ago | parent | prev [-]

My memory that far back is hazy but I seem to recall being able to do full-page zoom in Opera circa 2003.

fassssst 4 hours ago | parent | prev | next [-]

> This is already how it works on Windows, and it is definitely the best path to happiness for all.

Actually Windows has a newish independent text scale accessibility setting that is different than display scale.

Yea, sometimes you have to update your UI to account for that, but it’s not a big deal most of the time.

https://learn.microsoft.com/en-us/windows/apps/develop/input...

mjmas 7 hours ago | parent | prev [-]

This is supporting something that already exists for native phone apps. My phone has separate options for display size and text size.

And so I have it set to have smaller buttons but still a normal-size font.

homebrewer 6 hours ago | parent [-]

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.

Don't know about mobile, probably works there too.

montroser 4 hours ago | parent [-]

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.

Here's NYT with that firefox "zoom text only" enabled: https://i.imgur.com/zp7pDW3.png

See the chopped "rld" on the left? That's the link to the "World" section. To the left of that off the screen 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.

For reference, here's the totally sensible result if you just don't enable "zoom text only": https://i.imgur.com/Kkd5aOu.png

fleebee 5 hours ago | parent | prev | next [-]

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.

zamadatix 5 hours ago | parent [-]

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.

david422 6 hours ago | parent | prev | next [-]

> 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.

https://developer.android.com/about/versions/14/features#non...

socalgal2 8 hours ago | parent | prev | next [-]

As someone whose eyesight is getting worse, thank you for helping make this happen

zarzavat 3 hours ago | parent | prev | next [-]

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.

pupppet 8 hours ago | parent | prev | next [-]

Why is this set as a meta tag rather than via CSS with html{text-scale:scale} for example?

ameliaquining 8 hours ago | parent | next [-]

The linked explainer [1] gets into this:

"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.

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.

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.

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."

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.

[1] https://github.com/w3c/csswg-drafts/blob/main/css-env-1/expl... [2] https://github.com/w3c/csswg-drafts/blob/main/css-env-1/expl...

joshtumath 8 hours ago | parent [-]

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.

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'.

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.

linolevan 8 hours ago | parent | prev [-]

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.

londons_explore 6 hours ago | parent | prev | next [-]

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.

SamBam 3 hours ago | parent [-]

These days the vast majority of the (at least, English-speaking) web is only on a few dozen websites. The 80-20 rule would get you pretty far for most users' daily interactions.

ivanjermakov 7 hours ago | parent | prev | next [-]

Should have been tied to the window.devicePixelRatio instead of another input parameter that breaks the layout for some hidden reason.

zamalek 6 hours ago | parent | prev | next [-]

I wish this could be met with universal approval, but this is quite a few fingerprinting bits to add to the bucket.

jlarocco 4 hours ago | parent | prev | next [-]

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.

kevin_thibedeau 5 hours ago | parent | prev [-]

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.