Skip to content

docs(ui): add dark theme for storybook docs v2#2172

Merged
ghostdevv merged 6 commits intonpmx-dev:mainfrom
cylewaitforit:sb-add-docs-darktheme
Mar 20, 2026
Merged

docs(ui): add dark theme for storybook docs v2#2172
ghostdevv merged 6 commits intonpmx-dev:mainfrom
cylewaitforit:sb-add-docs-darktheme

Conversation

@cylewaitforit
Copy link
Contributor

@cylewaitforit cylewaitforit commented Mar 20, 2026

🔗 Linked issue

related: #2062 #2167 #1964

🧭 Context

This is a second attempt to add a dark theme for the storybook docs. The previous change for this had been reverted for build issues.

Error: __STORYBOOK_MODULE_CLIENT_LOGGER__ is not defined

That should now be addressed with: 2f3996d

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

Note

Because there are not any component docs pages in the storybook currently, to view the canvas change with the theme selection, 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.

Screenshot From 2026-03-17 17-11-30 Screenshot From 2026-03-17 17-12-23 Screenshot From 2026-03-17 17-12-15

@vercel
Copy link

vercel bot commented Mar 20, 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 20, 2026 5:27pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Mar 20, 2026 5:27pm
npmx-lunaria Ignored Ignored Mar 20, 2026 5:27pm

Request Review

@codecov
Copy link

codecov bot commented Mar 20, 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 20, 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: 8b27ed93-6c99-4344-8c55-e6ed18bf3b7e

📥 Commits

Reviewing files that changed from the base of the PR and between 8ae65d5 and 6042b02.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • .storybook/main.ts
  • .storybook/manager.ts
  • .storybook/preview-head.html
  • .storybook/preview.ts
  • .storybook/storybook-welcome.mdx
  • .storybook/theme.ts
  • pnpm-workspace.yaml

📝 Walkthrough

Walkthrough

This PR updates the Storybook configuration across multiple files to implement a custom dark theme (npmxDark), enhance Storybook compatibility with a Vite plugin for injecting module shims, add toolbar visibility controls based on story tags, and upgrade Storybook to version 10.3.1. Changes include new theme definition, updated manager and preview configurations, CSS styling for docs story canvas, a welcome MDX page, and main configuration updates for story discovery and Vite integration.

Possibly related PRs

  • PR #2062: Modifies the same Storybook configuration files (theme.ts, manager.ts, preview.ts, preview-head.html, main.ts stories glob, and welcome MDX) with identical implementation approaches.
  • PR #2167: Directly reverts the Storybook theme, preview styling, welcome MDX, and related Storybook configuration changes introduced in this PR.
  • PR #1713: Modifies Storybook theme handling in main.ts and preview.ts to configure custom dark theming, with overlapping configuration concerns.

Suggested reviewers

  • alexdln
  • ghostdevv
  • danielroe
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly relates to the changeset, explaining the addition of a dark theme for Storybook docs and linking to relevant issues and previous attempts.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

You can customize the high-level summary generated by CodeRabbit.

Configure the reviews.high_level_summary_instructions setting to provide custom instructions for generating the high-level summary.

Copy link
Contributor

@ghostdevv ghostdevv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM xD

@ghostdevv ghostdevv added this pull request to the merge queue Mar 20, 2026
Merged via the queue into npmx-dev:main with commit 3f2b865 Mar 20, 2026
22 checks passed
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.

2 participants