-
Notifications
You must be signed in to change notification settings - Fork 762
[css-fonts-5] Define behavior for <meta text-scale> from #12380 #13052
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
8d5f5e2
18f2f8b
b729d74
0206973
c287984
f6d1a0c
3716341
828b01e
65d7813
caed642
3aaa4f7
cc30fb8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,7 +59,63 @@ rules defined in CSS Fonts Level 4. | |
| This specification is currently a delta to the CSS Fonts Level 4 specification. | ||
| Do not assume that if something is not here, it has been dropped. | ||
|
|
||
| <h2 id="text-scale-meta"> | ||
| Text-Scale <code class=html><meta></code> element</h2> | ||
|
|
||
| A document with a <code><meta></code> tag whose <code>name</code> attribute | ||
davidsgrogan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| is a <a>ASCII case-insensitive</a> match for | ||
| <dfn lt=text-scale><code>"text-scale"</code></dfn> is recognized as setting the | ||
| initial font size of the document. The value of the <code>content</code> | ||
davidsgrogan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| attribute must be an <a>ASCII case-insensitive</a> match for one of the | ||
davidsgrogan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| recognized keywords. | ||
|
|
||
| Documents without this <code><meta></code> tag will have an assumed default | ||
| value of <code>legacy</code>. | ||
|
|
||
davidsgrogan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <h3 id="text-scale-meta-keywords"> | ||
| Keywords</h3> | ||
|
|
||
| The recognized keywords in the [=text-scale=] | ||
| <code class=html><meta></code> element are: | ||
|
|
||
| <ul> | ||
| <li><code class="index" lt="legacy!!text-scale-meta">legacy</code></li> | ||
| <li><code class="index" lt="scale!!text-scale-meta">scale</code></li> | ||
| </ul> | ||
|
||
|
|
||
| <h3 id="legacy-keyword">The 'legacy' keyword</h3> | ||
|
|
||
| The <dfn for="text-scale" export><code>legacy</code></dfn> property is | ||
| recognized in the [=text-scale=] content attribute value. | ||
|
|
||
| When the value of the [=text-scale=] content attribute is | ||
| <a for="text-scale">legacy</a> the user agent should set the initial font size | ||
davidsgrogan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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: | ||
| <ul> | ||
| <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. | ||
davidsgrogan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Note: As of this writing, all combinations of Android, iOS, Gecko, WebKit, Blink satisfy this first condition. | ||
davidsgrogan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| </li> | ||
| <li>Otherwise ''env()/preferred-text-scale'' returns 1.</li> | ||
| </ul> | ||
|
|
||
| <h3 id="scale-keyword">The 'scale' keyword</h3> | ||
|
|
||
| The <dfn for="text-scale" export><code>scale</code></dfn> property is | ||
| recognized in the [=text-scale=] content attribute value. | ||
|
|
||
| When the value of the [=text-scale=] content attribute is | ||
| <a for=text-scale>scale</a> the user agent may determine the initial font size | ||
| based on a combination of the operating system's text scale setting and the user agent's text scale setting. The | ||
davidsgrogan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ''env()/preferred-text-scale'' value must be a number that, when multiplied by | ||
| 16px, provides a <<length>> that matches that of the initial font size. | ||
|
|
||
| Further, when the value of the [=text-scale=] content attribute is | ||
| <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>. | ||
|
|
||
| Note: It is expected that authors will use | ||
davidsgrogan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ''<meta name="text-scale" content="scale">'' in stylesheets so that the initial 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. | ||
davidsgrogan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| <h3 id="values"> | ||
| Value Definitions</h3> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.