Re: [csswg-drafts] [css-fonts][css-viewport] UAs inconsistent in how OS font settings affect the default font-size `medium` (#10674)

Thanks for the response, @cookiecrook. I've been chatting with some of our accessibility team at the BBC, @samua11y and Andy Ronksley, and we've thinking about the points that you've made.

I can see from what you're saying how iOS is trying to account for apps and websites that are scaling fonts very inconsistently. Also, I'd just like to make clear that this issue is about finding an interoperable solution that that can work across all user agents, and is not just about Safari on iOS.

> My opinion is that any native app operating as a browser (includes a web view that can display an indeterminate web source) should also add the ability for the user to adjust their font size. This includes apps like Twitter(X) and Gmail that include a browser for links from social posts or email.

We disagree with this. A key thing I think I need to explain about the BBC's use case is that our BBC News and BBC Sport apps are architected with a mixture of native and Web View pages. For example, pages with live feeds are shown in a Web View because a UI for them has not been built natively.

![Screenshot_20240904-174413](https://github.com/user-attachments/assets/5406dad5-63cd-45d0-a618-47f245621a2d)

In this context, users would not expect a control for them to change the font size of the Web View. They would expect the font size that they set either the OS settings or app settings to be reflected both in the native pages and web-based pages of the app. We've actually had quite a few complaints from our users about how the font size in the web views don't match the pages in the app built with a native UI (we've worked around this for now using `font: -apple-system-body`).

> Apple originally shipped Dynamic Type as a single setting for all apps on the system. Unfortunately, a large percentage of third party apps did not support the extra large accessibility font sizes, so the user's experience was pretty broken. They would constantly have to adjust the system size to its max functional size in one of these broken apps, and then readjust to their larger preferred size in other properly coded apps. To account for this problem, iOS added the ability to set a per-app font size. 

It's certainly good that iOS provides these workarounds for its users. Nevertheless, there is still an expectation on native app developers to properly conform to the OS font size setting ('dynamic type'). Likewise, I think we can still expect that of web developers as well and we should be able to allow them to do the right thing in accommodating for the OS or user agent font size settings being changed.

This is good for users because it reduces their cognitive overhead. It is better for users if they can set their preference once and authors and user agents accept that. For example, for users who experience eye strain that gets worse during their session on a device, they may want to keep increasing the font size, and it would be better for them if they only had to do it once.

The onus should be on us as authors and as user agents to make sure websites look correct for users, not the users themselves. I don't want to make them do the hard work of getting the font size right when they've already expressed a preference.

We are concerned that users are less likely to try fixing the font size for them on a per site basis rather than globally.

> Some read the system preference and pass the base size through to the web view as a JavaScript or CSS variable. There are a dozen ways for native apps to support a user's preferred font size, and IMO none of them require additional CSS features.

@samua11y did look into this and found that to do this would require a mapping table to match the dynamic type size in `UIContentSizeCategory` to the web view font, which was much more complex than if we simply had a way to get the user agent to conform to the OS settings.

Also, changing the font-size at the root not will affect the _initial font-size_, so relative font units in media queries will not be affected. (There are, of course, workarounds to that, like using container queries, but that's not ideal.)

(I can't find the screenshot that demonstrates the issue well. I'll see if I can find it tomorrow.)

-- 
GitHub Notification of comment by JoshTumath
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10674#issuecomment-2329584328 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 4 September 2024 17:08:50 UTC