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

> I don't object to an async resolution purely for naming, but it wasn't clear to me reading the propose resolution text at [#10674 (comment)](https://github.com/w3c/csswg-drafts/issues/10674#issuecomment-2910778012) that it was just about naming.

Agreed. @astearns would it be OK if you edited your comment to make clear it is about just the name?

> I don't think a simple scale factor, as exposed by `env(preferred-text-size)`, works here.
> 
> [...]
> 
> From AX1 to AX6, small text gets twice as big, but large text only scales by 1.36. That means that applying a single factor across all text sizes will result in large text getting too large.

> Well that's super interesting; thanks @smfr. I'd like to point y'all to [w3c/wcag3#261 (comment)](https://github.com/w3c/wcag3/issues/261#issuecomment-2598860630) where the WCAG folks have also been thinking that zooming by a uniform percentage isn't the way to create accessible text.

@smfr @jyasskin Do you both think that would be a blocker to exposing the general font scale as multiplier value?

The original problem that I want to solve in this issue is that: authors can respect the user's font scale preference when they set it in their browser accessibility settings, but not their operating system settings.

I agree we need to have a discussion about the accessibility issues of scaling by a uniform percentage (and we did briefly discuss it earlier in the issue). There's questions like 'Is that the author's problem or a CSS problem?' However, to me that's a separate issue to this one.

Right now, when authors use font-relative units like `rem` and `em` to size everything on their page (because that's what they've been taught to do), the page content scales uniformly when the font size is increased in the UA, but not in the OS [(as we demonstrated in the Explainer)](https://github.com/w3c/csswg-drafts/blob/main/css-env-1/explainers/env-preferred-text-scale.md#existing-user-controls-to-scale-content). We're trying to find a solution that fixes the current situation and brings the OS font settings on par with the UA font settings, while also not breaking existing websites.

---

I should mention as well: the author could modify the rate of increase themselves with this formula:

$$fontSize + (fontSize \times (preferredTextScale − 1)) \times rateOfIncrease$$

For example:

```css
h1 {
  --heading-size: 2rem;
  font-size: calc(var(--heading-size) + (var(--heading-size) * (env(preferred-text-scale) − 1)) * 0.5);
}
```

Note to self: I need to put that in the Explainer.

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


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

Received on Tuesday, 10 June 2025 15:15:58 UTC