Storybook: Story background stays white in dark mode on docs page
I maintainer di solito rispondono entro 3 giorni
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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
- Run
pnpm storybook(or open the deployed Storybook) - Open the Docs page of any component, e.g. Components → Badge → Docs
- Switch the theme in the toolbar from light to dark
- 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
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.
- Lingua principale
- Vue
- Stelle
- 10
- Fork
- 1
- Merge medio
- 1g 22h
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di thunderbird/services-ui
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
thunderbird/services-ui#354 ·
I maintainer di solito rispondono entro 3 giorni
-
ToolTip has a11y issuesAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
thunderbird/services-ui#356 ·
I maintainer di solito rispondono entro 3 giorni
-
Popover API for ToolTipApertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
thunderbird/services-ui#334 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
thunderbird/services-ui#326 · 2 commenti ·
I maintainer di solito rispondono entro 3 giorni
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
thunderbird/services-ui#325 ·
I maintainer di solito rispondono entro 3 giorni