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

Images gets extra height when displayed in storybook #404

Closed
kjetilge opened this issue Aug 25, 2016 · 2 comments
Closed

Images gets extra height when displayed in storybook #404

kjetilge opened this issue Aug 25, 2016 · 2 comments

Comments

@kjetilge
Copy link

Just discovered that I get extra height on images when they are displayed in story book:
I have:

        <div style={{display: 'flex'}}>

          <div style={{paddingRight:10}}>
              {imageBlob ?
                <div id="avatar_picture">
                  <img width={100} id="avatar_picture" src={imageBlob.url} />
                </div> : <div id="avatar_picture" style={{border:'1px solid'}}>
                  <img width={100} src='/images/avatar.png' />
                </div>
              }
          </div>
         //.......

      </div>

With the above code I get a an open space under my avatar picture when shown in storybook, but it looks ok in normal browser view. It seems the height of the image is 95px in storybook and 91 in normal browser view. If I add a style with display:block like this:

<img width={100} style={{display:'block'}} src='/images/avatar.png' />

Then it looks fine in both views. I belive this must be a bug.

@kjetilge
Copy link
Author

I found out what was wrong. I have a css file that is automatically loaded in my meteor app and this file is not loaded by it self in storybook. Fixed the problem by adding:

import '/client/styles/mui.css'

in my_module/components/.stories/index.js file

@arunoda
Copy link
Member

arunoda commented Aug 25, 2016

Great.

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

2 participants