← Back to release summary

meta name="text-scale"

Category
Miscellaneous
Type
New or changed feature
Status
Proposed (Chrome Proposed)
Intent stage
None

Summary

Makes the root element's default font size scale in proportion to both the operating system's and browser's text scale setting. This allows pages that follow best practices around font-relative units (i.e. use rem and em for font sizes and page elements that should change with the user's text size preferences) to respect the user's OS-level text scale setting. This also causes the browser to disable existing browser-based mechanisms (i.e. full-page zoom on windows) and heuristics (i.e. text autosizing on mobile). Now web developers can signal to the browser that the page is constructed in a way (i.e. with rem and em) that will scale well across various user-selected font size preferences. Similar to env(preferred-text-scale), which provides authors with a way to access the text scale; this API extends that by enabling scaling via the root element's default font size and opting-out of automatic text scaling.

Motivation

Authors currently don't have an easy way to respect the OS-level text scale setting on all devices. It is practically impossible to detect and respect this on desktop. On mobile, there is env(preferred-text-scale), but authors would need to use it in calc() functions to set the root font-size and some media queries. They would need a lot of guidance to ensure it gets used correctly and there would be little variation in how they would use it. Therefore, it would be much easier for authors if they could continue to use font-relative units as they do now and the UA initial font-size was redefined to incorporate the OS-level text scale setting.

Standards & signals

Explainers: https://github.com/w3c/csswg-drafts/blob/main/css-env-1/explainers/meta-text-scale.md

View on chromestatus.com