-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
text-wrap: balance #561
Comments
I would be interested in seeing interop regarding the related longhand properties (white-space-collapse, white-space, text-wrap-style/mode). Chrome currently implements an old version of the properties. |
@nt1m do you know if there are tests for those longhand properties? |
Yes I updated them recently: https://wpt.fyi/results/css/css-text/parsing?label=master&label=experimental&aligned&q=text-wrap |
Hmm, there are none testing specifically text-wrap-mode / text-wrap-style but they could be added pretty easily. Only tests for the shorthand right now. |
Blink shipped It looks like Gecko is going to ship |
It would be good to exclude interaction with floats / line-clamp from the focus area. |
@nt1m does that mean the test with "float" or "line-clamp" in their names in https://wpt.fyi/results/css/css-text/white-space?label=master&label=experimental&aligned&q=balance? |
Yes. I think it's more important that all browsers get the shorthands / longhands right: https://wpt.fyi/results/css/css-text/parsing?label=master&label=experimental&aligned&q=text-wrap Otherwise, it will lead to web compat issues in the future, especially with Chrome supporting |
This proposal has been accepted as part of Interop 2024! On behalf of the entire Interop team, thank you for proposing it. You’ll be able to track progress on this topic throughout the year via the Interop 2024 dashboard. |
Description
text-wrap: balance
adjusts line breaking to balance the lengths of lines in a paragraph, for better readability and to prevent typographic widows. This feature is often used in headlines. It is also called headline balancing.WebVTT also uses
text-wrap: balance
.Specification
https://drafts.csswg.org/css-text-4/#valdef-text-wrap-style-balance
Open Issues
https://github.com/w3c/csswg-drafts/issues?q=is%3Aissue+is%3Aopen+text-wrap+balance
Tests
https://wpt.fyi/results/css/css-text/white-space?label=master&label=experimental&aligned&q=balance
https://wpt.fyi/results/css/css-text/parsing/text-wrap-valid.html?label=master&label=experimental&aligned
Current Implementations
Standards Positions
mozilla/standards-positions#755
WebKit/standards-positions#143
Browser bug reports
https://bugzilla.mozilla.org/show_bug.cgi?id=1731541
https://bugs.webkit.org/show_bug.cgi?id=249840
Developer discussions
https://clagnut.com/blog/2424
https://medium.com/swlh/typographic-orphans-on-the-web-266e32f756fe
Polls & Surveys
https://2023.stateofcss.com/en-US/features/typography/#text_wrap_balance
There are 20 freeform comments here, for example "Waiting for support to be above 90%, very cool feature"
It's also in the "Other Answers" section of https://2023.stateofcss.com/en-US/usage/#css_interoperability_features. Note also Devographics/Monorepo#324 if comparing the number of "Other Answers" to the main view.
Existing Usage
https://chromestatus.com/metrics/feature/timeline/popularity/4544
Workarounds
No response
Accessibility Impact
No response
Privacy Impact
No response
Other
Blink's Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/f5eLz6PIXaI/m/R__N3BdjAAAJ
https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=12038 is a quick test of support. Resize the window until the line breaks and see where the line break happens.
Although the implementation bugs for Gecko and WebKit are closed, I wasn't able to make this test work. It looks like in Safari Technology Preview it's behind a "CSS text-wrap: balance stable pretty" flag which is disabled by default. For Firefox, I couldn't find anything in about:config.
The text was updated successfully, but these errors were encountered: