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

Component styles are leaking into the Storybook UI #17204

Closed
kaiyoma opened this issue Jan 11, 2022 · 7 comments
Closed

Component styles are leaking into the Storybook UI #17204

kaiyoma opened this issue Jan 11, 2022 · 7 comments
Labels

Comments

@kaiyoma
Copy link

kaiyoma commented Jan 11, 2022

Describe the bug
Some error messages displayed inside the Storybook UI are hard to read because they're rendered as white text on a gray background.

To Reproduce
Write a story that is missing a Redux provider and load that story in the UI.

System

Environment Info:

  System:
    OS: Windows 10 10.0.19044
    CPU: (4) x64 Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
  Binaries:
    Node: 16.13.0 - C:\Program Files\Node.js\node.EXE
    npm: 8.1.4 - C:\Program Files\Node.js\npm.CMD
  Browsers:
    Chrome: 96.0.4664.110
    Edge: Spartan (44.19041.1266.0), Chromium (97.0.1072.55)
  npmPackages:
    @storybook/addon-actions: 6.4.9 => 6.4.9
    @storybook/addon-controls: 6.4.9 => 6.4.9
    @storybook/addon-docs: 6.4.9 => 6.4.9
    @storybook/addon-knobs: 6.4.0 => 6.4.0
    @storybook/addons: 6.4.9 => 6.4.9
    @storybook/api: 6.4.9 => 6.4.9
    @storybook/components: 6.4.9 => 6.4.9
    @storybook/core: 6.4.9 => 6.4.9
    @storybook/core-events: 6.4.9 => 6.4.9
    @storybook/react: 6.4.9 => 6.4.9
    @storybook/theming: 6.4.9 => 6.4.9

Additional context

image

@kaiyoma
Copy link
Author

kaiyoma commented Jan 11, 2022

Here's another repro:

  1. Open a story in the UI
  2. Rename the story in the source file

At this point, an error like this will appear:

image

@shilman
Copy link
Member

shilman commented Jan 12, 2022

@tmeasday looks like these are store-related errors. can you repro?

@tmeasday
Copy link
Member

Hi @kaiyoma are you styling your SB? This is what I see:

image

@tmeasday
Copy link
Member

@shilman these styles have not changed AFAIK.

@kaiyoma
Copy link
Author

kaiyoma commented Jan 12, 2022

@tmeasday No, I'm not adding any custom styling.

@kaiyoma
Copy link
Author

kaiyoma commented Jan 12, 2022

Oh, I see the issue. In my app, we have a background color defined for all pre elements, and this style seems to be leaking into this particular error page. Shouldn't Storybook's styles override all app styles for pages like this?

@tmeasday
Copy link
Member

tmeasday commented Jan 13, 2022

I guess it should. Do you have an idea of the best way to do that?

If you are interested, we'd love a PR to fix it. The styles are defined here: https://github.com/storybookjs/storybook/blob/0c79c53610546c3c7b3b06fc320b448bbb146f6e/lib/core-common/src/templates/base-preview-head.html

@kaiyoma kaiyoma changed the title Some Storybook error messages are hard to read (white text on a gray background) Component styles are leaking into the Storybook UI Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants