Skip to content

Commit

Permalink
Merge pull request #5845 from huntie/addon-cssresources-migration-docs
Browse files Browse the repository at this point in the history
Add MIGRATION.md entry for addon-cssresources 5.x attribute change
  • Loading branch information
shilman authored Mar 4, 2019
2 parents 7dc2e11 + 9ba9daa commit aefc89d
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [Options addon deprecated](#options-addon-deprecated)
- [Individual story decorators](#individual-story-decorators)
- [Addon backgrounds uses parameters](#addon-backgrounds-uses-parameters)
- [Addon cssresources name attribute renamed](#addon-cssresources-name-attribute-renamed)
- [Addon viewport uses parameters](#addon-viewport-uses-parameters)
- [Addon a11y uses parameters](#addon-a11y-uses-parameters-decorator-renamed)
- [New keyboard shortcuts defaults](#new-keyboard-shortcuts-defaults)
Expand Down Expand Up @@ -187,6 +188,46 @@ storiesOf('Stories', module).addParameters({ backgrounds: options });

You can pass `backgrounds` parameters at the global level (via `addParameters` imported from `@storybook/react` et al.), and the story level (via the third argument to `.add()`).

## Addon cssresources name attribute renamed

In the options object for `@storybook/addon-cssresources`, the `name` attribute for each resource has been renamed to `id`. If you previously had:

```js
import { withCssResources } from '@storybook/addon-cssresources';
import { addDecorator } from '@storybook/react';

addDecorator(
withCssResources({
cssresources: [
{
name: `bluetheme`, // Previous
code: `<style>body { background-color: lightblue; }</style>`,
picked: false
}
]
})
);
```

You should replace it with:

```js
import { withCssResources } from '@storybook/addon-cssresources';
import { addDecorator } from '@storybook/react';

addDecorator(
withCssResources({
cssresources: [
{
id: `bluetheme`, // Renamed
code: `<style>body { background-color: lightblue; }</style>`,
picked: false
}
]
})
);
```

## Addon viewport uses parameters

Similarly, `@storybook/addon-viewport` uses parameters to pass viewport options. If you previously had:
Expand Down

1 comment on commit aefc89d

@vercel
Copy link

@vercel vercel bot commented on aefc89d Mar 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment failed with the following error:

Builds rate limit exceeded (0 of 100 remaining). Try again in 24h

Please sign in to comment.