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

> I think the idea of making it an `env()` is that you'd use `calc()` mixed with `env()` on the media query, rather than `rem`.

> Right, the env() would evaluate to the appropriate font size, which is equivalent to 1em in that font size, so instead of `(width: 40rem)` you'd use `(width: calc(40 * env(system-font-size)))`

I see. Great. So in that example, `calc(40 * env(system-font-size)` is effectively like `40rem`. That would work nicely. I'd be happy to support that.

Although it is a shame that it doesn't work globally like the previously suggested `<meta name="viewport">`, which would have made all existing code 'just work' in responding to OS font settings. Do we could do both? Provide both the `env()` and some kind of flag to make the default font size respect the OS font setting? As explained in the original post, UAs are inconsistent in how they respond to it. Firefox for Android does just change the default font-size with seemingly no compat issues.

> Are folks generally okay with pairing this with a non-auto value of `text-size-adjust` to disable automatic adjustment?

Hmm. You're talking about situations where the `<meta name="viewport">` tag has not been specified. What value do you think `env(system-font-size)` should return in that situation. Should it be scaled up? Personally, I think the virtual viewport settings should have no effect and it should return the same computed value regardless.

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


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

Received on Saturday, 14 December 2024 01:09:03 UTC