Skip to content
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

[feature] Add a storybook theme switcher to the Toolbar for Chakra UI #11863

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Philzen
Copy link
Contributor

@Philzen Philzen commented Dec 29, 2024

This PR adds a button to the storybook toolbar that enables to switch between dark and light color mode in Chakra UI:

grafik

grafik

Actually i've been searching a solution how to do this for quite some time as i never got the official @chakra-ui/storybook-addon to work – and as it relies on webpack it won't ever work with the storybook+vite default since Redwood 8.

Thanks heaps to @simoncrypta for contributing the i18n language switcher, which ultimately pointed me in the right direction when i looked at the preview.tsx template for that.

@Philzen
Copy link
Contributor Author

Philzen commented Dec 29, 2024

I do have a hunch the chakra ui setup command may be currently broken – as the theme file path that is being created here

path.join(rwPaths.web.config, 'chakra.config.js'),
CHAKRA_THEME_AND_COMMENTS,
{ overwriteExisting: force },

does not seem to be resolved here

Shall do some more tests and fix that first?

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.

1 participant