Background addon not working
See original GitHub issueI have applied background addon to my storybook, it is showing those colors as option for selecting as background but on selecting it is not getting applied to my storybook. My config.js looks like this
import { configure, addDecorator, addParameters } from '@storybook/react';
import BItheme from './theme';
import styles from "@sambego/storybook-styles";
addParameters({
options: {
theme: BItheme,
},
backgrounds: [
{ name: 'twitter', value: '#00aced'},
{ name: 'facebook', value: '#3b5998' },
],
});
addDecorator(styles({
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
height: 500,
}))
// automatically import all files ending in *.stories.js and tsx
configure(
[
require.context('../stories', true, /\.stories\.js$/),
require.context('../src/components', true, /\.stories\.tsx$/)
],
module
);
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:25 (7 by maintainers)
Top Results From Across the Web
problems with storybook with Background parameters
I'm on a project with a storybook and I want my story to be able to change the background or ...
Read more >Custom Background Image and Gear Icon - AnkiWeb
The best solution is to use a smaller file size image for the background so that it loads faster and the flash is...
Read more >@storybook/addon-backgrounds | Yarn - Package Manager
Storybook Addon Backgrounds can be used to change background colors inside the preview in Storybook. Framework Support. React Storybook Screenshot ...
Read more >@storybook/addon-backgrounds - npm
Start using @storybook/addon-backgrounds in your project by running `npm i @storybook/addon-backgrounds`. There are 72 other projects in the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I was also having this issue because we import styles (which includes Bootstrap). BS sets
background-color
onbody
to white by default. To get around it, I added a stylesheet to Storybook in the.storybook
directory (not with our main styles) and imported it into.storybook/config.js
.I am also seeing this issue. The problem seems to come from the fact that the body in the iframe has a background-color set to #fff If I remove that css value in developer tools the background addon starts working.