What if I will tell you how we could solve fit-to-width text with pure #CSS without any hardcoded parameters? Curiously, scroll-driven animations will allow us to do just that!

Welcome my new article — “Fit-to-Width Text” — where I continue exploring the experimental implementations of the latest specs.

https://kizu.dev/fit-to-width-text/

Fit-to-Width Text

What if I will tell you how we could solve fit-to-width text with pure CSS without any hardcoded parameters? Curiously, scroll-driven animations will allow us to do just that! Join me as I continue exploring the experimental implementations of the latest specs.

@kizu there’s a much simpler way to implement fit to width text using plain css.

it also has wider support across browsers except may be in Safari where it is supported but a little bit corny. 🙏🏻

@marvindanig Which method did you have in mind? If the one using viewport/container length units — it requires hardcoding the font-size for the particular text.
@kizu i think you’re right. i was considering vmin based typography, but it wouldn’t account for resizing as the text is being written into the box. 🙌