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

The CSS Working Group just discussed ``[css-fonts][css-values][css-viewport] UAs inconsistent in how OS font settings affect the default font-size `medium` ``, and agreed to the following:

* `RESOLVED:  have the unit (a scaled default font size) and the env() (a scale factor)`

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> dgrogan: this is about authros needing access ot the OS default font size<br>
&lt;TabAtkins> dgrogan: they can do it today but it's hacky, should have more standardized way<br>
&lt;TabAtkins> dgrogan: have talked aobu thtis a few times<br>
&lt;TabAtkins> dgrogan: settled on either an env() or a new unit<br>
&lt;TabAtkins> dgrogan: I think new unit has some good arguments for it. A few abbrevs suggested in the issue<br>
&lt;TabAtkins> dgrogan: we also talked to some authors. they're fine with the new unit, but also interested in having something that's exposed as a %, so they can apply it to the zoom property or text-size-adjust<br>
&lt;TabAtkins> dgrogan: so in last discussion, proposal in the issue is both.<br>
&lt;TabAtkins> dgrogan: env() would expose a scale factor<br>
&lt;TabAtkins> iank_: did we want a % or jsut a raw number?<br>
&lt;TabAtkins> TabAtkins: we'll want a raw number so it's more usable in calc()<br>
&lt;kizu> q+<br>
&lt;TabAtkins> dgrogan: yeah, and they can use calc() to turn it into a %<br>
&lt;astearns> ack kizu<br>
&lt;TabAtkins> kizu: if we have a separate value which is in px, given that in calc we can divide by 1px and get proportional, is that enough that we dont' need an extra unit value?<br>
&lt;TabAtkins> dgrogan: you can't do unit division in browsers today<br>
&lt;TabAtkins> kizu: you can in Safari, at least<br>
&lt;emilio> q+<br>
&lt;dbaron> (I think there's ongoing work to do it in Chrome, too.)<br>
&lt;TabAtkins> iank_: I think it's still easier on devs to have the value directly, rather than dividing by a magical number to produce the scale factor<br>
&lt;TabAtkins> iank_: It's more fragile than just exposing an env() that's 1.5<br>
&lt;astearns> ack emilio<br>
&lt;TabAtkins> emilio: Exposing a particular size is weird, because there might be different OS font sizes. the common denomatinor is some text scale factor that OSes have.<br>
&lt;TabAtkins> TabAtkins: proposal was a unit that gives you the size directly, and a scale factor<br>
&lt;TabAtkins> emilio: If the browser already applies a scale, doesn't using the uint double scale<br>
&lt;TabAtkins> emilio: on windows you have text-scale factor of 2. browsers interpret that as scaling the whole website, effectivley the device pixel ratio<br>
&lt;TabAtkins> emilio: if i give you a size that's 32px, that wouldn't be what you wanted, it's 4x size<br>
&lt;TabAtkins> iank_: looking at what windows actuallyd oes<br>
&lt;TabAtkins> iank_: i thought there was a factor that just scales text but not the whole thing?<br>
&lt;TabAtkins> emilio: we have a *pref* to do that but by default we all interpret the scale as a pixel scale<br>
&lt;florian> q+<br>
&lt;TabAtkins> iank_: at minimum we do seem to need the env(). we can optionally offer the unit.<br>
&lt;TabAtkins> q+<br>
&lt;astearns> ack florian<br>
&lt;TabAtkins> florian: i'm not sure that works, i think you need that *and* an opt out<br>
&lt;TabAtkins> florian: to say "dont' double the dpx of my site" so then the unit is useful<br>
&lt;TabAtkins> florian: otherwise you don't need to know the font size is doubled, becuase the 'medium' value is actually already correct<br>
&lt;TabAtkins> iank_: we do have an opt out on mobile, initial-scale-factor in mobile viewport<br>
&lt;TabAtkins> iank_: don't think we do it on Mac because settings are slightly different<br>
&lt;TabAtkins> iank_: maybe we just file a separate issue for a window opt out<br>
&lt;TabAtkins> emilio: i don't think mac has a global text scale<br>
&lt;TabAtkins> iank_: it does, but there's two toggles, one scales text the other is a global scale<br>
&lt;TabAtkins> iank_: you can probe this value on mobile, where people care a lot. it doens't matter quite as much on desktop, but not sure if people can probe for it<br>
&lt;TabAtkins> iank_: we'd hook that pref into this<br>
&lt;TabAtkins> iank_: we're not currnetly using that pref at all<br>
&lt;TabAtkins> iank_: so the question is do we need an opt out on windows and linux?<br>
&lt;TabAtkins> astearns: can we close off the discussion of this extra functionality?<br>
&lt;TabAtkins> emilio: but if we do this scaling, the scale factor for env() is always 1.<br>
&lt;astearns> ack TabAtkins<br>
&lt;emilio> TabAtkins: given this info, what is the issue actually about if it is the case that we already scale the page based on this factor<br>
&lt;emilio> iank_: we don't<br>
&lt;emilio> ... most of the time<br>
&lt;emilio> ... on mobile<br>
&lt;emilio> ... web devs, per browser, they try to find out the boosted text paragraph way<br>
&lt;emilio> ... on safari I think they probe the specific font thing<br>
&lt;emilio> ... they'd store the value and boost their text<br>
&lt;emilio> q+<br>
&lt;emilio> ... I don't necessarily want to boost the whole text<br>
&lt;emilio> TabAtkins: so the page is not fully scaled, but sometimes it is<br>
&lt;emilio> iank_: for us on android this toggle would do nothing<br>
&lt;emilio> ... it's very difficult<br>
&lt;emilio> ... so most sites disable the text auto-sizer<br>
&lt;emilio> ... they know how to boost and how much<br>
&lt;emilio> ... and they want this value and apply it fine-grained<br>
&lt;emilio> ... so this is why we want to expose this as an env()<br>
&lt;emilio> ... there's a good explanation on the thread<br>
&lt;emilio> TabAtkins: with the information that a lot of time fully scaling the page, but in the times we're fully scaling the page it'd be 1<br>
&lt;emilio> iank_: then there's the question of whether we want to have an opt out on windows<br>
&lt;florian> q+<br>
&lt;emilio> ... would need more research<br>
&lt;emilio> ... but that is a separate issue<br>
&lt;astearns> ack emilio<br>
&lt;TabAtkins> emilio: isn't the main issue that you do nothing with this on android?<br>
&lt;TabAtkins> iank_: boosting the page wholesale isn't usually what devs want<br>
&lt;TabAtkins> iank_: users want their text boosted, but not in a way that breaks the page<br>
&lt;argyle> q+<br>
&lt;TabAtkins> iank_: devs want to do the right thing a11y-wise, but boosting the whoel page or using our text auto-sizer heuristics aren't good<br>
&lt;TabAtkins> emilio: we do effectively zoom-to-page, changing the dpr<br>
&lt;TabAtkins> emilio: a lot of websites taht don't think about it actually get the right behavior<br>
&lt;TabAtkins> emilio: impossible to tell if they're on a high-dpr small screen or low-dpr big screen<br>
&lt;TabAtkins> iank_: yeah on desktop it's less of an issue since ther'es more real estate, but on mobile you want to be careful with limited space<br>
&lt;TabAtkins> emilio: yeah, don't want a mobile site with only half the nromal pixels<br>
&lt;TabAtkins> iank_: so this is why devs turn off text autosizing, but they do want to do the right thing for users<br>
&lt;florian> q- later<br>
&lt;TabAtkins> emilio: i haven't seen much bugs filed from our users against the full-page resizing, but i understand ti<br>
&lt;TabAtkins> emilio: even if we expose the scale factor i'd like some opt-in from the page<br>
&lt;TabAtkins> emilio: scaling the page when the web author hasn't put in any thought is generally better behavior<br>
&lt;TabAtkins> iank_: no<br>
&lt;TabAtkins> emilio: yes<br>
&lt;TabAtkins> iank_: no<br>
&lt;astearns> ack argyle<br>
&lt;TabAtkins> argyle: most common case for me is a chat app on a mobile device<br>
&lt;joshtumath> q+<br>
&lt;TabAtkins> argyle: you want the font-size boosted to max for readability, but not touch areas, or margin, or padding, etc<br>
&lt;TabAtkins> argyle: i see both young and old massively boosting their font size for chats, and i'd like my site to read as easily<br>
&lt;astearns> ack dbaron<br>
&lt;Zakim> dbaron, you wanted to comment on text autosizing<br>
&lt;TabAtkins> dbaron: there were refs to turning off text autosizing<br>
&lt;TabAtkins> dbaron: it exists int he first place to make pages designed for desktop sizes usable on mobile<br>
&lt;TabAtkins> dbaron: it exists in that context, ot basically say when you have a block of text, mobile user will want to pan in to read it, and you want to avoid them hving to then pan side to side to read it<br>
&lt;TabAtkins> dbaron: and that notion is tied to the system preference, which is why it can be used to detect the system pref sometimes<br>
&lt;TabAtkins> dbaron: but i don't think text autosizing is really designed for mobile-design cases<br>
&lt;TabAtkins> iank_: yup<br>
&lt;astearns> ack florian<br>
&lt;TabAtkins> florian: i think ideally what Adam is talking aobut should work ideally, but we're not in ideal world<br>
&lt;TabAtkins> florian: lot of sites would break if you just scale text<br>
&lt;TabAtkins> florian: web is in theory capable of doing this, but many sites not designed for it<br>
&lt;TabAtkins> florian: so maybe just don't do anything and expose the "good" scale factor<br>
&lt;TabAtkins> florian: when authors want to do the right thing i think giving that info is the right thing, but not all will think about it<br>
&lt;TabAtkins> iank_: yeah, on mobile zooming or not is a UA decision<br>
&lt;TabAtkins> florian: yeah, can decide to zoom to try and make the right choice for users by default.<br>
&lt;TabAtkins> iank_: yeah, there's way too many sites that'll, say, set an explicit height on something - you boost the text and it gets clipped<br>
&lt;TabAtkins> florian: so it seems that browsers can zoom sometimes, and if you want to do better you need to opt out.<br>
&lt;TabAtkins> florian: if you're opting out, maybe opt out of both zoom and text size, give an env() with the font sacle<br>
&lt;TabAtkins> florian: or might want to just opt out of zoom, but take the font scaling automatically<br>
&lt;TabAtkins> florian: so having a two way opt out which is (1) don't zoom the page, and (2) do or don't change the root font size, but tell me in an env()<br>
&lt;TabAtkins> florian: I think that's tehe complete solution<br>
&lt;TabAtkins> iank_: yes, i think we expose the environment variable, adn provide a meta viewport to opt into the zoom behaviors<br>
&lt;TabAtkins> florian: unsure why can't adjust the 'em' size by default...<br>
&lt;TabAtkins> iank_: so many people using libraries, not sure it's actually common to fully accommodate this<br>
&lt;astearns> ack joshtumath<br>
&lt;TabAtkins> joshtumath: just wanted to thank people for bringing this up<br>
&lt;TabAtkins> joshtumath: bringing this back to the original prompt<br>
&lt;TabAtkins> joshtumath: in BBC we have webviews and apps, there's no means of saying in the browser UI to adjust the font size<br>
&lt;TabAtkins> joshtumath: so authors have to do it<br>
&lt;TabAtkins> joshtumath: the meta viewport values would handle that<br>
&lt;TabAtkins> joshtumath: we want the ability to say "yes we've thought about it, scale the page", etc<br>
&lt;TabAtkins> joshtumath: want rems to scale by user font size, but not px, etc<br>
&lt;emilio> q+<br>
&lt;TabAtkins> astearns: do we resolve on the unit+env() now? or push back to the meta-viewport discussion?<br>
&lt;TabAtkins> astearns: i'm inclined to decide it now<br>
&lt;astearns> ack emilio<br>
&lt;TabAtkins> florian: yes, while there are cases where things are full zoomed (and scale factor would be 1) and others where it's not<br>
&lt;TabAtkins> emilio: i think i'm okay with the scale factor<br>
&lt;TabAtkins> emilio: adding the font unit seems like a lot of overhead<br>
&lt;TabAtkins> q+<br>
&lt;TabAtkins> emilio: seems like there are a lot of issues - setting being respected on browsers, in webviews...<br>
&lt;TabAtkins> emilio: i'm okay with exposing one scale factor, exposing a whole set of font units seems like a lot<br>
&lt;joshtumath> q+<br>
&lt;TabAtkins> iank_: our opinion is env() is needed, unit is nice to have<br>
&lt;TabAtkins> emilio: so i think doing jsut an env() for now and unit later<br>
&lt;astearns> ack TabAtkins<br>
&lt;emilio> TabAtkins: the big reason to supply one unit was brought up was to be able to use it in media query<br>
&lt;emilio> ... because that's intended to be a common case to use in media queries or what not<br>
&lt;dbaron> Is it like an em or like a rem?<br>
&lt;emilio> TabAtkins: one or another, I dunno<br>
&lt;astearns> ack joshtumath<br>
&lt;TabAtkins> dbaron: it's relevant question, ems are scaled again and again<br>
&lt;emilio> dbaron: relevant because one multiplies over and over<br>
&lt;TabAtkins> TabAtkins: sounds like a scaled rem then<br>
&lt;TabAtkins> joshtumath: yeah, ask is mostly for a rem<br>
&lt;emilio> q+<br>
&lt;TabAtkins> joshtumath: when trying to hotfix this with a proprietary apply font property, setting it on the root meant that MQs still didn't work right.<br>
&lt;TabAtkins> joshtumath: thus the need for the unit to always exist, not be dependen ton a property<br>
&lt;astearns> ack emilio<br>
&lt;TabAtkins> emilio: so a bit confused, do we really want a rem?<br>
&lt;TabAtkins> emilio: or just relative to the default font size? (not changed by the actual root font-size)<br>
&lt;TabAtkins> dbaron: I think the latter, yes<br>
&lt;fantasai> pem = preferred font size em<br>
&lt;joshtumath> +1<br>
&lt;TabAtkins> astearns: so let's have a proposed resolution to have the unit (a scaled default font size) and the env() (a scale factor)<br>
&lt;TabAtkins> RESOLVED:  have the unit (a scaled default font size) and the env() (a scale factor)<br>
</details>


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


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

Received on Thursday, 30 January 2025 19:40:25 UTC