Skip to content

fix(Dashboard): wire theme toggle to Storybook globals for proper dark mode#150

Merged
garrity-miepub merged 1 commit into
mainfrom
bugfix/dashboard-example-dark-mode
Mar 27, 2026
Merged

fix(Dashboard): wire theme toggle to Storybook globals for proper dark mode#150
garrity-miepub merged 1 commit into
mainfrom
bugfix/dashboard-example-dark-mode

Conversation

@garrity-miepub

Copy link
Copy Markdown
Collaborator
image

Replace hardcoded neutral-X dark:neutral-Y color pairs with semantic tokens (bg-card, bg-background, border-border, text-muted-foreground, hover:bg-muted) so components respond to the brand system.

Remove ThemeProvider wrapper — the Dashboard story's in-app toggle now emits updateGlobals via Storybook's addons channel, which triggers preview.tsx's applyGlobalTheme() to handle class toggling, data-theme, and CSS custom property injection. This keeps the toolbar icon in sync and avoids duplicating brand/CSS-variable logic in the story file.

Copilot AI review requested due to automatic review settings March 27, 2026 23:05
@garrity-miepub garrity-miepub marked this pull request as ready for review March 27, 2026 23:05
…k mode

Replace hardcoded neutral-X dark:neutral-Y color pairs with semantic
tokens (bg-card, bg-background, border-border, text-muted-foreground,
hover:bg-muted) so components respond to the brand system.

Remove ThemeProvider wrapper — the Dashboard story's in-app toggle
now emits updateGlobals via Storybook's addons channel, which triggers
preview.tsx's applyGlobalTheme() to handle class toggling, data-theme,
and CSS custom property injection. This keeps the toolbar icon in sync
and avoids duplicating brand/CSS-variable logic in the story file.
@garrity-miepub garrity-miepub force-pushed the bugfix/dashboard-example-dark-mode branch from 3abc1cd to d0a431f Compare March 27, 2026 23:07
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Mar 27, 2026

Copy link
Copy Markdown

Deploying ui with  Cloudflare Pages  Cloudflare Pages

Latest commit: d0a431f
Status: ✅  Deploy successful!
Preview URL: https://120ec96c.ui-6d0.pages.dev
Branch Preview URL: https://bugfix-dashboard-example-dar.ui-6d0.pages.dev

View logs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the Dashboard Storybook story to rely on Storybook globals for theme switching (so preview-level theme/brand logic stays centralized) and replaces hardcoded neutral dark/light class pairs with semantic Tailwind tokens so the story responds to brand theming.

Changes:

  • Emit updateGlobals on the Storybook channel from the in-story theme controls and remove the ThemeProvider wrapper.
  • Replace neutral-* / dark:neutral-* styling pairs with semantic tokens (e.g. bg-card, bg-background, border-border, text-muted-foreground, hover:bg-muted).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/Dashboard/Dashboard.stories.tsx
Comment thread src/components/Dashboard/Dashboard.stories.tsx
@garrity-miepub garrity-miepub merged commit d64b778 into main Mar 27, 2026
10 checks passed
@garrity-miepub garrity-miepub deleted the bugfix/dashboard-example-dark-mode branch March 27, 2026 23:27
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