Remove padding from storybook

ludder

Tom

Posted on November 13, 2020

Remove padding from storybook

After upgrading from Storybook 5 to Storybook 6 I experienced some annoying padding around all my stories.

The inspector told me this was due to a padding of 1rem defined in the class name sb-show-main on the body element. I searched for how to override this class, but was totally not necessary. The solution was actually quite simple, by adding just the following snippet to .storybook/preview.js:

export const parameters = {
  layout: 'fullscreen',
};
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
ludder
Tom

Posted on November 13, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related