Storybook: Story background stays white in dark mode on docs page

Open
#359 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 3 days

@devmount is already working on this.

Since Nov 18, 2026.

  • #360 by @devmount — open

Assessment

This issue has not been assessed yet.

Description

bug

Describe the bug

On the Storybook Docs pages that show all stories of a component, switching the theme to dark in the toolbar changes the components to their dark mode colours, but the page and the story preview containers keep their white background. Components are therefore shown with dark mode colours on a white background, which makes the dark theme useless for reviewing them on Docs pages. Single story pages are not affected and render the dark background correctly.

To Reproduce

  1. Run pnpm storybook (or open the deployed Storybook)
  2. Open the Docs page of any component, e.g. Components → Badge → Docs
  3. Switch the theme in the toolbar from light to dark
  4. See the components change colours while the background stays white

Expected behavior

The Docs page, including the story preview containers, uses the dark surface colour (--colour-surface-base, #18181b) when the dark theme is active, the same as the Canvas view does.

Actual behavior

The Docs page stays white. Single story pages are fine: there the html element gets the dark class and the dark background from the .__sb_preview_background rule in src/assets/styles/main.css. On Docs pages, the html element also gets the dark class and the dark background, but the docs wrapper rendered by @storybook/addon-docs (.sbdocs-wrapper) paints its own white background on top of it. The story containers are transparent, so they show that white.

Screenshots

image

System

  • Storybook 10.6.7 with @storybook/addon-themes (withThemeByClassName in .storybook/preview.ts) and @storybook/addon-docs
  • Reproduced in Chromium

Additional context

A possible fix is to give .sbdocs-wrapper the theme's surface colour in dark mode, next to the existing Storybook-only rules in main.css. The docs text (headings, descriptions, args table) would then also need dark mode colours to stay readable. Alternatively, the docs theme could follow the selected theme (parameters.docs.theme), but that is static by default and would need a custom docs container.

Dominant language
Vue
Stars
10
Forks
1
Avg merge
1d 22h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from thunderbird/services-ui

All issues in thunderbird/services-ui

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.