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

Backgrounds addons do not show by default #5818

Closed
hipstersmoothie opened this issue Mar 2, 2019 · 5 comments
Closed

Backgrounds addons do not show by default #5818

hipstersmoothie opened this issue Mar 2, 2019 · 5 comments

Comments

@hipstersmoothie
Copy link
Contributor

hipstersmoothie commented Mar 2, 2019

UPDATE:

This issue describes problems with both addon-backgrounds and addon-viewports. The viewports bug is a duplicate to #5757, so I'm reappropriating this issue to backgrounds since it's a separate work item. --@shilman


Describe the bug

addon-backgrounds and addon-viewport do not display in any way

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://github.com/hipstersmoothie/story-bug
  2. Click on yarn && yarn storybook
  3. backgrounds and viewport do not display

Expected behavior

Should display

Screenshots

screen shot 2019-03-01 at 11 13 29 pm

System:

  • OS: Mac High Sierra
  • Device: Macbook Pro 2018
  • Browser: chrome
  • Framework: react
  • Addons: viewport, backgrounds
  • Version: 5.0.0-rc.8
@hipstersmoothie
Copy link
Contributor Author

hipstersmoothie commented Mar 2, 2019

I got it to work but only by doing the following

stories.add('Basic', () => <Card style={styles}>I'm a simple card</Card>, {
  notes: {
    markdown
  },
  backgrounds: [
    { name: 'white', value: 'white', default: true },
    { name: 'twitter', value: '#00aced' },
    { name: 'facebook', value: '#3b5998' }
  ]
});

@hipstersmoothie
Copy link
Contributor Author

It seems like this can also be done for the viewport with

addParameters({
  backgrounds: [
    { name: 'white', value: 'white', default: true },
    { name: 'twitter', value: '#00aced' },
    { name: 'facebook', value: '#3b5998' }
  ],
  viewports: INITIAL_VIEWPORTS
});

all current documented ways are incorrect (i think)

@shilman shilman added this to the v5.0.0 milestone Mar 2, 2019
@shilman shilman added the bug label Mar 3, 2019
@shilman shilman changed the title rc.8 addon-backgrounds and addon-viewport do not display Default backgrounds/viewports addons do not show Mar 3, 2019
@shilman
Copy link
Member

shilman commented Mar 3, 2019

@hipstersmoothie Great catch, we should fix this before launch.

Your repo also revealed another good one: #5822

@shilman shilman changed the title Default backgrounds/viewports addons do not show Backgrounds addons do not show by default Mar 3, 2019
tmeasday pushed a commit that referenced this issue Mar 4, 2019
Didn't change any supported behaviour, but this should help with users migrating. #5818
@shilman
Copy link
Member

shilman commented Mar 4, 2019

Yippee!! I just released https://github.com/storybooks/storybook/releases/tag/v5.0.0-rc.10 containing PR #5828 that references this issue. Upgrade today to try it out!

Because it's a pre-release you can find it on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Mar 4, 2019
@Pushplaybang
Copy link

@shilman @hipstersmoothie - not certain if this is related, but currently using the viewport addon obscures the very useful background grid, let me know if this should be a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants