Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
no bs edits
  • Loading branch information
davidsgrogan committed Nov 2, 2025
commit 8d5f5e2f21ef13b8684a5c1337cc598401f2e170
57 changes: 57 additions & 0 deletions css-fonts-5/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,64 @@ 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>&lt;meta&gt;</code> element</h2>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed the HTML spec also mentions when a metadata name should not appear more than once in the document. Maybe you should add this line somewhere:

There must not be more than one meta element with its name attribute value set to an ASCII case-insensitive match for text-scale per document.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


A document with a <code>&lt;meta></code> tag whose <code>name</code> attribute
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>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not setting the initial font size. We're setting the computed value of the medium font-size, and scaling all the other absolute size keywords accordingly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

attribute must be an <a>ASCII case-insensitive</a> match for one of the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must -> otherwise what?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added 'Otherwise the tag is ignored.'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering specifying the 'otherwise' case is neccessary here, because, to me, the HTML spec seems to imply it is ignored anyway.

recognized keywords.

Documents without this <code>&lt;meta></code> tag will have an assumed default
value of <code>legacy</code>.

<h3 id="text-scale-meta-keywords">
Keywords</h3>

The recognized keywords in the [=text-scale=]
<code class=html>&lt;meta&gt;</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>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to follow the DL format that we have for property values: list them in the DT with a DFN tag, and give them a definition that's understandable to authors wrt what they do.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave it a try. Let me know if you meant something different.


<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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should or must? If not must, under what conditions is it reasonable to ignore the should?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to must.

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.</li>
<li>Otherwise ''env()/preferred-text-scale'' returns 1.</li>
</ul>

Note: As of this writing, all combinations of Android, iOS, Gecko, WebKit, Blink qualify for the first bullet point above.

<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
''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-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>.

See the <a href="https://github.com/w3c/csswg-drafts/blob/main/css-env-1/explainers/env-preferred-text-scale.md#windows-11">
preferred text scale explainer</a> for more details.

Note: It is expected that authors will use
''&lt;meta name="text-scale" content="scale"&gt;'' 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.

<h3 id="values">
Value Definitions</h3>
Expand Down