Variable font size for a html type asset

Hi,

i am just wondering how can I have a variable font size for a html type asset with a defined height and width. What would be the best way to achieve this?

Yes, mergefield in the html asset css works:

 "css": "p { color: #ffffff; font-size: {{font_size}}; font-family: Montserrat ExtraBold; text-align: left }"

This is currently available through the API!

Hi @robbo apologies, let me clarify what I mean. I have a defined width and height for my container where my text will be but I do not know what the exact word count will be within this container. Is there a way to automatically adjust the font size if the words do not start to fit in completely within the parameters with the starting font size ?

Hi @bobble!

Do you have an example of your json we could take a look at?
We don’t have a way to automatically adjust the font size for you so you will need to calculate the font size based on the word count to make it fit.