Playing with text-fit

Playing with text-fit title above an HTML panel with h1 { text-fit: grow } and the heading “This might be very nice!” rendered large below, beside a headshot.

Krijn Hoetmer explores the new text-fit CSS property, filling the gap while docs are still sparse. It scales text automatically: grow enlarges from the base size, shrink reduces it to fit the container. Modes let you scale consistently, per line, or per line including the last, with optional percentages setting min and max limits. It only affects rendering, so the computed font-size stays put. For now, it’s only in Chrome 150.

krijnhoetmer.nl/log/2026/07/playing-with-text-fit