Re: [csswg-drafts] Browser zoom unit for accessibility [css-values-and-units] (#6869)

>And I'm not sure whether we're crossing two unrelated threads, or whether these font size solutions are related to the "zoom unit" proposal in a way I just don't fully understand, because the thread is… dense. 😉

@cookiecrook Back in 2019 we had discussed things like `env(system-font-size)` and a bunch of other CSS concepts. I understood it that we had punted that work to the HTML spec. But I understand now, concepts related to scaling font was decided to be left in the hands of the browser.

https://github.com/w3c/csswg-drafts/issues/3708#issuecomment-532113043

That means solutions related to computing based on a CSS variable, as suggested in the first comment's point number 2:

>Setting a standard for browsers to zoom the root font size instead of the size of a pixel.

Was resolved to not being something that will land in CSS. 

To this day, Android users are affected by accessibility concerns. A bug since 2016 (!) still remains open titled: [Switch accessibility font scale factor to use page zoom instead of text autosizing](https://bugs.chromium.org/p/chromium/issues/detail?id=645717). The other bug filed regarding PWAs specifically has been stalled since 2019 for lack of a clear spec. 

My understanding was we were getting something over viewport and that would relate to this, but apologies, I was mistaken. That means there isn't anything planned for viewport that we can read or set that will get use to font-based scaling. In other words, there is nothing we can set to change the mechanics to how pages zoom, pixel or font-based.

The issue here is best summed up with:

>One of my worst pet peeves on the Web: font sizes that increase when you zoom out on a page.
>That’s not how zooming is supposed to work!

Chrome Android struggle with it most. That's kind of where we stand in terms of what we've discussed and what we can do. /exhale

------

Specifically with layout, I feel like if container queries can take computed sizes like `calc(40ch + 32px)` we can work towards cleaner scaling layouts. I could size different layouts based on how much text can fit, not just zoom (pixel) based. Form fields that can shift around based on font size are tricky, though I've found moderate success with using intrinsic sizes (eg: `<input size=50>`) and `flex:auto`).

The other avenue could be trying to get devicePixelRatio standardized across browsers and getting their values injectable into CSS line my codepen shows. I haven't explored much there personally, there might be something there.

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


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

Received on Friday, 7 April 2023 12:04:26 UTC