Skip to content

Make dark/light mode a one-press toggle#108

Merged
oharsta merged 1 commit into
mainfrom
refactor/mode-control
Jul 14, 2026
Merged

Make dark/light mode a one-press toggle#108
oharsta merged 1 commit into
mainfrom
refactor/mode-control

Conversation

@sjoerdbeentjes

Copy link
Copy Markdown
Collaborator

Replaces the two-item Mode dropdown in the shared Storybook toolbar with a single-press toggle button.

  • Registers a manager toolbar tool that reads/writes the existing mode global (still reflected onto <html> by themeSwitcher), so behaviour is unchanged, only the control.
  • Uses Storybook's own SunIcon/MoonIcon plus a Light/Dark label. Sits in the left toolbar group with the other toggles (grid, measure, outline).
  • The mode global no longer has a globalType (no dropdown); it stays driven by initialGlobals and carried across frameworks.

Shared config, so it applies to both the React and Angular Storybooks. Verified in the running React Storybook: light -> dark -> light, icon/label swap, story canvas follows.

Closes #92

Replace the two-item Mode dropdown in the shared Storybook toolbar with a
single-press toggle button, registered as a manager tool. It reads/writes the
existing `mode` global (still reflected onto <html> by themeSwitcher) and shows
Storybook's own sun/moon icon plus a Light/Dark label.

Closes #92
@sjoerdbeentjes
sjoerdbeentjes force-pushed the refactor/mode-control branch from b3ceb27 to 5712435 Compare July 14, 2026 14:28
@sjoerdbeentjes
sjoerdbeentjes requested a review from oharsta July 14, 2026 14:30
@sjoerdbeentjes sjoerdbeentjes changed the title refactor(storybook): make dark/light mode a one-press toggle Make dark/light mode a one-press toggle Jul 14, 2026
@oharsta
oharsta merged commit 4e4a3e7 into main Jul 14, 2026
1 check passed
@oharsta
oharsta deleted the refactor/mode-control branch July 14, 2026 14:44
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.

Make dark/light mode selection in Storybook a one press toggle instead of a select menu

2 participants