fix(storybook): dark background for docs component previews#115
Merged
Conversation
In dark mode the docs component preview now uses a dark background to match the dark-rendered component, while the rest of the docs chrome stays light. Removes the custom DocsContainer, which threw a 'combining Storybook hooks with framework hooks' runtime error and themed the whole docs page (clashing with light prose and tables).
mattdjenkinson
approved these changes
Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to the docs-consolidation work. In dark mode the docs component preview now uses a dark background (matching the dark-rendered component), while the rest of the docs chrome stays light — avoiding the light-prose/dark-page clash.
DocsContainer(themed-docs-container.tsx). It read the theme via theuseGlobalspreview hook, which isn't valid in the docs container's render context and threw "combining Storybook hooks with framework hooks" at runtime; it also themed the whole docs page, which looked broken against the light prose and tables.html.dark .sbdocs-preview, html.dark .docs-story { background-color: #0c1d31 }. The existing preview decorator already sets.darkon the docs root in dark mode, so only the preview surface darkens.Verification (Chrome, local)
#0c1d31) with the dark component; title/prose/args-table stay light. ✓Changeset
@repo/storybookpatch (2.0.0 → 2.0.1).Test plan
pnpm --filter @repo/storybook typecheck— passesglobalsparams are buggy for the toolbar; use the toolbar toggle)