Skip to content

[css-fonts-5][editorial] Add more meta text scale examples#14019

Open
davidsgrogan wants to merge 1 commit into
w3c:mainfrom
davidsgrogan:meta-examples
Open

[css-fonts-5][editorial] Add more meta text scale examples#14019
davidsgrogan wants to merge 1 commit into
w3c:mainfrom
davidsgrogan:meta-examples

Conversation

@davidsgrogan
Copy link
Copy Markdown
Member

Follow up to offline June 1 convo.

@davidsgrogan davidsgrogan changed the title [css-fonts-5] Add more meta text scale examples [css-fonts-5][editorial] Add more meta text scale examples Jun 5, 2026
@davidsgrogan davidsgrogan requested a review from fantasai June 5, 2026 23:10
@davidsgrogan
Copy link
Copy Markdown
Member Author

/cc @progers @JoshTumath

Comment thread css-fonts-5/Overview.bs
<meta name="text-scale" content="scale" />
<style>
.h1 {
--dampen-factor: calc(0.5 + 0.5 / env(preferred-text-scale));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What do you think of adding a comment and a little content, then showing an example of the content at 1.x, 2x, and 3.5x? This will encourage others to test large scales.

<meta name="viewport" content="width=device-width">
<meta name="text-scale" content="scale">
<style>
h1 {
  /*
    Multiply the 2em baseline by a dampening factor (between 1.0 to 0.5) to
    ensure headers scale up, but without getting too large. Here are the
    resulting font sizes at various text scale factors:
            h1      body
      1x    32px    16px
      1.5x  40px    24px
      2x    48px    32px
      3x    64px    48px
      3.5x  72px    56px
  */
  --dampen-factor: calc(0.5 + 0.5 / env(preferred-text-scale));
  font-size: calc(2em * var(--dampen-factor));
}
</style>
<h1>Header</h1>
This is some body text. The header grows slower than the body text.
Image

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants