-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Fix #7167 addon-centered causes component to disappear when zooming #7400
Fix #7167 addon-centered causes component to disappear when zooming #7400
Conversation
This pull request is automatically deployed with Now. Latest deployment for this branch: https://monorepo-git-fork-8beeeaaat-7167-zooming-with-addon-centered.storybook.now.sh |
@8beeeaaat Looks good! Now someone on the project can check it out and approve/deny it! 😄 |
@ndom91 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it locally and it LGTM! Nice work:)
@CodeByAlex |
Thank you for contributing! Worked like a charm👌 |
This change makes the iframe-window too wide as the body has default margin which gets added outside of the 'width: 100%'. So it becomes [margin + 100% + margin] and components which are 100% wide themselves will overflow the iframe. |
Ah bummer, hadn’t seen that scenario. @aarfing, do you know of a better solution? |
@CodeByAlex I guess you could set the body margin explicitly to something like 8px and then do width: calc(100% - 16px) |
@aarfing do you want to give that a try and put out a PR if it works better? If you do, I can review it |
I just tried this myself, and couldn't see any of my full width components overflowing the frame. With or without the sidebar(s). Are you sure about this? My body and html seem to have margin of 0, see screenshot: |
@ndom91 @CodeByAlex Looks like you have some resetting CSS, I don't have. This is what I get in 5.2.0-beta.9 having a component that doesn't have its width set, but is just display:block. |
@aarfing hmm yeah, so theres this large inline css block at the bottom of the page which resets padding, margin, etc. on a whole bunch of elements:
Im using storybook v5.1.9 btw |
@ndom91 I don't think that inline CSS block is part of a clean Storybook, but I might be wrong - this is my first Storybook-project. Anyway, the 'error' was introduced in 5.2.0-beta.6, so you wouldn't be affected by it in 5.1.9. |
Fix #7167 addon-centered causes component to disappear when zooming
@aarfing okay so I pulled a fresh version and your right. The Pull request made: #7640 |
Issue: close #7167
What I did
I resolve the issue #7167 with styling.
The issue is due to the fact that the
width
andheight
of the body element are not fit to the iframe.So I set the style for the body element in
iframe
.How to test
No.
No.
No.