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

Center the story within the iFrame ? #55

Closed
antoinerey opened this issue Apr 5, 2016 · 5 comments
Closed

Center the story within the iFrame ? #55

antoinerey opened this issue Apr 5, 2016 · 5 comments

Comments

@antoinerey
Copy link

Do you consider centering the story inside the iFrame ? I currently work on a 27-inch screen and my Button component is pretty much lost in all this space :D

image

One solution could be to simply center the story on the screen. And of course, let the story scroll if it overflows the viewport.

@arunoda
Copy link
Member

arunoda commented Apr 5, 2016

I get it. But, the component run inside a pure isolated environment where we don't inject any code. So, we shoudn't inject anystuff to change it.

That's how I view about this. Thanks for the request.

@arunoda arunoda closed this as completed Apr 5, 2016
@tlrobinson
Copy link

@antoinerey You could create a simple component to center the content, something like this:

const Centered = ({ children }) =>
    <div style={{ height: "100vh", display: "flex", alignItems: "center", justifyContent: "center" }}>
        {children}
    </div>

Then just do:

storiesOf("MyComponent", module)
  .add("defaults", () => {
    return <Centered><MyComponent /></Centered>
  })

@antoinerey
Copy link
Author

Yep. That's what I did too. That's why I proposed this idea to be included
into the final solution. :)
Le mer. 6 avr. 2016 à 19:55, Tom Robinson notifications@github.com a
écrit :

@antoinerey https://github.com/antoinerey You could create a simple
component to center the content, something like this:

const Centered = ({ children }) =>
<div style={{ height: "100vh", display: "flex", alignItems: "center", justifyContent: "center" }}>
{children}

Then just do:

storiesOf("MyComponent", module)
.add("defaults", () => {
return
})


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#55 (comment)

@zimt28
Copy link

zimt28 commented Apr 8, 2016

I like the idea, this would be great to have! It should be an optional solution though.

@aimuzov
Copy link

aimuzov commented May 10, 2016

@antoinerey You can use decorator.

ndelangen pushed a commit that referenced this issue Apr 5, 2017
Should test the './' part as well
ndelangen pushed a commit that referenced this issue Apr 5, 2017
Fix bug where proptables are disabled
ndelangen pushed a commit that referenced this issue May 25, 2017
ndelangen pushed a commit that referenced this issue Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants