Storybook: 6.0.0-beta.14 issues with css display

Created on 27 May 2020  路  15Comments  路  Source: storybookjs/storybook

Components are getting displayed as if they are zoomed.

For example radio-buttons local:
image

vs. radio-buttons in storybook:
image

I'm using angular storybook.

bug core needs reproduction

Most helpful comment

Great Caesar's ghost!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-beta.28 containing PR #11175 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

All 15 comments

@JBusch do you have a repro repo we can look at?

@ndelangen could this be related to the zoom / layout changes?

@shilman i'm sorry, it is not public :-/
I'm in the discord chat so if i could provide feedback this way, i'm happy to help.

Please ping me on discord! Happy to debug this a bit!

@ndelangen possibly (but not necessarily) related:

Addons___A11y___BaseButton_-_Default_鈰卂Storybook

This button showed up as a square until recently. Now it shows up as a squished rectangle for me. I don't know when it changed and why chromatic didn't catch it.

works on my machine on next ?

Screenshot 2020-05-28 at 11 38 02

You must have zoomed @shilman ..

@ndelangen This problem appears, in case you are not using boxSizing: border-box for your button component. I assume you use a centered layout in your local setup. You should also be able to confirm the bug on https://next--storybookjs.netlify.app/official-storybook/?path=/story/addons-a11y-basebutton--default, where a padded layout is applied.

Currently the box-sizing property is set to initial for padded and fullscreen layouts right here and this is leading to the aforementioned issue: https://github.com/storybookjs/storybook/blob/4b18fb65102c8a3f9bb58473138bc4905d1e966c/lib/core/src/client/preview/StoryRenderer.tsx#L24-L52

This is what I see:

Screenshot 2020-06-10 at 14 03 35

Screenshot 2020-06-10 at 14 04 05

Can you check this out in Firefox? Its also working in Brave on my device.

This is what I see in FF

Screenshot 2020-06-10 at 14 33 00

Screenshot 2020-06-10 at 14 33 56

Screenshot 2020-06-10 at 14 35 32

If I edit the text inside the button, this happens:
Screenshot 2020-06-10 at 14 36 23

Ok, this does not seem to be related: https://github.com/storybookjs/storybook/issues/10940#issuecomment-634730911

Different browser styles, and different button appearance, i think that is ok :D

So i guess the right approach for @JBusch would be to set box-sizing: border-box on every component or atleast not on the body element. 馃

We have the same issue. We set the following CSS in our library

*,
*::before,
*::after {
  box-sizing: inherit;
}

html,
body {
  box-sizing: border-box;
}

However Storybook resets box-sizing to box-sizing: initial; this causes our :after elements to inherit an unintended box-sizing

Screenshot 2020-06-11 at 12 41 15

Great Caesar's ghost!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-beta.28 containing PR #11175 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arunoda picture arunoda  路  3Comments

zvictor picture zvictor  路  3Comments

miljan-aleksic picture miljan-aleksic  路  3Comments

sakulstra picture sakulstra  路  3Comments

wahengchang picture wahengchang  路  3Comments