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
Prev Previous commit
Next Next commit
Josh's suggestions from review round 1
- Sentence about >1 meta tag
- s/medium/initial/g
- earlier example
  • Loading branch information
davidsgrogan committed Nov 12, 2025
commit c287984e222a6ce184eb937b77856a62192d1e30
36 changes: 26 additions & 10 deletions css-fonts-5/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Do not assume that if something is not here, it has been dropped.
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 <{meta}> tag
whose <code>name</code> attribute
whose <{meta/name}> attribute
is a <a>ASCII case-insensitive</a> match for
<dfn lt=text-scale><code>"text-scale"</code></dfn>
is recognized as setting the computed value
Expand All @@ -75,9 +75,15 @@ The value of the <code>content</code>
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. Otherwise the tag is ignored.

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

<div class="example" id="ex-text-scale">
<pre>&lt;meta name="text-scale" content="scale" /></pre>
</div>

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.

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

Expand All @@ -88,11 +94,15 @@ The recognized keywords in the [=text-scale=]
<dt><dfn for="text-scale">legacy</dfn></dt>
<dd>''env()/preferred-text-scale'' returns the user's OS-level font factor on mobile,
but 1 on desktop.
The document's initial font size only incorporates UA-level font preferences.
OS-level font preferences are ignored.</dd>
The document's ''font-size/medium'' font size incorporates UA-level font preferences.
OS-level font preferences are ignored.

Note: Equivalent to omitting a [=text-scale=] <{meta}> tag or
including an unrecognized content attribute keyword.
</dd>
<dt><dfn>scale</dfn></dt>
<dd>''env()/preferred-text-scale'' returns the user's OS-level font preferences.
The document's initial font size incorporates both UA-level and OS-level font preferences.</dd>
The document's ''font-size/medium'' font size incorporates both UA-level and OS-level font preferences.</dd>
</dl>

<h3 id="legacy-keyword">The 'legacy' keyword</h3>
Expand All @@ -106,9 +116,15 @@ 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Wherever you reference the preferred-text-scale env(), maybe it should be prefixed with 'environment variable' in the prose. Since this is not the css-env spec, it's not clear that you're referencing an env().

Copy link
Member Author

Choose a reason for hiding this comment

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

Bikeshed linkifies ''preferred-text-scale'' to https://drafts.csswg.org/css-env-1/#valdef-env-preferred-text-scale. Do you think that's sufficient? (I couldn't tell if you already knew the linkification part)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I'm using the Bikeshed preview tool and I'm aware of the linkification, but still think it would be useful to say something like:

The ''preferred-text-scale'' environment variable value must be 1 on desktop platforms.

That matches how it's worded in the css-env-1 spec as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, ok, will 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.

And aside, how do you use that preview tool for this PR? Do you put something into the "Load from URL" box?
Screenshot 2025-11-14 at 1 49 53 PM

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. And yeah I just pasted the URL of the 'raw' version of the BS file on GitHub.

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 multiplier that the user has chosen in the operating system's text scale setting.
<li>if the operating system provides a text scale setting AND
the UA hasn't already applied that factor to the ''font-size/medium'' font size,
''env()/preferred-text-scale'' returns the multiplier
that the user has chosen in the operating system's text scale setting.

Note: As of this writing, all combinations of Android, iOS, Gecko, WebKit, Blink satisfy this first condition.
Note: At the time of publishing, all combinations of
Android, iOS,
Gecko, WebKit, Blink
satisfy this first condition.

</li>
<li>Otherwise ''env()/preferred-text-scale'' returns 1.</li>
Expand All @@ -125,13 +141,13 @@ computed ''font-size/medium'' font size must match the user's preferred paragrap

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.
provides a <<length>> that matches that of the ''font-size/medium'' 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
''&lt;meta name="text-scale" content="scale"&gt;'' 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.
Note: Authors are expected to use
''&lt;meta name="text-scale" content="scale"&gt;'' 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.

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