-
Notifications
You must be signed in to change notification settings - Fork 191
fix: dark theme support in stories #1950
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
Conversation
🦋 Changeset detectedLatest commit: a01258a The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
d79a3f6
to
514294f
Compare
514294f
to
86cf734
Compare
323dc38
to
29a878b
Compare
2cf933d
to
78d5e54
Compare
bcc06fd
to
7af1faf
Compare
7af1faf
to
7c89efe
Compare
d632091
to
a26cd13
Compare
fe2eaf4
to
08aea86
Compare
08aea86
to
a01258a
Compare
// For docs, check localStorage directly | ||
return localStorage.getItem('sb-addon-themes-3') === 'dark'; | ||
|
||
const themeParameters = localStorage.getItem('sb-addon-themes-3'); |
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.
Could we extract this 'sb-addon-themes-3' to const somewhere ??
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.
The thing is that we need to extract it at launch for this useState but also everytime again in the useEffect so by making it more global, its value won't change.
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.
It works for me 👍🏻
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.
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.
Thank you so much for the fix @Adzouz ! I tested locally, LGTM!
What does it do?
Second PR (without updating ESlint dependencies and fixing code errors raised by the bump of eslint version)
Fix the dark mode support in the stories and the Color page that was broken since last update of the Design System.
Why is it needed?
After bumping to the latest version of dependencies (storybook v9 and using @vueless/storybook-dark-mode), the dark mode switch in Storybook wasn't working anymore.
In addition, it was breaking the Foundation > Color page because it was using a hook that is not allowed in the stories components.
How to test it?
-> The page should display the list of colors correctly without any error
🚀