Fittext.js implementation on webflow

Heya, I crawled the web for days now to find a solution for my design which probably should be straight forward utilizing fittext.js

I have text inside a container and want to be able to automatically scale the text to the width of the container. fittext.js does this but I can’t make this work in webflow.

Does anyone have experience with this implementation?


Here is my site Read-Only: LINK
(how to share your site Read-Only link)

Didn’t get from your description what you are trying to achieve but this lib is 12 years and 9 years not maintained (check GitHub repo) . Since lib release the web technologies moved lightning years forward. Nowadays there are CSS properties such calc() or clamp() that can IMO solve your goal without using ancient lib. Search again with keywords “fluid text css” or “responsive text CSS”
here is one article example

m2c

1 Like

Thx Stan! I was hoping to find a more “elegant” solution but simply exported the text as svgs and set the width to 100%!

Will try your suggestions next time

1 Like

While this can be solution why you use SVG that is overkill, when CSS offers an “elegant” solution with functions I have mentioned applied directly on text. :man_shrugging:

Anyway, good luck :vulcan_salute:

I think in my case (with 80+ different names that need to be fit inside the container individually + new names being added in the future) it would be a bit more complex, hence the svg export. There‘s probably a way to do this, maybe in js, but the project doesn‘t allow for further exploration. Will maybe give this a second try in a couple of weeks