Re: [csswg-drafts] [css-fonts-5] Feature for making text always fit the width of its parent (#2528)

Um, couldn't this all perhaps be a bit easier?  I always thought of this feature like this: You have for example the usual stage-filling banner at the top of the page with a large headline. You are using e.g. a CMS and the text is variable (perhaps even translated to different languages). You want to make that headline as large as possible. Up until now, I would be quite conservative and use like 24px, because I don't know how long that headline might be for all pages. In most cases though, the headline could be larger. So, the font-size: 24px is basically a lower bound. 

In the future, I could say: font-size: 24px-or-more. That would make the headline as large as possible before it needs to wrap around. In ideal world, I could even specify a number of lines or a height - not only fit to a single line.

Now, the first important thing here is, that the headline only gets larger. I don't see an accessibility problem there. Next, the calculation should IMHO be done as if the zoom level was at 100%. If the result of this calculation in a specific case is e.g. that 48px would be the maximum until the headline wraps around (or consumes more than the given number of lines), then the factor would be 2.0. Now if I zoom to 200%, the font-size should be 96px - even if more lines are created. This way, the zoom level would still take full effect and we wouldn't have that problem with accessibility. It's the same as if I specified 48px just for this page right away. Hope it makes sense. Just my 0.02€...





-- 
GitHub Notification of comment by rgpublic
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2528#issuecomment-2786016424 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 8 April 2025 10:44:49 UTC