Summary:
The `text-wrap: balance` property can improve the layout of short blocks
of text (a few lines, such as a long headline) by adjusting the line
lengths to be more consistent.
...which could become:
The `text-wrap: balance` property can improve the layout of
short blocks of text (a few lines, such as a long headline)
by adjusting the line lengths to be more consistent.
Bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1731541
Specification:
https://drafts.csswg.org/css-text-4/#text-wrap-style
[see note below]
Standards Body:
W3C CSS Working Group
Platform coverage:
all
Preference:
layout.css.text-wrap-balance.enabled
DevTools bug:
n/a
Link to standards-positions discussion:
https://github.com/mozilla/standards-positions/issues/755
Other browsers:
Blink: shipping (since about 114, I believe)
WebKit: WIP, see
https://bugs.webkit.org/show_bug.cgi?id=259958
web-platform-tests:
/css/css-text/white-space/text-wrap-balance-*
[note]
Initially, I propose to implement a simple `text-wrap` longhand
property, to support the `text-wrap: balance` usage that is quickly
becoming popular. This corresponds to what Blink currently supports.
The CSS Working Group has resolved to restructure both the `white-space`
and `text-wrap` properties to become shorthands, with `balance` becoming
a value of the `text-wrap-style` longhand. This will be a
backward-compatible update, as `text-wrap` will become a shorthand and
will still accept the `balance` keyword.
The restructuring of `white-space` (and associated conversion of
`text-wrap` to a shorthand) has the potential to be a bit risky, given
the number values involved and the complexity of their interactions. In
addition, final spec details are still under discussion, so it seems
premature to proceed with this right now. So I propose to leave this for
a separate task. But `text-wrap: balance`, as already implemented in
Blink, is popular with web developers and it seems desirable to provide
this in Gecko without delay.