I've got 3 items as a calendar header that (when there is enough space) should be in 1 row:
┌─────────────────────────────────────────┐
│ Month | Title, possibly long | Nav │
└─────────────────────────────────────────┘
<header class="calHeader">
<div class="calHeader__month">August 2022</div>
<div class="calHeader__title">A Dynamic Title</div>
<div class="calHeader__nav">Prev/Next</div>
</header>
The text in the middle item is a dynamic title and can be variable length.
On smaller screens and/or if the title is long enough to text wrap, I'd like that div to wrap to a new row:
┌─────────────────┐
│ Month | Nav │
│ ─────────────── │
│ Title, possibly │
| long │
└─────────────────┘
I haven't figured out how to do it, but it sure seems like some combination of auto-fill or grid auto placement would make it possible. I'm also open to flex or changing the HTML if needed. Using media queries isn't an option because the title length is variable/unknown so picking an arbitrary small breakpoint would work for shorter lengths but not longer and vice versa.