Skip to content

Commit

Permalink
Adjust API
Browse files Browse the repository at this point in the history
  • Loading branch information
jonniebigodes committed Aug 3, 2024
1 parent f4bb5a9 commit 9c8e28f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 7 additions & 2 deletions docs/essentials/backgrounds.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ But you're not restricted to these backgrounds, you can configure your own set o

If you define the `default` property, the addon will apply it to all stories. Otherwise, it's only listed as an available color.


### Overriding backgrounds with globals

The Backgrounds addon enables you to change the background color applied to a story by selecting from the list of predefined background colors in the toolbar. If you need, you can opt into the globals API to configure backgrounds to ensure that a story always uses a specific background color regardless of the existing configuration.
Expand Down Expand Up @@ -115,10 +114,16 @@ Default background color. Must match the `name` property of one of the [availabl

#### `options`

Requires: [globals API](#overriding-backgrounds-with-globals)

Type: `Record<string, { name: string; value: string }>`

Defines the background colors. See above for a [usage example](#configuration).

#### `disabled`

Requires: [globals API](#overriding-backgrounds-with-globals)

Type: `boolean`

Turn off this addon's behavior. If you wish to turn off this addon for the entire Storybook, you should do so when registering `addon-essentials`. See the [essential addon's docs](../essentials/index.mdx#disabling-addons) for more information.
Expand Down Expand Up @@ -196,4 +201,4 @@ The opacity of the grid lines.

Type: `{ name: string; value: string }[]`

Available background colors. See above for a [usage example](#configuration).
Available background colors. See above for a [usage example](#configuration). Required if you haven't opted into the [globals API](#overriding-backgrounds-with-globals).
4 changes: 3 additions & 1 deletion docs/essentials/viewport.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ Specifies the default viewport used when viewing a story. Must match a key in th

#### `disabled`

Requires: [globals API](#customizing-viewports-with-globals)

Type: `boolean`

Turn off this addon's behavior. If you wish to turn off this addon for the entire Storybook, you should do so when registering `addon-essentials`. See the [essential addon's docs](../essentials/index.mdx#disabling-addons) for more information.
Expand All @@ -214,7 +216,7 @@ The `disabled` parameter is only available with the globals API introduced in St

#### `options`

Available only with the [globals API](#customizing-viewports-with-globals).
Requires: [globals API](#customizing-viewports-with-globals)

Type:

Expand Down

0 comments on commit 9c8e28f

Please sign in to comment.