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
<p>The <dfnclass="dfn-paneled" data-dfn-type="dfn" data-noexportid="text-scale-factor">text scale factor</dfn> is a multiplier
1297
-
used to calculate the computed value of the <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css2/#valdef-font-size-medium" id="ref-for-valdef-font-size-medium">medium</a> font size.
1298
-
The computed value of <spanclass="css" id="ref-for-valdef-font-size-medium①">medium</span>
1299
-
is 16px
1300
-
multiplied by the <adata-link-type="dfn" href="#text-scale-factor" id="ref-for-text-scale-factor">text scale factor</a>.
1301
-
This factor also
1302
-
affects the computed size of the other <aclass="production css" data-link-type="type" href="https://drafts.csswg.org/css2/#value-def-absolute-size" id="ref-for-value-def-absolute-size"><absolute-size></a> keywords,
1303
-
but not necessarily by the same factor as <spanclass="css" id="ref-for-valdef-font-size-medium②">medium</span>.
1304
-
The UA should non-uniformly adjust
1305
-
keywords other than <spanclass="css" id="ref-for-valdef-font-size-medium③">medium</span> for improved readability.</p>
1306
-
<pclass="note" role="note"><spanclass="marker">Note:</span> Scaling all font sizes uniformly would lead to large fonts being too large.
1307
-
See <ahref="https://github.com/w3c/wcag3/issues/261#issuecomment-2598860630">
1308
-
WCAG discussion about minimum and maximum critical font sizes</a>.</p>
1296
+
<p>User agents must calculate the computed value of <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css2/#valdef-font-size-medium" id="ref-for-valdef-font-size-medium">medium</a> by multiplying 16px by
1297
+
the <dfnclass="dfn-paneled" data-dfn-type="dfn" data-noexportid="text-scale-factor">text scale factor</dfn>.
1298
+
User agents must also apply this factor when determining the computed sizes of the other <aclass="production css" data-link-type="type" href="https://drafts.csswg.org/css2/#value-def-absolute-size" id="ref-for-value-def-absolute-size"><absolute-size></a> keywords.
1299
+
However, user agents should scale these other keywords non-linearly
1300
+
to preserve readability.</p>
1301
+
<pclass="note" role="note"><spanclass="marker">Note:</span> Applying a linear scale to all keywords would render large fonts excessively large. See the
WCAG discussion on minimum and maximum critical font sizes</a>.</p>
1309
1304
<p>A document with a <code><adata-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#meta" id="ref-for-meta①">meta</a></code> tag
is an <adata-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive">ASCII case-insensitive</a> match for
is recognized as controlling the <adata-link-type="dfn" href="#text-scale-factor" id="ref-for-text-scale-factor①">text scale factor</a>.</p>
1308
+
is recognized as controlling the <adata-link-type="dfn" href="#text-scale-factor" id="ref-for-text-scale-factor">text scale factor</a>.</p>
1314
1309
<p>The value of the <code><adata-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-content" id="ref-for-attr-meta-content">content</a></code>
1315
1310
attribute must be an <adata-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive①">ASCII case-insensitive</a> match for one of the
1316
1311
recognized keywords. Otherwise the tag is ignored.</p>
The <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css-env-1/#valdef-env-preferred-text-scale" id="ref-for-valdef-env-preferred-text-scale">preferred-text-scale</a> environment variable returns the user’s OS-level font factor on mobile devices,
1334
1329
but 1 on desktop devices.
1335
-
<adata-link-type="dfn" href="#text-scale-factor" id="ref-for-text-scale-factor②">text scale factor</a> incorporates UA-level font preferences but
1330
+
<adata-link-type="dfn" href="#text-scale-factor" id="ref-for-text-scale-factor①">text scale factor</a> incorporates UA-level font preferences but
The <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css-env-1/#valdef-env-preferred-text-scale" id="ref-for-valdef-env-preferred-text-scale①">preferred-text-scale</a> environment variable returns the user’s OS-level font preferences.
1344
-
<adata-link-type="dfn" href="#text-scale-factor" id="ref-for-text-scale-factor③">text scale factor</a> incorporates both UA-level and OS-level font preferences.
1339
+
<adata-link-type="dfn" href="#text-scale-factor" id="ref-for-text-scale-factor②">text scale factor</a> incorporates both UA-level and OS-level font preferences.
the <adata-link-type="dfn" href="#text-scale-factor" id="ref-for-text-scale-factor④">text scale factor</a> is the font scale factor
1345
+
the <adata-link-type="dfn" href="#text-scale-factor" id="ref-for-text-scale-factor③">text scale factor</a> is the font scale factor
1351
1346
the user has chosen from any settings provided <i>only</i> by the user agent.
1352
1347
The <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css-env-1/#valdef-env-preferred-text-scale" id="ref-for-valdef-env-preferred-text-scale②">preferred-text-scale</a> environment variable value must be 1 on desktop platforms.</p>
1353
1348
<p>On mobile platforms:</p>
1354
1349
<ul>
1355
1350
<li>
1356
1351
1357
1352
If the operating system provides a text scale setting AND
1358
-
the UA hasn’t already applied that factor to the <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css2/#valdef-font-size-medium" id="ref-for-valdef-font-size-medium④">medium</a> font size,
1353
+
the UA hasn’t already applied that factor to the <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css2/#valdef-font-size-medium" id="ref-for-valdef-font-size-medium①">medium</a> font size,
1359
1354
the <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css-env-1/#valdef-env-preferred-text-scale" id="ref-for-valdef-env-preferred-text-scale③">preferred-text-scale</a> environment variable returns the multiplier
1360
1355
that the user has chosen in the operating system’s text scale setting.
the <adata-link-type="dfn" href="#text-scale-factor" id="ref-for-text-scale-factor⑤">text scale factor</a> matches the user’s preferred paragraph text size
1364
+
the <adata-link-type="dfn" href="#text-scale-factor" id="ref-for-text-scale-factor④">text scale factor</a> matches the user’s preferred paragraph text size
1370
1365
(as determined from a combination of OS and UA preferences)
1371
1366
divided by 16px.</p>
1372
-
<p>The <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css-env-1/#valdef-env-preferred-text-scale" id="ref-for-valdef-env-preferred-text-scale⑤">preferred-text-scale</a> environment variable must return the <adata-link-type="dfn" href="#text-scale-factor" id="ref-for-text-scale-factor⑥">text scale factor</a>.</p>
1367
+
<p>The <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css-env-1/#valdef-env-preferred-text-scale" id="ref-for-valdef-env-preferred-text-scale⑤">preferred-text-scale</a> environment variable must return the <adata-link-type="dfn" href="#text-scale-factor" id="ref-for-text-scale-factor⑤">text scale factor</a>.</p>
1373
1368
<p>Further, when the value of the <adata-link-type="dfn" href="#text-scale" id="ref-for-text-scale⑤">text-scale</a> content attribute is
1374
1369
<adata-link-type="dfn" href="#text-scale-scale" id="ref-for-text-scale-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 <ahref="https://drafts.csswg.org/css-size-adjust-1/#intro"><cite>CSS Size Adjustment 1</cite> § 1 Introduction</a>) and full-application zoom (<ahref="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>.</p>
<codeclass="highlight"><meta name=<c-s>"text-scale"</c-> content=<c-s>"scale"</c->></code> in stylesheets so that the <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css2/#valdef-font-size-medium" id="ref-for-valdef-font-size-medium⑤">medium</a> 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 <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css-values-4/#rem" id="ref-for-rem">rem</a> throughout the page to honor the user’s font preferences.</p>
1372
+
<codeclass="highlight"><meta name=<c-s>"text-scale"</c-> content=<c-s>"scale"</c->></code> in stylesheets so that the <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css2/#valdef-font-size-medium" id="ref-for-valdef-font-size-medium②">medium</a> 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 <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css-values-4/#rem" id="ref-for-rem">rem</a> throughout the page to honor the user’s font preferences.</p>
1378
1373
<divclass="example" id="ex-scaled-page">
1379
1374
<aclass="self-link" href="#ex-scaled-page"></a>
1380
1375
If authors don’t alter the <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/selectors-4/#root-pseudo" id="ref-for-root-pseudo">:root</a> font size, content sized with <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css-values-4/#rem" id="ref-for-rem①">rem</a> units will be relative to the preferred text scale
"15a266c1": {"dfnID":"15a266c1","dfnText":"medium","external":true,"refSections":[{"refs":[{"id":"ref-for-valdef-font-size-medium"},{"id":"ref-for-valdef-font-size-medium\u2460"},{"id":"ref-for-valdef-font-size-medium\u2461"},{"id":"ref-for-valdef-font-size-medium\u2462"}],"title":"2. \nText-Scale meta element"},{"refs":[{"id":"ref-for-valdef-font-size-medium\u2463"}],"title":"2.2. The legacy keyword"},{"refs":[{"id":"ref-for-valdef-font-size-medium\u2464"}],"title":"2.3. The scale keyword"}],"url":"https://drafts.csswg.org/css2/#valdef-font-size-medium"},
3028
+
"15a266c1": {"dfnID":"15a266c1","dfnText":"medium","external":true,"refSections":[{"refs":[{"id":"ref-for-valdef-font-size-medium"}],"title":"2. \nText-Scale meta element"},{"refs":[{"id":"ref-for-valdef-font-size-medium\u2460"}],"title":"2.2. The legacy keyword"},{"refs":[{"id":"ref-for-valdef-font-size-medium\u2461"}],"title":"2.3. The scale keyword"}],"url":"https://drafts.csswg.org/css2/#valdef-font-size-medium"},
3034
3029
"15f5b381": {"dfnID":"15f5b381","dfnText":"<percentage>","external":true,"refSections":[{"refs":[{"id":"ref-for-percentage-value"}],"title":"4.4. \nGlyph Size Multiplier:\nthe size-adjust descriptor"},{"refs":[{"id":"ref-for-percentage-value\u2460"},{"id":"ref-for-percentage-value\u2461"},{"id":"ref-for-percentage-value\u2462"},{"id":"ref-for-percentage-value\u2463"}],"title":"4.5. \nLine Height Font Metrics Overrides:\nthe ascent-override, descent-override, and line-gap-override descriptors"},{"refs":[{"id":"ref-for-percentage-value\u2464"},{"id":"ref-for-percentage-value\u2465"},{"id":"ref-for-percentage-value\u2466"},{"id":"ref-for-percentage-value\u2467"},{"id":"ref-for-percentage-value\u2468"}],"title":"4.6. \nSuperscript and subscript metrics overrides:\nthe superscript-position-override, subscript-position-override,superscript-size-override and subscript-size-override descriptors"}],"url":"https://drafts.csswg.org/css-values-4/#percentage-value"},
3035
3030
"16310992": {"dfnID":"16310992","dfnText":"<number>","external":true,"refSections":[{"refs":[{"id":"ref-for-number-value"},{"id":"ref-for-number-value\u2460"},{"id":"ref-for-number-value\u2461"},{"id":"ref-for-number-value\u2462"}],"title":"3.4. \nRelative sizing: the font-size-adjust property"},{"refs":[{"id":"ref-for-number-value\u2463"},{"id":"ref-for-number-value\u2464"},{"id":"ref-for-number-value\u2465"},{"id":"ref-for-number-value\u2466"}],"title":"4.3. \nFont property descriptors: the font-size\n"}],"url":"https://drafts.csswg.org/css-values-4/#number-value"},
3036
3031
"1c5240b0": {"dfnID":"1c5240b0","dfnText":"vertical typographic mode","external":true,"refSections":[{"refs":[{"id":"ref-for-vertical-typographic-mode"}],"title":"4.6. \nSuperscript and subscript metrics overrides:\nthe superscript-position-override, subscript-position-override,superscript-size-override and subscript-size-override descriptors"}],"url":"https://drafts.csswg.org/css-writing-modes-4/#vertical-typographic-mode"},
"font-tech-values": {"dfnID":"font-tech-values","dfnText":"<font-tech>","external":false,"refSections":[{"refs":[{"id":"ref-for-font-tech-values"}],"title":"4.2.1. Parsing the src descriptor"}],"url":"#font-tech-values"},
3147
3142
"propdef-font-size-adjust": {"dfnID":"propdef-font-size-adjust","dfnText":"font-size-adjust","external":false,"refSections":[{"refs":[{"id":"ref-for-propdef-font-size-adjust"},{"id":"ref-for-propdef-font-size-adjust\u2460"},{"id":"ref-for-propdef-font-size-adjust\u2461"},{"id":"ref-for-propdef-font-size-adjust\u2462"},{"id":"ref-for-propdef-font-size-adjust\u2463"},{"id":"ref-for-propdef-font-size-adjust\u2464"},{"id":"ref-for-propdef-font-size-adjust\u2465"},{"id":"ref-for-propdef-font-size-adjust\u2466"},{"id":"ref-for-propdef-font-size-adjust\u2467"},{"id":"ref-for-propdef-font-size-adjust\u2468"},{"id":"ref-for-propdef-font-size-adjust\u2460\u24ea"},{"id":"ref-for-propdef-font-size-adjust\u2460\u2460"},{"id":"ref-for-propdef-font-size-adjust\u2460\u2461"},{"id":"ref-for-propdef-font-size-adjust\u2460\u2462"}],"title":"3.4. \nRelative sizing: the font-size-adjust property"},{"refs":[{"id":"ref-for-propdef-font-size-adjust\u2460\u2463"}],"title":"4.4. \nGlyph Size Multiplier:\nthe size-adjust descriptor"},{"refs":[{"id":"ref-for-propdef-font-size-adjust\u2460\u2464"},{"id":"ref-for-propdef-font-size-adjust\u2460\u2465"}],"title":"4.5. \nLine Height Font Metrics Overrides:\nthe ascent-override, descent-override, and line-gap-override descriptors"}],"url":"#propdef-font-size-adjust"},
3148
3143
"text-scale": {"dfnID":"text-scale","dfnText":"\"text-scale\"","external":false,"refSections":[{"refs":[{"id":"ref-for-text-scale"}],"title":"2. \nText-Scale meta element"},{"refs":[{"id":"ref-for-text-scale\u2460"},{"id":"ref-for-text-scale\u2461"}],"title":"2.1. \nKeywords"},{"refs":[{"id":"ref-for-text-scale\u2462"}],"title":"2.2. The legacy keyword"},{"refs":[{"id":"ref-for-text-scale\u2463"},{"id":"ref-for-text-scale\u2464"}],"title":"2.3. The scale keyword"}],"url":"#text-scale"},
3149
-
"text-scale-factor": {"dfnID":"text-scale-factor","dfnText":"text scale factor","external":false,"refSections":[{"refs":[{"id":"ref-for-text-scale-factor"},{"id":"ref-for-text-scale-factor\u2460"}],"title":"2. \nText-Scale meta element"},{"refs":[{"id":"ref-for-text-scale-factor\u2461"},{"id":"ref-for-text-scale-factor\u2462"}],"title":"2.1. \nKeywords"},{"refs":[{"id":"ref-for-text-scale-factor\u2463"}],"title":"2.2. The legacy keyword"},{"refs":[{"id":"ref-for-text-scale-factor\u2464"},{"id":"ref-for-text-scale-factor\u2465"}],"title":"2.3. The scale keyword"}],"url":"#text-scale-factor"},
3144
+
"text-scale-factor": {"dfnID":"text-scale-factor","dfnText":"text scale factor","external":false,"refSections":[{"refs":[{"id":"ref-for-text-scale-factor"}],"title":"2. \nText-Scale meta element"},{"refs":[{"id":"ref-for-text-scale-factor\u2460"},{"id":"ref-for-text-scale-factor\u2461"}],"title":"2.1. \nKeywords"},{"refs":[{"id":"ref-for-text-scale-factor\u2462"}],"title":"2.2. The legacy keyword"},{"refs":[{"id":"ref-for-text-scale-factor\u2463"},{"id":"ref-for-text-scale-factor\u2464"}],"title":"2.3. The scale keyword"}],"url":"#text-scale-factor"},
3150
3145
"text-scale-legacy": {"dfnID":"text-scale-legacy","dfnText":"legacy","external":false,"refSections":[{"refs":[{"id":"ref-for-text-scale-legacy"}],"title":"2. \nText-Scale meta element"},{"refs":[{"id":"ref-for-text-scale-legacy\u2460"},{"id":"ref-for-text-scale-legacy\u2461"}],"title":"2.2. The legacy keyword"}],"url":"#text-scale-legacy"},
3151
3146
"text-scale-scale": {"dfnID":"text-scale-scale","dfnText":"scale","external":false,"refSections":[{"refs":[{"id":"ref-for-text-scale-scale"},{"id":"ref-for-text-scale-scale\u2460"}],"title":"2.3. The scale keyword"}],"url":"#text-scale-scale"},
0 commit comments