This plugin will apply the dark/light class to the <body> element of the preview iframe. This can be configured with the classTarget parameter.
The value will be passed to a querySelector() inside the iframe.
This is useful if the <body> is styled according to a parent's class, in that case it can be set to html.
This would allow users to maintain consistent a background style within the padded area while keeping said style isolated within a particular story; rather than having to apply a global style to body, which would also affect other stories.
For example, storybook-dark-mode allows users to do this via:
Use Case
This would allow users to maintain consistent a background style within the padded area while keeping said style isolated within a particular story; rather than having to apply a global style to
body
, which would also affect other stories.Padding @
body
Padding @
.SomeCustomSelector