question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Viewport Addon: Border-box modifies iframe size

See original GitHub issue

The border of #storybook-preview-iframe reduces the width and height of the document by 20px thanks to * { box-sizing: border-box; }.

This means that a viewport is not the size it says it is.

With the following viewport defined:

viewports: {
  bp1: {
    name: 'Breakpoint 1',
    styles: {
      width: '320px',
      height: '480px',
    },
  }
}

The iFrame document should be 320px by 460px, but instead it actually is 300px by 460px.

image

image

System:

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
shilmancommented, Mar 11, 2019

Yo-ho-ho!! I just released https://github.com/storybooks/storybook/releases/tag/v5.1.0-alpha.4 containing PR #5993 that references this issue. Upgrade today to try it out!

Because it’s a pre-release you can find it on the @next NPM tag.

1reaction
shilmancommented, Mar 17, 2019

Whoopee!! I just released https://github.com/storybooks/storybook/releases/tag/v5.0.2 containing PR #5993 that references this issue. Upgrade today to try it out!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Viewport Addon: Border-box modifies iframe size · Issue #5927
This means that a viewport is not the size it says it is. ... The iFrame document should be 320px by 460px, but...
Read more >
html - Force iframe YouTube video to center fit and full cover ...
The iframe covers the full screen (zooming) and covers all the width and height when re-size the window. It re-size maintaining the 100%...
Read more >
Viewport - Storybook - JS.ORG
The Viewport toolbar item allows you to adjust the dimensions of the iframe your story is rendered in. It makes it easy to...
Read more >
CSS Viewport Units: A Quick Start - SitePoint
As we mentioned earlier, the value of viewport units changes directly based on the size of the viewport.
Read more >
Fluid Width Video | CSS-Tricks
Let's cover how to make them all fluid width while maintaining an ... A referer from CodePen is required to render this page...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found