Skip to content

Add <meta name="text-scale" content="scale">#12530

Open
davidsgrogan wants to merge 1 commit into
whatwg:mainfrom
davidsgrogan:meta-pr
Open

Add <meta name="text-scale" content="scale">#12530
davidsgrogan wants to merge 1 commit into
whatwg:mainfrom
davidsgrogan:meta-pr

Conversation

@davidsgrogan

@davidsgrogan davidsgrogan commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

The goal is to give authors an easy way to respect the OS-level text scale setting. See the explainer for more details.

This spec text mostly references CSS. The color-scheme entry was used as a template.

Fixes #12526 .

(See WHATWG Working Mode: Changes for more details.)


/infrastructure.html ( diff )
/semantics.html ( diff )

@domfarolino domfarolino self-requested a review June 9, 2026 19:52
Comment thread source
<ul class="brief">
<li><dfn data-x-href="https://drafts.csswg.org/css-fonts/#first-available-font">first available font</dfn></li>
<li><dfn data-x-href="https://drafts.csswg.org/css-fonts-5/#text-scale">text-scale</dfn></li>
<li><dfn data-x-href="https://drafts.csswg.org/css-fonts-5/#text-scale-meta-keywords">text-scale keywords</dfn></li>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'll be the first to admit I really don't understand how CSS "levels" work or why they exist. But I will note that these links all have css-fonts-5 in them instead of css-fonts, so any reference to <ref>CSSFONTS</ref> will not go to Level 5 specification, but will instead appear to go to Level 4. What does this mean in practice?

Comment thread source
<p>The value must be a string that matches one of the <span>text-scale keywords</span> defined for the
<span>text-scale</span> metadata name in the CSS Fonts specification.</p>

<p>There must not be more than one <code>meta</code> element with its <code

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can run specfmt on this and it should rewrap it properly to maximize the number of characters per line up to 100, or you can do that manually.

Comment thread source

<dd>
<p>The value must be a string that matches one of the <span>text-scale keywords</span> defined for the
<span>text-scale</span> metadata name in the CSS Fonts specification.</p>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would change both of these lines above to:

    <p>The value must be a string that matches one of the <span>text-scale keywords</span> <ref>CSSFONTS</ref>.</p>

If we make this change, then maybe we can remove the link to text-scale in CSS?

Comment thread source
document">removed from the document</span>, or existing <code>meta</code> elements have their
<code data-x="attr-meta-name">name</code> or <code data-x="attr-meta-content">content</code>
attributes changed, user agents must process the <code>meta</code> element's state as defined
in CSS Fonts.</p>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there an algorithm to point to at all, or a section that describes this that we can link to?

Comment thread source
<p>There must not be more than one <code>meta</code> element with its <code
data-x="attr-meta-name">name</code> attribute value set to an
<span>ASCII case-insensitive</span> match for <code
data-x="meta-text-scale">text-scale</code> per document.</p>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This requirement is duplicated from https://drafts.csswg.org/css-fonts-5/#ref-for-text-scale:~:text=There%20must%20not%20be%20more%20than%20one%20meta%20element%20with%20its%20name%20attribute%20value%20set%20to%20an%20ASCII%20case%2Dinsensitive%20match%20for%20text%2Dscale%20per%20document.

How are we deciding what to port over from CSS here, what to keep their, and what to duplicate? It would be great to have as much of it as we can here, and have CSS just link to that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

<meta name="text-scale" content="scale" />

2 participants