Skip to content

docs(ui): add dark theme for storybook docs#2062

Open
cylewaitforit wants to merge 1 commit intonpmx-dev:mainfrom
cylewaitforit:sb-add-docs-darktheme
Open

docs(ui): add dark theme for storybook docs#2062
cylewaitforit wants to merge 1 commit intonpmx-dev:mainfrom
cylewaitforit:sb-add-docs-darktheme

Conversation

@cylewaitforit
Copy link
Contributor

@cylewaitforit cylewaitforit commented Mar 13, 2026

🔗 Linked issue

Related: #1964

🧭 Context

This adds the dark theme to the docs pages in the npmx storybook.

Note

Because there are not any docs pages in the storybook currently, to view this check the preview of #1964 where autodocs have been turned on for button stories.
https://698b88d5157d89f1f33a6c21-ieffcbxthf.chromatic.com/?path=/docs/components-button-buttonbase--docs

📚 Description

This allows the docs to be viewed with the default npmx theme and retains the theme switcher capabilities for the story canvas portion of the docs.

@vercel
Copy link

vercel bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Mar 13, 2026 2:15pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Mar 13, 2026 2:15pm
npmx-lunaria Ignored Ignored Mar 13, 2026 2:15pm

Request Review

@codecov
Copy link

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bcf22c1e-ac8c-43c5-9a89-eac4e8279e33

📥 Commits

Reviewing files that changed from the base of the PR and between 5db5dc6 and c0362bd.

📒 Files selected for processing (4)
  • .storybook/manager.ts
  • .storybook/preview-head.html
  • .storybook/preview.ts
  • .storybook/theme.ts

📝 Walkthrough

Walkthrough

This pull request centralises Storybook theme configuration by extracting the theme definition into a dedicated module. A new file .storybook/theme.ts is created, defining a dark theme named npmxDark with branding and styling properties. The manager configuration is updated to import and use this external theme instead of an inlined definition. The preview configuration is extended to inject the theme into the docs rendering layer. Additionally, a new preview HTML file is introduced to override canvas background styling via CSS variables.

Possibly related PRs

  • feat: add storybook #1270: Modifies .storybook/preview.ts alongside this PR to configure Storybook preview settings and theme integration.

Suggested reviewers

  • danielroe
  • JReinhold
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly explains the purpose: adding dark theme support to Storybook docs pages whilst maintaining theme switcher functionality for story canvas.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can scan for known vulnerabilities in your dependencies using OSV Scanner.

OSV Scanner will automatically detect and report security vulnerabilities in your project's dependencies. No additional configuration is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant