How to size dynamic content macro

We have inline dynamic content macros that are always 300px wide. If the content is narrow then white space padding is added to make it 300px and if the content is wide then a scrollbar is rendered.

We are using AP.resize() (without arguments) on window load but our macro isn’t getting resized.
https://developer.atlassian.com/cloud/jira/platform/jsapi/ap/

Should our body element use the ac-content class? I don’t understand the comment in the docs: " Only content within an element with the class ac-content will be resized automatically. Content without this identifier is sized according to the body element, and will dynamically grow, but not shrink."

What do we need to do for our macro to be rendered at the width of its content?

Thanks!