Closed charlax closed 5 years ago
Thanks for this issue. I think that third party libraries should be using @material-ui/core as a peer dependency and import from core/styles. Basically, use the same stack than the core components. @material-ui/styles
started has an effort to isolate the components to the styling solution. I don't think that it was a successful enterprise. We have created friction (which one should be used?), it hasn't gained traction outside of Material-UI, it weaken react-jss, it hasn't made switching between different style engines possible, at least, not yet.
Start a new documentation page to provide best practices for libraries extending material-ui.
@charlax Yes, I think that it would help! I like what Gatsby has: https://www.gatsbyjs.org/docs/creating-plugins/. What do you think of a new guide under:
/guides/extending-material-ui
?
Yep, that'd be great!
I'm closing. I think the people should follow the other existing projects, lead by examples. Also, I have renamed the issue so third party authors can better find it.
Current Behavior 😯
material-ui-banner
uses@material-ui/styles
for its style solution, requiring the installation of another ThemeProvider. See https://github.com/alexplumb/material-ui-banner/issues/5There is a confusion as to whether libraries that use
material-ui
components should import from@material-ui/core/styles
or@material-ui/styles
. I believe it should import from@material-ui/core/styles
to avoid having to install the theme twice (asmaterial-ui-pickers
does).https://material-ui.com/getting-started/faq/#i-have-several-instances-of-styles-on-the-page seems to say the same thing but could be more assertive in laying out the right solution for libraries.
Expected Behavior 🤔
Start a new documentation page to provide best practices for libraries extending
material-ui
.Clarify which of
@material-ui/core/styles
or@material-ui/styles
should be used by libraries.