lookbook-hq / lookbook

A UI development environment for Ruby on Rails apps ✨
https://lookbook.build
MIT License
881 stars 91 forks source link

How to resize previews in pages? #469

Closed dkniffin closed 11 months ago

dkniffin commented 1 year ago

Is your feature request related to a problem? Please describe

I am creating docs using the pages feature. With it, I'm using the embed helper to render a component. The embed works correctly. However, it's only about 200px tall, and it's hard to see the large component.

Describe the solution you'd like

I would like an option to resize the embed. Something like a height param would work. Or a style param that I can pass CSS to.

Describe alternatives you've considered

I did look into passing a style param. It looks like the JS supports that. However, the component does not. Even so, when I manually include <lookbook-embed style="height: 1000px" ...>, the height is not kept around. As far as I can tell, that's due to the iframe-resizer library, but I'm not sure.

allmarkedup commented 1 year ago

@dkniffin the embeds should automatically resize to match the height of the content of the iframe - for example the embed here: http://demo.lookbook.build/lookbook/pages/embeds if you add more content via the param fields the iframe height should automatically increase to accommodate the changes.

If that's not happening then it's a bug - could you maybe upload a screenshot of the embedded component? And let me know what browser you are using? Then I can try and dig into it for you.

dkniffin commented 11 months ago

Hey, sorry I never replied here. I was planning on looking into this pretty quickly after your reply, then never got around to it, and now this feature in my app has been deprioritized 😅 I'll report back here when I eventually look into this.

allmarkedup commented 11 months ago

@dkniffin no worries! If/when you pick it up again just let me know if you are still running into any issues.