GithubHelp home page GithubHelp logo

Comments (12)

mayteio avatar mayteio commented on June 12, 2024 6

I built a super lightweight version of this addon - that solves my problem above. Just pass your themes in and toggle with a dropdown 👍

from storybook-addon-material-ui.

mayteio avatar mayteio commented on June 12, 2024 4

Same issue here. Would be awesome to be able to toggle them.

from storybook-addon-material-ui.

mayteio avatar mayteio commented on June 12, 2024 2

All good - if I have a moment I’ll see if I can get something similar working in this package. I just wanted to wrap my themes rather than build them in storybook for an internal component library - branding and colours are already set.

from storybook-addon-material-ui.

JanineAmelie avatar JanineAmelie commented on June 12, 2024 1

@mayteio Thanks!!! It doesn't have all the features that I want, like color selection but this is already a great compromise <3 <3 <3

from storybook-addon-material-ui.

justin-peterson-jdas avatar justin-peterson-jdas commented on June 12, 2024 1

@mayteio awesome man, nice addon :) This is exactly what I was going to do. I'm going to see if I can just utilize yours instead

from storybook-addon-material-ui.

yatrix7 avatar yatrix7 commented on June 12, 2024 1

I built a super lightweight version of this addon - that solves my problem above. Just pass your themes in and toggle with a dropdown 👍

Worked the first time I tried it. Well done.

from storybook-addon-material-ui.

usulpro avatar usulpro commented on June 12, 2024 1

Hey here!

First of all sorry for the inconvenience and thank you for your patience 😸

While developing of stable version of this addon is in progress and you're looking for just a simple functionality, you can switch to another one:
https://github.com/react-theming/storybook-addon

It's an universal one and don't have Material-UI specific features, but you can use it when switching themes and changing colors is enough for your case

demo

yarn add --dev @react-theming/storybook-addon

to use it with Material UI you'll need to pass theme provider into decorator this way:

import { withThemes } from '@react-theming/storybook-addon';
import { ThemeProvider } from '@material-ui/core';
import { createMuiTheme } from '@material-ui/core/styles';

import theme from '../theme';

const providerFn = ({ theme, children }) => {
  const serialTheme = JSON.parse(JSON.stringify(theme));
  const muTheme = createMuiTheme(serialTheme);
  return <ThemeProvider theme={muTheme}>{children}</ThemeProvider>;
};

export default {
  title: 'MUI Examples',
  component: Component,
  decorators: [withThemes(null, [theme], { providerFn })],
};

or see details in the template project https://github.com/react-theming/theming-material-ui

from storybook-addon-material-ui.

JanineAmelie avatar JanineAmelie commented on June 12, 2024

Bump I have the same problem. Would really like some solution

from storybook-addon-material-ui.

usulpro avatar usulpro commented on June 12, 2024

Thanks @mayteio

Also any PRs with improvements to this project are always welcome!

from storybook-addon-material-ui.

vvetsko avatar vvetsko commented on June 12, 2024

Had the same problem, but is ok when passing ThemeOptions instead of Theme into muiTheme decorator.

The issue still exists, as I am using typescript and should add an exception for this (

from storybook-addon-material-ui.

usulpro avatar usulpro commented on June 12, 2024

@vvetsko can we update https://github.com/react-theming/storybook-addon-material-ui/blob/version-1/storybook-addon-material-ui.d.ts to add the exception?

from storybook-addon-material-ui.

Moonachi avatar Moonachi commented on June 12, 2024

I have same issue. Has the issue been resolved?

from storybook-addon-material-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.