-
Notifications
You must be signed in to change notification settings - Fork 131
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
Addon doesn't show well #97
Comments
Hi @jlramosr After we switched to the new alpha the UI of this addon wasn't finished yet, so for some sizes it could look weird. But should switch colors well though. It will be likely reworked in the next version. When you adding another font are you sure it properly download by components? |
Hi @usulpro and thanks for the response. Ok, I see the UI of the same way for all the window sizes and doing click on "clone Theme", "Clear Theme", etc, it doesn't work. I was using v3.9.3 of Material-UI, but with the new version (v.4-beta), this still happens. When I change the theme (I have two themes - dark and light - with different primary colors), the background color of my components it doesn't change. When I use my components outside, this behaviour is correct. I use v5.0.11 of storybook and I've tried with all your v.0.9.0-alpha versions. With regard to the fonts, the font downloaded on both themes with:
it doesn't appear in the storybook, but outside the behaviour is correct and the font shows good. Thanks again! |
@jlramosr sorry for a long answer, |
@usulpro |
Yes - it's the same! import { createMuiTheme } from '@material-ui/core/styles';
createMuiTheme(theme); will it throw? |
const theme = createMuiTheme({
palette: {
primary: purple,
secondary: green
},
status: {
danger: 'orange'
}
});
const theme1 = createMuiTheme({
palette: {
primary: yellow,
secondary: blue
},
status: {
danger: 'orange'
}
});
storiesOf('Button', module)
.addDecorator(muiTheme([theme, theme1])) and I still get that error when switching themes. Also changing colors in the color picker doesn't update the component e.g you get the same error on mouse over or changing color. |
If I do storiesOf('Button', module)
.addDecorator(muiTheme([dark, light]))
.add('with text', a => (
<Button variant="contained" color="primary">
test button
</Button> e.g add |
Great! Addon creates themes from objects you passing to |
I suppose I can close this |
@usulpro I don't think this issue should be closed as the initial post (addon UI not matching what's presented in the README) is still active. |
I also wasn't able to edit the theme and didn't really understand how to use the UI. The UI displayed in the README is what I was hoping for. |
I'm attempting to use this addon in my new project. I have the same issue as the original poster in that the latest code does not result in a UI as seen on the project landing page. I was really hoping for the Anyway, I was looking into why the latest version of this project was not working for me and it was because Since the |
The demo in the README (seen on the project landing page) is version |
Yep, after Material-UI released v1 the structure of theme was changed. So I'm considering a new way of how to edit themes. At this moment it's possible to edit theme as a json object from addon panel |
I'm trying to set up alpha 20 with material-ui 3.9.3 and for me as well the component does not update when switching the theme. I have two themes added in storybook's config.js:
One of the themes is initially successfully applied to the component. Both themes show up in the addon's theme selector and I can switch them. When switching, the theme editor shows the selected theme correctly and I see a message is showing in the console with a changing
There are no errors besides the typography warning:
But switching the theme has no effect on the component (border color should change to theme.palette.primary.light in my example). |
The addon does not support Storybook 7 as it is still using default export of @storybook/addons The addon has not been developed since April 2023. I don't see any of its functionality, other than applying the theme, actually working with Storybook 6 either. The project it was forked from has some open issues where others had similar problems. react-theming/storybook-addon-material-ui#124 react-theming/storybook-addon-material-ui#97 I followed the guide from Ocotober 2022 for Material UI in Storybook to activate our theme without storybook-addon-material-ui. https://storybook.js.org/blog/material-ui-in-storybook/
Hello!
my addon is showing of a strange way in my storybook v5.0.11 (the icons and functionality doesn't work well):
What I'm doing bad?
I have another problem. When I create the MUI Theme, I use "override" to add a font with @font-face, but this font doesn't appear in my storybook component. What I have to do about that?
The text was updated successfully, but these errors were encountered: