-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
[styles] Remove the old withStyles modules #14767
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
[styles] Remove the old withStyles modules #14767
Conversation
* [styles] Remove the old styles modules * reviews
22c8147
to
1078da9
Compare
@material-ui/core: parsed: -2.51% 😍, gzip: +0.14% Details of bundle changes.Comparing: 7a49f80...14356aa
|
@@ -10,13 +10,13 @@ You can use it, but you don't have to. This styling solution is [interoperable w | |||
|
|||
In previous versions, Material-UI has used LESS, then a custom inline-style solution to write the style of the | |||
components, but these approaches have proven to be limited. Most recently, we have [moved toward](https://github.com/oliviertassinari/a-journey-toward-better-style) | |||
a *CSS-in-JS* solution. It **unlocks many great features** (theme nesting, dynamic styles, self-support, etc.). | |||
a *CSS in JS* solution. It **unlocks many great features** (theme nesting, dynamic styles, self-support, etc.). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why changing? The hyphenated version seems to be widely used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were using the two variants. Try a Google search, everybody is contradicting itself. Ok, let's trust this variant: https://medium.com/seek-blog/a-unified-styling-language-d0c208de2660.
There are relatively few results when Google CSS-in-JS, what do you think of renaming it to simple "styling"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as for https://next.material-ui.com/style/icons/, we can either rename it content, or move it to the components subsection.
@@ -7,7 +7,7 @@ but you should find that the principals applied here can be adapted to other lib | |||
|
|||
We have provided examples for the following styling solutions: | |||
|
|||
- [Raw CSS](#raw-css) | |||
- [Plain CSS](#plain-css) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Is @material-ui/core/styles/createMuiTheme() still the only (and correct) way to create customized themed based on default theme (i.e. without writing the whole theme from scratch)? There doesn't seem to be anything providing the same functionality in the Styles API documentation. |
@synchronos-t Yes. Maybe we should split
|
Is there any particular reason why the createMuiTheme resides under the core and not under styles? Unless it's because you've planned to just move it sometimes later. To me, it'd sound more intuitive that the theme creation functions are where the styles and theme usage functions are. (And probably now named createTheme, I assume.) Though, I have a hunch it might have to do something how the default theme is applied to all the components. |
Yes,
It's why we have kept |
Without |
@PeterL1n |
This pull request removes the legacy style modules. It's time to rely on @material-ui/styles. It's also re-exploring the style modules with a default theme to make the transition seamless.
The TypeScript definitions and the documentation are not correctly handled yet. I think that we can do it in a second pass. I'm not sure what drives the bundle size increase. It could be the JSS alpha.7 to alpha.12 upgrade.
Deprecation
Breaking changes
MuiThemeProvider
component:@material-ui/styles/install
module.Closes #14416
Closes #14698