-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
MUI5 and storybook mixes the theme
if rendering Docs - which cause an exception
#16099
Comments
theme
if rendering DOCS - which cause an exceptiontheme
if rendering Docs - which cause an exception
There are a few different possible workarounds:
Then in module.exports = {
features: { modernInlineRendering: true }
}; |
Thank you @shilman for the quick response and for your help. Unfortunately disabling docs is not an option for us, as most of our documentation is written in I tried option 2) and 3) but none of them did the trick :/ Any other options? |
Do you a have a reproduction repo you can share? If not, can you create one? See how to create a repro. |
I will go through this process. However, you may have a look at https://github.com/uwinkler/storybook-problem |
The repro is here: https://github.com/uwinkler/storybook-16099-issue You can reproduce the problem yourself:
This should trigger some problems Thxs again for your help. This is much appreciated. |
Thanks @uwinkler--I'll take a look today 🙏 |
Also experiencing this issue. None of the suggested workarounds fix the issue for me. |
Also experiencing this issue. Looking forward for some kind of fix. |
@uwinkler thank you so much Disabling inline rendering did the trick for me. Our stories are standard js files not mdx stories, for anyone wondering. You saved the day! |
@shilman this causing a lot of problems now, any updates on this issue. when it will be fixed? |
@samuel-joyson does the workaround work for you? |
Still having an issue with this - This is where the issue is: |
hey @shilman , i did the (docs: { inlineStories: false }). so its working now. but we cannot test or change props in the Docs Tab. But for me, the required functionality is to check the components in the docs tab. if disable the inline-stories, that will not work. |
@samuel-joyson we'll do our best to get a solution in 6.5 but don't get your hopes up. It's a breaking change to storybook so the earliest we can guarantee a solution is 7.0 |
Here's a solution that's better but experimental. cc @ndelangen @tmeasday
module.exports = {
features: { modernInlineRender: true }
} I tried it out on @uwinkler 's reproduction here: |
@shilman the solution you provided works fine but if we use the material's ThemeProvider then it will give the exception. https://github.com/shilman/sb-mui5-modern-inline-render ref: #16099 (comment) |
@samuel-joyson do you have an example? |
hey @shilman please find the link to the repo https://github.com/samuel-joyson/storybook-mui-issue reply to: #16099 (comment) |
@shilman did you able to find any work around for the above issue. (Material theme provider)? Ref: #16099 (comment) |
@samuel-joyson there is no ThemeProvider in your example. i added one to my repo and it works as expected |
@shilman still the theme you customized is not giving any effect to the components, I tried to change the color of the theme, but it does not change the colors of the components (button). even I tried with some other changes but it won't give any effect. codebase: shilman/sb-mui5-modern-inline-render@2fe4c57
And in my project, I added the theme provider in the below file |
@samuel-joyson i can confirm your new reproduction looks ok but throws an exception. thanks for creating it! |
@shilman If we provide a theme provider as a decorator in the preview.js file it's not giving an error but it doesn't change the CSS styling. But in case if we use a theme provider inside the component it's throwing an error. |
@shilman finally the below solution is worked for me now. Removing aliases in .storybook/main.js like below
|
Nice one @samuel-joyson!! cc @tooppaaa @ndelangen |
Invalid build with vite. Does anyone solve this problem with |
Egads!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.4.0-beta.31 containing PR #16613 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
Did you manage to find a solution? |
Thank you very much. I'll love you! You saved me hours! |
Describe the bug
Material 5 (https://mui.com/core/) uses emotion to style its components. This clashes with storybook and the storybook
theme
pollutes and wipes out the MUI theme.To Reproduce
Checkout https://github.com/uwinkler/storybook-problem
Execute
yarn && yarn run storybook
Go to a 'Doc' page
See screenshot
System
System:
OS: macOS 11.5.2
CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
Binaries:
Node: 16.3.0 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.15.1 - /usr/local/bin/npm
Browsers:
Firefox: 91.0
Safari: 14.1.2
npmPackages:
@storybook/addon-actions: ^6.3.8 => 6.3.8
@storybook/addon-essentials: ^6.3.8 => 6.3.8
@storybook/addon-links: ^6.3.8 => 6.3.8
@storybook/node-logger: ^6.3.8 => 6.3.8
@storybook/preset-create-react-app: ^3.2.0 => 3.2.0
@storybook/react: ^6.3.8 => 6.3.8
Additional context
Add any other context about the problem here
.
The text was updated successfully, but these errors were encountered: