-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: storybook theme package not working #27086
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Removed dependencies detected. Learn more about Socket for GitHub ↗︎ 🚮 Removed packages: npm/@storybook/[email protected], npm/[email protected] |
Builds ready [6824447]
Page Load Metrics (1883 ± 109 ms)
Bundle size diffs
|
Builds ready [c2f54b5]
Page Load Metrics (1594 ± 37 ms)
Bundle size diffs
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #27086 +/- ##
========================================
Coverage 70.04% 70.04%
========================================
Files 1435 1435
Lines 49920 49920
Branches 13980 13980
========================================
Hits 34963 34963
Misses 14957 14957 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice work 💯 LGTM!
- Checked storybook docs MDX only pages in light dark theme ✅
- Checked storybook stories in light,dark,light/dark ✅
- Checked console for no errors ✅
Quality Gate passedIssues Measures |
Builds ready [28dbecd]
Page Load Metrics (1637 ± 82 ms)
Bundle size diffs
|
Description
This PR removes the
storybook-dark-mode
package and utilizes the native Storybook Theme API for managing the light and dark modes across both the documentation and component preview pages.The motivation behind this change is to fix the bug introduced after upgrading Storybook to ^7.6.20 and
storybook-dark-mode
to ^4.0.2, which resulted in the following error:Additionally, we have updated the
DocsContainer
to ensure it handles the theme correctly without throwing errors. The bug prevented Storybook Docs pages from rendering properly.Key changes:
storybook-dark-mode
package.Additional Context:
storybook-dark-mode
) is valuable enough to add an additional dependency. We can add it to our roadmap for discussion when we are working on the storybook portion of our roadmap.Possible Asked Questions
Yes. It is set to the users system, so if the user uses dark mode then the application will run in dark. Made attempts for a fix
Yes. The best solution was to revert to the old package version, but that stops us from progressing forward. It's nice to remove dependencies and use built-in options.
Related issues
Fixes:
storybook
,@storybook/*
to^7.6.20
,storybook-dark-mode
from^3.0.3
to^4.0.2
#26703 (Introduced the error after upgrading to Storybook 7.6.20)Manual testing steps
yarn storybook
.Screenshots/Recordings
Before
Screen.Recording.2024-09-11.at.6.37.07.PM.mov
After
This now allows us to have more than one theme for our components and we can also view both modes at the same time!
Screen.Recording.2024-09-11.at.6.39.07.PM.mov
Here is where I know some people might be upset, but currently the entire application theme is set to users system and no longer tied to the theme switch
Screen.Recording.2024-09-11.at.6.39.07.PM.mov
Pre-merge author checklist
Pre-merge reviewer checklist