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
The <dfn for="text-scale" export><code>legacy</code></dfn> property is
89
+
recognized in the [=text-scale=] content attribute value.
90
+
91
+
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:
94
+
<ul>
95
+
<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.</li>
Note: As of this writing, all combinations of Android, iOS, Gecko, WebKit, Blink qualify for the first bullet point above.
100
+
101
+
<h3 id="scale-keyword">The 'scale' keyword</h3>
102
+
103
+
The <dfn for="text-scale" export><code>scale</code></dfn> property is
104
+
recognized in the [=text-scale=] content attribute value.
105
+
106
+
When the value of the [=text-scale=] content attribute is
107
+
<a for=text-scale>scale</a> the user agent may determine the initial font size
108
+
based on a combination of the operating system's text scale setting and the user agent's text scale setting. The
109
+
''env()/preferred-text-scale'' value must be a number that, when multiplied by
110
+
16px, provides a <<length>> that matches that of the initial font size.
111
+
112
+
Further, when the value of the [=text-scale=] content attribute is
113
+
<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-page 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>.
114
+
115
+
See the <a href="https://github.com/w3c/csswg-drafts/blob/main/css-env-1/explainers/env-preferred-text-scale.md#windows-11">
116
+
preferred text scale explainer</a> for more details.
117
+
118
+
Note: It is expected that authors will use
119
+
''<meta name="text-scale" content="scale">'' in stylesheets so that the initial font size will reflect an amalgam of the user's font preferences, whether those are specified at the OS level or the UA level. The author will then be able to use ''rem'' throughout the page to honor the user's font preferences.
0 commit comments