Balance headings with text-wrap
Use text-wrap balance to distribute words across short headings, and check the result at narrow widths without adding manual line breaks.
Your card title fits on one line on a wide page. At the width you use for a two-column grid, the browser wraps it and leaves production on a line by itself. A line break in the markup fixes that screenshot, then sticks around at widths where the whole title would fit.
Move the break with CSS
Use the same heading text with and without text-wrap: balance. The browser chooses different break points for the space it has. You can keep the words in one text node.
<h2 class="card-title">See application logs in production</h2>With ordinary wrapping and space for 24 monospace characters, production falls on the second line by itself.
Give the heading a width you can reproduce in a small test. The monospace font makes the word lengths easy to compare. In the component, keep the real font and let the card supply the available width.
.card-title {
font: 700 24px monospace;
inline-size: 24ch;
max-inline-size: 100%;
text-wrap: balance;
}In Chromium, the two lines become See application and logs in production.
diagram
Same heading, different break
Check the heading where it wraps
Apply it to the heading itself, then drag the viewport across the point where the second line appears. Check a narrow card with a longer title or a translation. Balance chooses from available break opportunities. A long unbroken word can still need an overflow rule of its own.
If the heading stays on one line and overflows, inspect its computed wrapping styles. A component with an ellipsis may set white-space: nowrap. Remove that constraint if the new design allows multiple lines. A browser that ignores the balance declaration still uses its normal wrapping.
Check the heading beside any badge or action that takes up space in the same row. That can move the point where the title wraps.