#822: text-wrap: balance

Visit on Github.

Opened Feb 28, 2023

Hello TAG!

I'm requesting a TAG review of the text-wrap: balance CSS property.

This feature adjusts line breaking to balance the length of each line box in a block, for better readability and to prevent typographic widows. This feature is often used in headlines.

There are several JavaScript libraries to achieve this effect, such as NYTimes text balancer, React Wrap Balancer, or Adobe Balance Text.

Jen's tweet has a sample image, and it got a lot of positive responses from web developers.

  • Explainer¹ (minimally containing user needs and example code): url
  • Specification URL: spec url
  • Tests: wpt folder(s), if available
  • User research: [url to public summary/results of research]
  • Security and Privacy self-review²: [url]
  • GitHub repo (if you prefer feedback filed there): [url]
  • Primary contacts (and their relationship to the specification):
    • @kojiishi (Implementer), @bfgeek (Implementer), @fantasai (Spec Editor)
  • Organization(s)/project(s) driving the specification: Google
  • Key pieces of existing multi-stakeholder review or discussion of this specification:
  • External status/issue trackers for this specification (publicly visible, e.g. Chrome Status): https://chromestatus.com/feature/5196960707903488

Further details:

  • I have reviewed the TAG's Web Platform Design Principles
  • Relevant time constraints or deadlines: Implementation complete.
  • The group where the work on this specification is currently being done: CSSWG
  • The group where standardization of this work is intended to be done (if current group is a community group or other incubation venue): CSSWG
  • Major unresolved issues with or opposition to this specification:
  • This work is being funded by: Blink implementation is being done by Google.

💬 leave review feedback as a comment in this issue and @-notify [github usernames]

Discussions

Discussed Mar 13, 2023 (See Github)

Lea: process should be if there's no objection in channel - rather... People should be more active on slack...

Lea: things should not be accepted and closed summarilly without people looking at it.

Lea: a lot of excitement in the open community about this.

we leave to async process to close

Hi - just a quick request hopefully - we noticed that the explainer is a google doc, not in a markdown next to the spec.  There doesn't appear to be an answer to the security & privacy questionnaire. The chrome status also doesn't reflect the reality as shown by the web platform tests info. We recognise that this is already in the spec and there's significant developer support but can you please update the request info so we can progress?

Dan: leaves comment

Comment by @torgo Mar 13, 2023 (See Github)

Hi - just a quick request hopefully - we noticed that the explainer is a google doc, not in a markdown next to the spec. There doesn't appear to be an answer to the security & privacy questionnaire. The chrome status also doesn't reflect the reality as shown by the web platform tests info. We recognise that this is already in the spec and there's significant developer support but can you please update the request info so we can progress?

Comment by @kojiishi Mar 15, 2023 (See Github)

Hi @torgo, thanks for the feedback. This is the first time I submit requests here, appreciate your support.

Can you tell me where the "security & privacy questionnaire"? This is a layout feature that doesn't do anytying with external servers, so I don't think it has any impacts to security & privacy, but when I wrote this based on #801 baseline-source, I didn't find any. The CSS Text Level 4 spec Privacy and Security Considerations has some description:

This specification introduces no new security considerations.

This specification leaks the user’s installed hyphenation and line-breaking dictionaries.

This feature supports blocks with hyphenations and line-breaking dictionaries at the same level as this feature is off; i.e., no new leaks due to this feature. Does this answer your question?

The chrome status also doesn't reflect the reality as shown by the web platform tests info.

Could you explain a bit more which part of "the chrome status" doesn't look reflecting the reality to you? Happy to fix errors if any.

The wpt.fyi has one failure, it's because the Chrome build on wpt.fyi hasn't incorporated the fix (it looks like the tests come to wpt before the fix) so it should be green sometime soon. Is this what you're talking about?

Discussed Mar 20, 2023 (See Github)

Tess: I think we can close it. They've thought about the issue.. Algorithmic complexity... 10 or more lines...

Peter: just for screen?

Tess: in most browsers the user experience of print styles being different from screen styles confuses people.. it's worth raising...

Rossen: what's the printing point?

Tess: if you're printing the UA can...

agreed to close with satisified

Comment by @LeaVerou Mar 20, 2023 (See Github)

Hi there, we looked at this again today and agreed this looks good to us.

Comment by @kojiishi Apr 17, 2023 (See Github)

Thank you so much.