Skip to content

Conversation

Adzouz
Copy link
Contributor

@Adzouz Adzouz commented Aug 5, 2025

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.

Screenshot 2025-08-04 at 17 50 55 Screenshot 2025-08-04 at 17 50 35

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?

  • Go to Storybook
  • Click on the little Sun / Moon icon in the top bar to switch between light and dark mode
  • Go to Foundation > Color
    -> The page should display the list of colors correctly without any error

🚀

Copy link

changeset-bot bot commented Aug 5, 2025

🦋 Changeset detected

Latest commit: a01258a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@strapi/design-system Minor
@strapi/icons Minor
@strapi/ui-primitives Minor

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

Copy link

vercel bot commented Aug 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
design-system ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2025 9:53am

@Adzouz Adzouz self-assigned this Aug 5, 2025
@Adzouz Adzouz added pr: fix This PR is fixing a bug source: design-system relates to design-system package labels Aug 5, 2025
// For docs, check localStorage directly
return localStorage.getItem('sb-addon-themes-3') === 'dark';

const themeParameters = localStorage.getItem('sb-addon-themes-3');
Copy link
Contributor

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 ??

Copy link
Contributor Author

@Adzouz Adzouz Aug 7, 2025

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.

Copy link
Contributor

@jhoward1994 jhoward1994 left a 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 👍🏻

Copy link
Contributor

@simotae14 simotae14 left a comment

Choose a reason for hiding this comment

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

I am gonna approve it but I prefer @butcherZ and @Bassel17 take a look at it just to be sure everything is ok
Thanks a lot for the great effort @Adzouz

Copy link
Member

@butcherZ butcherZ left a 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!

@Adzouz Adzouz merged commit 7d49b5f into main Aug 11, 2025
17 checks passed
@Adzouz Adzouz deleted the fix/dark-theme-stories-2 branch August 11, 2025 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: fix This PR is fixing a bug source: design-system relates to design-system package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants