Great question. We talked about this some in the WG... see https://github.com/w3c/csswg-drafts/issues/10674#issuecomment-2603454418 and the proceeding 3-4 comments.
We (chrome) intend to only include the OS-level font settings in this environment variable, at least for now, because that's what most users have modified. The demand for this feature from authors is mostly/exclusively for web on Android, which doesn't even have a chrome-level font setting, so that's a natural fit. In the future we'll consider whether we should *also* fold in the chrome-level font setting. To answer your questions more directly: > If a user has modified their preferred font sizes via browser settings, say from 16px to 20px, how would this work then? The environment variable would not include such change. > What is the 100% multiplier in your CSS rule based upon then? In <p style="text-size-adjust: calc(100% * env(preferred-text-scale));"> the calc expression would evaluate 100% * the OS-level selected scale. > Would they get gigantic fonts bumped at the OS- and then the browser-level on top? text-size-adjust only works on android, where there is no browser-level font setting, so no, they'd only get the OS bump. On Thu, Feb 27, 2025 at 3:20 AM Thomas Steiner <to...@google.com> wrote: > If a user has modified their preferred font sizes via browser > settings, say from 16px to 20px, how would this work then? What is the 100% > multiplier in your CSS rule based upon then? Would they get gigantic fonts > bumped at the OS- and then the browser-level on top? > > [image: Screenshot 2025-02-27 at 12.17.24.png] > > > On Wed, Feb 26, 2025 at 10:15 PM 'David Grogan' via blink-dev < > blink-dev@chromium.org> wrote: > >> Contact emailsdgro...@chromium.org >> >> ExplainerNone yet. An example usage is <p style="text-size-adjust: >> calc(100% * env(preferred-text-scale));"> >> >> Specificationhttps://github.com/w3c/csswg-drafts/issues/10674 >> >> Summary >> >> Exposes a user's preferred font scale to CSS. Currently, it is not >> practical for a page to detect if the user has changed their preferred font >> size via the Operating System's preferences panel. This CSS environment >> variable will reflect the scale chosen by the user. >> >> >> Blink componentBlink>Accessibility >> <https://issues.chromium.org/issues?q=customfield1222907:%22Blink%3EAccessibility%22> >> >> Motivation >> >> Without this API, pages cannot practically honor the user's OS-level >> font-size preference. Today, if you change the Android system-level font >> slider and browse the web you'll see that <10% of sites honor that slider. >> The minority that do change font sizes have mostly stumbled into a very old >> UA intervention that boosts font sizes on mobile. >> >> >> Initial public proposalhttps://github.com/w3c/csswg-drafts/issues/10674 >> >> TAG reviewNone >> >> TAG review statusPending >> >> Risks >> >> >> Interoperability and Compatibility >> >> None >> >> >> *Gecko*: No signal >> >> *WebKit*: No signal >> >> *Web developers*: No signals >> >> *Other signals*: >> >> WebView application risks >> >> Does this intent deprecate or change behavior of existing APIs, such that >> it has potentially high risk for Android WebView-based applications? >> >> None >> >> >> Debuggability >> >> None >> >> >> Is this feature fully tested by web-platform-tests >> <https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md> >> ?No -- We use a UA-specific internals API to simulate changing the >> OS-level font scale >> >> Flag name on about://flagsNone >> >> Finch feature nameNone >> >> Non-finch justificationNone >> >> Requires code in //chrome?False >> >> Tracking bughttps://crbug.com/397737223 >> >> Estimated milestones >> >> No milestones specified >> >> >> Link to entry on the Chrome Platform Status >> https://chromestatus.com/feature/5328467685801984?gate=6124347150041088 >> >> This intent message was generated by Chrome Platform Status >> <https://chromestatus.com/>. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "blink-dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to blink-dev+unsubscr...@chromium.org. >> To view this discussion visit >> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOZbSt1dSWUwuFD%2Bu%3DwGXf-ubdgh8K%3D0oj13%3DkrvADSOM41xtw%40mail.gmail.com >> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOZbSt1dSWUwuFD%2Bu%3DwGXf-ubdgh8K%3D0oj13%3DkrvADSOM41xtw%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > > > -- > Thomas Steiner, PhD—Developer Relations Engineer (blog.tomayac.com, > toot.cafe/@tomayac) > > Google Germany GmbH, ABC-Str. 19, 20354 Hamburg, Germany > Geschäftsführer: Paul Manicle, Liana Sebastian > Registergericht und -nummer: Hamburg, HRB 86891 > > ----- BEGIN PGP SIGNATURE ----- > Version: GnuPG v2.4.3 (GNU/Linux) > > iFy0uwAntT0bE3xtRa5AfeCheCkthAtTh3reSabiGbl0ck > 0fjumBl3DCharaCTersAttH3b0ttom.xKcd.cOm/1181. > ----- END PGP SIGNATURE ----- > -- You received this message because you are subscribed to the Google Groups "blink-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscr...@chromium.org. To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOZbSt1VvirB71YNEGpWyQY0YvEip2-JJzyZFojBVPrte26jNw%40mail.gmail.com.