bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Class text balanced

Open julien-deramond opened this issue 8 months ago • 3 comments

Discussed in https://github.com/orgs/twbs/discussions/41368

Originally posted by abielmagudev April 12, 2025 Hi friends, can you add a class for balanced text?

.text-balanced {
  text-wrap: balance;
}
<p class="text-balanced">This is a text balanced by a class of CSS.</p>

julien-deramond avatar Apr 16 '25 15:04 julien-deramond

I think the class name should be text-balance rather than text-balanced

Then it exactly matches the text-wrap property value.

FWIW; Tailwind use text-balance too: https://tailwindcss.com/docs/text-wrap#quick-reference

(I was considering suggesting text-wrap-balance, but it's a bit long and unnecessarily verbose probably)

cc @viniciusvts

coliff avatar May 07 '25 13:05 coliff

text balance is the same with text-nowrap?

rootasuser avatar Jun 02 '25 08:06 rootasuser

text balance is the same with text-nowrap?

no, it's different. Check https://developer.chrome.com/docs/css-ui/css-text-wrap-balance

coliff avatar Jun 02 '25 08:06 coliff