Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Resizing font based on container width using vanilla JS and while Loop Reply To: Resizing font based on container width using vanilla JS and while Loop

#275791
Shikkediel
Participant

I think you’d need to update contentHeight inside the loop, it currently stays at the value that was originally set (and if that is beyond the container height, it will loop infinitely).

Not that I would take this approach though, I would likely go with a single scale transform myself.