#Is it possible to specify a default decorator for a story but only when in the docs page?

2 messages · Page 1 of 1 (latest)

regal dew
#

I have set up a theme switcher using this (https://storybook.js.org/blog/how-to-add-a-theme-switcher-to-storybook/) excellent guide from @tawny kiln but I only want the side-by-side theme to be available (and enforced) in the docs page. The actual stories themselves should just use whatever current theme is set via the toolbar.

Is this possible? I know I can create a custom docs template but (unless I've misunderstood) I still can't add a wrapper around a Story block, only a Stories block.

Storybook Blog

Learn to control how a story renders by wiring it to a decorator and toolbar items

dry plover
#

You might be able to tell how it’s being rendered by looking at the second argument to the decorator, which is the context. I’m in a plane right now so can’t double check it.