This new CSS capability empowers web developers to precisely fit lines of text to the exact width of their containing element. Unlike traditional justification methods that adjust spacing, this feature dynamically scales the font-size itself, ensuring text lines seamlessly align with both the left and right edges of the container. Web developers often need to ensure text content, especially headings or short phrases, fully utilizes the available container width without causing overflow or appearing too narrow. This feature addresses this by intelligently adjusting the font-size of the text. It's particularly useful in responsive designs or when dealing with dynamic content, such as text from translations that might be unexpectedly long, or user-generated input where word length is unpredictable. If a word or line of text would normally overflow its container, these CSS properties will reduce the font-size to make it fit. Conversely, if the text is narrower than the container, the font-size can be increased to fill the space, providing a visually balanced and "justified" appearance through size scaling rather than space distribution.
None
None
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
None
No milestones specified
To backlink it here, I wrote my feedback about the explainer in a blog post: “Fit-to-Width Discussions & Feedback” — it also covers the potential accessibility issues that were brought up in the CSSWG issue, and proposes a potential way to mitigate them.