You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<dd>''env()/preferred-text-scale'' returns the user's OS-level font factor on mobile,
90
+
but 1 on desktop.
91
+
The document's initial font size only incorporates UA-level font preferences.
92
+
OS-level font preferences are ignored.</dd>
93
+
<dt><dfn>scale</dfn></dt>
94
+
<dd>''env()/preferred-text-scale'' returns the user's OS-level font preferences.
95
+
The document's initial font size incorporates both UA-level and OS-level font preferences.</dd>
96
+
</dl>
85
97
86
98
<h3 id="legacy-keyword">The 'legacy' keyword</h3>
87
99
88
-
The <dfn for="text-scale" export><code>legacy</code></dfn> property is
89
-
recognized in the [=text-scale=] content attribute value.
90
-
91
100
When the value of the [=text-scale=] content attribute is
92
-
<a for="text-scale">legacy</a> the user agent should set the initial font size
93
-
to 16px multiplied by the font scale factor the user has chosen from any settings <i>provided by the user agent</i>. The ''preferred-text-scale'' value must be 1 on desktop platforms. On mobile:
101
+
[=text-scale/legacy=]
102
+
the user agent must set the computed ''font-size/medium'' font size
103
+
to 16px multiplied by
104
+
the font scale factor
105
+
the user has chosen from any settings <i>provided by the user agent</i>.
106
+
The ''preferred-text-scale'' value must be 1 on desktop platforms.
107
+
On mobile:
94
108
<ul>
95
109
<li>if the operating system provides a text scale setting AND the UA hasn't already applied that factor to the initial font size, ''env()/preferred-text-scale'' returns the mulitplier that the user has chosen in the operating system's text scale setting.
96
110
@@ -106,10 +120,12 @@ The <dfn for="text-scale" export><code>scale</code></dfn> property is
106
120
recognized in the [=text-scale=] content attribute value.
107
121
108
122
When the value of the [=text-scale=] content attribute is
109
-
<a for=text-scale>scale</a> the user agent may determine the initial font size
110
-
based on a combination of the operating system's text scale setting and the user agent's text scale setting. The
111
-
''env()/preferred-text-scale'' value must be a number that, when multiplied by
112
-
16px, provides a <<length>> that matches that of the initial font size.
123
+
<a for=text-scale>scale</a>
124
+
computed ''font-size/medium'' font size must match the user's preferred paragraph text size as determined from a combination of OS and UA preferences.
125
+
126
+
The ''env()/preferred-text-scale'' value must be a number that,
127
+
when multiplied by 16px,
128
+
provides a <<length>> that matches that of the initial font size.
113
129
114
130
Further, when the value of the [=text-scale=] content attribute is
115
131
<a for=text-scale>scale</a>, the user agent should skip all font-sizing interventions it would otherwise perform in an attempt to automatically honor the user's preferences. E.g. text autosizing on mobile (See [[css-size-adjust#intro]]) and full-application zoom (<a href="https://github.com/w3c/csswg-drafts/blob/main/css-env-1/explainers/env-preferred-text-scale.md#windows-11">popular browsers do this on Windows)</a>.
0 commit comments