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

> Chrome on Android allows the user to increase the UA and OS font sizes independently (I think Chrome on Windows also). If the user increases the UA and OS font sizes by 150% _each_, would `1uem` be equivalent to `36px` because 16px * 1.5 * 1.5 = 36px? And `1rem` would be equivalent to `24px`, same as it is today?

It depends on if we're talking about the individual page zooming feature, or the browser's settings.

But it's a good question and I think it brings us back to the original issue of how UAs are inconsistent in what `font-size: medium` actually is. Firefox for Android is the only mobile browser AFAIK that responds to the OS font size setting. It has an option to let the user choose whether to use the OS setting or _override_ that with an app setting. But they are never combined.

In my opinion, that feels like the right solution: choose either the OS or UA font sizing, and preferably let the user decide which.

![Screenshot of Firefox accessibility settings page. First option is a switch with the label, 'Automatic font sizing: Font size will match your Android settings.'](https://github.com/user-attachments/assets/5d66fb72-0d22-44b7-b33f-a67e45fdd629)

> In an earlier comment you mentioned you anticipate using this unit would become a best practice. What do you envision? Would author style sheets usually include the below? Would `rem` become relatively useless?
> 
> ```css
> :root {
>   font-size: 1uem;
> }
> ```

More for sizing content. So I would expect it to replace a lot of use cases for `rem`, yes. Either authors can set the root font size to `1uem` like you've shown, and they can continue to use `rem` (except in media queries). Or they can use it directly, for example:

```css
:root {
  font-size: 1uem;
}

.box {
  inline-size: 5uem;

  @media (width > 40uem) {
    inline-size: 10uem;
  }
}
```

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


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

Received on Tuesday, 21 January 2025 16:41:53 UTC