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
There must not be more than one <{meta}> element with its <{meta/name}> attribute value set to an [=ASCII case-insensitive=] for [=text-scale=] per document.
113
+
There must not be more than one <{meta}> element with its <{meta/name}> attribute value set to an [=ASCII case-insensitive=]match for [=text-scale=] per document.
107
114
108
115
<h3 id="text-scale-meta-keywords">
109
116
Keywords</h3>
@@ -113,49 +120,47 @@ The recognized keywords in the [=text-scale=]
113
120
114
121
<dl>
115
122
<dt><dfn for="text-scale">legacy</dfn></dt>
116
-
<dd>The ''env()/preferred-text-scale'' environment variable returns the user's OS-level font factor on mobile,
117
-
but 1 on desktop.
118
-
The document's ''font-size/medium'' font size incorporates UA-level font preferences.
119
-
OS-level font preferences are ignored.
123
+
<dd>
124
+
The ''env()/preferred-text-scale'' environment variable returns the user's OS-level font factor on mobile devices,
125
+
but 1 on desktop devices.
126
+
[=text scale factor=] incorporates UA-level font preferences but
127
+
OS-level font preferences are ignored.
120
128
121
-
Note: Equivalent to omitting a [=text-scale=]<{meta}> tag or
122
-
including an unrecognized content attribute keyword.
129
+
Note: Equivalent to omitting a [=text-scale=]<{meta}> tag or
130
+
including an unrecognized content attribute keyword.
131
+
</dd>
132
+
<dt><dfn for="text-scale">scale</dfn></dt>
133
+
<dd>
134
+
The ''env()/preferred-text-scale'' environment variable returns the user's OS-level font preferences.
135
+
[=text scale factor=] incorporates both UA-level and OS-level font preferences.
123
136
</dd>
124
-
<dt><dfn>scale</dfn></dt>
125
-
<dd>The ''env()/preferred-text-scale'' environment variable returns the user's OS-level font preferences.
126
-
The document's ''font-size/medium'' font size incorporates both UA-level and OS-level font preferences.</dd>
When the value of the [=text-scale=] content attribute is
132
142
[=text-scale/legacy=],
133
143
the [=text scale factor=] is the font scale factor
134
-
the user has chosen from any settings <i>provided by the user agent</i>.
135
-
The ''preferred-text-scale'' environment variable value must be 1 on desktop platforms.
136
-
On mobile:
137
-
<ul>
138
-
<li>if the operating system provides a text scale setting AND
139
-
the UA hasn't already applied that factor to the ''font-size/medium'' font size,
140
-
the ''env()/preferred-text-scale'' environment variable returns the multiplier
141
-
that the user has chosen in the operating system's text scale setting.
144
+
the user has chosen from any settings provided <i>only</i> by the user agent.
145
+
The ''env()/preferred-text-scale'' environment variable value must be 1 on desktop platforms.
142
146
143
-
Note: At the time of publishing, all combinations of
144
-
Android, iOS,
145
-
Firefox, Safari, Chrome
146
-
satisfy this first condition.
147
+
On mobile platforms:
148
+
<ul>
149
+
<li>
150
+
If the operating system provides a text scale setting AND
151
+
the UA hasn't already applied that factor to the ''font-size/medium'' font size,
152
+
the ''env()/preferred-text-scale'' environment variable returns the multiplier
153
+
that the user has chosen in the operating system's text scale setting.
147
154
155
+
Note: At the time of publishing, all combinations of Android, iOS, Firefox, Safari, and Chrome satisfy this first condition.
148
156
</li>
149
157
<li>Otherwise the ''env()/preferred-text-scale'' environment variable returns 1.</li>
150
158
</ul>
151
159
152
160
<h3 id="scale-keyword">The 'scale' keyword</h3>
153
161
154
-
The <dfn for="text-scale" export><code>scale</code></dfn> property is
155
-
recognized in the [=text-scale=] content attribute value.
156
-
157
162
When the value of the [=text-scale=] content attribute is
158
-
<a for=text-scale>scale</a>,
163
+
<a for="text-scale">scale</a>,
159
164
the [=text scale factor=] matches the user's preferred paragraph text size
160
165
(as determined from a combination of OS and UA preferences)
161
166
divided by 16px.
@@ -165,34 +170,36 @@ The ''env()/preferred-text-scale'' environment variable must return the [=text s
165
170
Further, when the value of the [=text-scale=] content attribute is
166
171
<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>.
167
172
168
-
Note: Authors are expected to use
169
-
''<meta name="text-scale" content="scale">'' in stylesheets so that the ''font-size/medium'' font size will reflect a combination 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.
173
+
Note:
174
+
Authors are expected to use
175
+
<code><meta name="text-scale" content="scale"></code> in stylesheets so that the ''font-size/medium'' font size will reflect a combination 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.
170
176
171
177
<div class="example" id="ex-scaled-page">
172
178
If authors don't alter the '':root'' font size, content sized with ''rem'' units will be relative to the preferred text scale
173
-
<pre>
179
+
<pre class="lang-html">
174
180
<!DOCTYPE html>
175
181
<html> <!-- leave this element's font-size as the default -->
176
182
<head>
177
183
<meta name="text-scale" content="scale" />
178
184
</head>
179
185
<body>
180
186
<div style="font-size: 1rem;">
181
-
This font size obeys the user's font preferences, **whether
187
+
This font size obeys the user's font preferences, **whether
182
188
those preferences are specified at the operating system level
183
189
or the user agent level**
184
190
</div>
185
191
<div style="font-size: 20px;">
186
-
This font size does NOT respect the user's font preferences.
192
+
This font size does NOT respect the user's font preferences.
0 commit comments