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

Storybook: Docs not being themed properly in Storybook 7 + Vite builder #544

Open
daneah opened this issue Jun 13, 2023 · 5 comments
Open
Assignees

Comments

@daneah
Copy link
Member

daneah commented Jun 13, 2023

Expected behavior

Docs with the @storybook/addon-styling theme applied should have the color choices applied to links and so on.

Actual behavior

Docs have the default Storybook styles.

Steps to reproduce the issue

  1. Visit the Pharos Storybook
  2. Note the Introduction page has a lot of blue links (pending fixing the composed Storybook after Upgrade to Storybook 7 + Vite builder #543...)

Screenshots or code

Before After
Screenshot 2023-06-13 at 18 53 53 Screenshot 2023-06-13 at 19 48 26

Additional information

Possibly related to this Storybook issue, which claims to have been addressed.

@satya-achanta-venkata
Copy link
Contributor

@daneah I looked into this and followed the related storybook issue as well. Most of the comments from the storybook issue suggests to set sideEffects to true or completely remove sideEffects from packages/pharos/package.json, but nothing worked.

In addition to that, I also followed this issue from storybook but couldn't understand quite exactly how esbuild and sideEffects are related.

Any suggestions/thoughts for me here ?

@daneah
Copy link
Member Author

daneah commented Sep 26, 2023

@satya-achanta-venkata unfortunately you're as deep in it as I've been, at this point. I'd welcome any of the @ithaka/pharos-maintainers to look with you as well!

@satya-achanta-venkata
Copy link
Contributor

satya-achanta-venkata commented Sep 29, 2023

After looking into this, I learned that @storybook/styling is deprecated and it is recommended to use @storybook/addon-themes. I followed the migration guid from the docs below and still not seeing our theme is applied as expected. I feel I am missing something very small.

Here are the links relates to @storybook/styling and migration guide to @storybook/addon-themes

https://storybook.js.org/addons/@storybook/addon-styling
https://github.com/storybookjs/addon-styling/blob/main/MIGRATION.md

Also, please correct me on this if I am wrong. In the migration guide, I dont think webpack section of the guide is applicable to use because we use vite, so I skipped webpack part.

@daneah
Copy link
Member Author

daneah commented Sep 29, 2023

@satya-achanta-venkata you're probably on the right track, there. It's all a bit confusing because even the @storybook/addon-themes documentation contains references to @storybook/addon-styling imports, despite the migration guide saying to remove the @storybook/addon-styling package as a dependency. This feels like a juncture where Storybook has too many migratory things in flight and we might want to wait a bit.

I did try the migration briefly and it will at a minimum require the additional work of converting our theme in .storybook/theme.js to some other format, possibly putting that stuff in what Storybook seems to call "global styles." If you want to look there at some point, that might bear fruit.

@daneah
Copy link
Member Author

daneah commented Apr 20, 2024

This appears to continue being an issue in Storybook v8, as was probably expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants