From 9c8e28f79dc8c36437bcd99db099f26450e62d84 Mon Sep 17 00:00:00 2001 From: jonniebigodes Date: Sat, 3 Aug 2024 04:04:10 +0100 Subject: [PATCH] Adjust API --- docs/essentials/backgrounds.mdx | 9 +++++++-- docs/essentials/viewport.mdx | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/essentials/backgrounds.mdx b/docs/essentials/backgrounds.mdx index 7f34dd25342b..16f0a0064d1a 100644 --- a/docs/essentials/backgrounds.mdx +++ b/docs/essentials/backgrounds.mdx @@ -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. @@ -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` +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. @@ -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). diff --git a/docs/essentials/viewport.mdx b/docs/essentials/viewport.mdx index 7a3ea01fe3a1..78eb965066e4 100644 --- a/docs/essentials/viewport.mdx +++ b/docs/essentials/viewport.mdx @@ -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. @@ -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: