-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
addon-backgrounds does nothing #12147
Comments
@yannbf can you take a look? |
I had this happen as well, and it turned out my CSS-reset was overriding the background of |
@Glinkis confirmed, that's the issue! just tested it out on https://next--storybookjs.netlify.app/official-storybook/?path=/story/addons-backgrounds--story-1 In that demo link, what's adding this background color directly to the body? |
Hey @francisco-gdd, I'm glad you figured the issue out! In Storybook's react kitchen sink, a custom feature was implemented as an example of creating a custom toolbar. It was to be able to have a side-by-side comparison of a component in light/dark mode: It's quite unfortunate, but the way it was implemented ended up breaking addon-backgrounds. Addon backgrounds sets the background color of the iframe element that wraps a story, but that custom implementation adds the background to the body, and as it has more specificity, it overrides the behavior of addon-backgrounds. However, addon-backgrounds itself is not broken. As you can see in the vue kitchen sink example for instance, it works fine. So indeed, all that addon-backgrounds does is define the background color in the iframe. If there's something inside of the iframe that does something regarding that property and with more specificity, it will render the addon unusable. |
In my specific case it was bootstrap that was causing and I just had to reset it d'oh! Thanks for taking the time to look into it! sorry to bother! |
Jiminy cricket!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.1.0-alpha.16 containing PR #12368 that references this issue. Upgrade today to try it out! You can find this prerelease on the |
Describe the bug
I've added the
@storybook/addon-backgrounds
, I see the icon, I click on it and change to the dark background, nothing happens. I'm also not seeing it work in your online demos.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Background switches color
Screenshots
I have zero extensions in my Safari so that's why I tested it there
Code snippets
no code snippet, just added the package, putting it into my
addons:[]
in mymain.js
, and that's all.System:
Please paste the results of
npx sb@next info
here.I am on
6.0.13
for all my Storybook packagesThe text was updated successfully, but these errors were encountered: