Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizing the preview iframe #1624

Closed
seniorquico opened this issue Aug 8, 2017 · 10 comments
Closed

Resizing the preview iframe #1624

seniorquico opened this issue Aug 8, 2017 · 10 comments

Comments

@seniorquico
Copy link

Is there an available method to style or resize the preview iframe?

I would like to preview my components at various "screen sizes" to test some responsive CSS rulesets. Right now, I have to go fullscreen and resize the browser or enable the device mode using Chrome/Safari devtools. I could see making the testing workflow for a scenario like this much easier if the navigation menu could remain visible and the preview iframe just changed in size.

I tried out the third-party addon storybook-host, but it creates/styles a div inside the preview iframe, skipping the responsive CSS rulesets.

@Hypnosphi
Copy link
Member

Have you tried this?

@seniorquico
Copy link
Author

@Hypnosphi Did you intend to include a link or reference?

@usulpro
Copy link
Member

usulpro commented Aug 9, 2017

@seniorquico It's default behavior of Storybook UI

@Hypnosphi
Copy link
Member

@seniorquico please click on "Have you tried this?" above

@seniorquico
Copy link
Author

seniorquico commented Aug 9, 2017

@Hypnosphi Weird, the expanding block doesn't work on Chrome 60 on my Win10 touch device. Got it on my phone.

Yes. I can resize the pane manually and observe the responsive changes. That's what I've been doing up to now. Having to test at multiple viewport sizes, I found the select menu with pre-defined options in the device mode of Chrome/Safari devtools much easier than manually resizing. However, that approach only works if I go into fullscreen.

What I was hoping to find was a mechanism to pre-define viewport sizes to quickly switch and test the responsive CSS rulesets. storybook-host was the closest I could find, but it fails to work for my scenario as it decorates the content of the iframe.

Having continued my Google search and digging just a bit around the code, I think I've approached the conclusion that this isn't currently achievable. But, would it be possible to create an addon that optionally applies margin around the iframe element from the manager app side?

On a related side note, Sizzy looks like an interesting tool. I had some issues with scroll bars appearing unnecessarily, and it still suffers the same fullscreen limitation as testing with device mode in Chrome/Safari devtools.

@ndelangen
Copy link
Member

We have a topic on our roadmap to create tooling inside storybook (via addons) that mimic Sizzy's behavior, and make it easy to send links to real mobile devices to view the selected story in a variety of screen-sizes etc.

If you would want to work with us to create it 🙇 that'd be awesome!

@saponifi3d
Copy link

@ndelangen I recently ran into this issue as well, and created a quick addon to help solve the problem.

viewport

if you guys are interested, i'd love to cleaning up the action area, add more mobile sizes (maybe a handle to make responsive), and contrib back to the storybook addons :D

@seniorquico
Copy link
Author

@saponifi3d That looks awesome! Please let me know if there's anyway I can help toward an effort to release your addon to the community.

@ndelangen Sending "fullscreen" links to a mobile device also sounds like an awesome feature. Are there any requirements or use cases drawn up? I'm definitely willing to help contribute.

@ndelangen
Copy link
Member

ndelangen commented Aug 15, 2017

@seniorquico Come join us on Slack so we can communicate efficiently on what, when and how we're planning to add the feature.

Full disclosure: there hasn't been any work put into this except the description on our Roadmap

@saponifi3d saponifi3d mentioned this issue Aug 26, 2017
3 tasks
@shilman shilman mentioned this issue Aug 28, 2017
3 tasks
@stale
Copy link

stale bot commented Nov 2, 2017

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. We do try to do some housekeeping every once in a while so inactive issues will get closed after 90 days. Thanks!

@stale stale bot added the inactive label Nov 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants