-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[core] Improve styling solution #7461
Conversation
It should be almost good. I need to write new tests and we should be able to merge it ☯️ . |
import withStyles from '../styles/withStyles'; | ||
import '../Button'; // So we don't have any override priority issue. |
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.
@kof This is the only limitation I have seen so far with the index trick over the previous global zIndex.
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.
The regression was catch by Argos-CI 😍 .
@kof @iamstarkov feel free to have a look at the new styling solution here. Hopefully, at some point, we will be able to rely on @nathanmarks RIP of jss-theme-reactor. I wouldn't have been able to finish this PR without you guys, thanks a lot for pushing css-in-jss forward! |
That's a really great job @oliviertassinari , now we just have to wait for the release to enjoy it! |
Will soon release it as the first beta version. Thanks. Hopefully, we won't have any issue. I believe those changes are game changer. |
One problem I am looking at right now with the latest mui is that now we can't have different Jss instances used for mui and for react-jss. The reason one may need them is plugins setup which might be different for mui than for the user code. |
@kof We can always implement our own JssProvider to allow such pattern, I'm not sure we should allow it, why not just asking for a minimum set of plugins that Material-UI relies on? |
My use case is to have a plugin which is applied to my user code but NOT to mui code, because mui will break in this case. |
It is safer in general for mui to use an own jss instance I think. |
We could do the comparaison with Babel, I have never seen a babel plugin breaking existing code, as far as I know. Maybe that's where the issue is?
That's opening the door for inconsistency issues, can we still share the same sheetRegistry for SSR? |
you are right, if our road is towards using react-jss originally from both of them it would be expected both of them behave the same. I am thinking right now that we should be able to disable/enable specific plugins where needed on specific sheets. So for e.g. if I don't want mui to use jss-isolate plugin, I pass option createStyleSheet(styles, {isolate: false}) just for mui sheets. That option is already supported btw. |
@kof Yes, we can add this extra |
Its just about passing any options user defines down to the style sheet I think. |
We should be pretty close to beta once this PR is merged.
Work In Progress
material-ui
Issues
Closes #7238 as a merge issue
Closes #6106 as using a broadcast approach
Closes #6129 as supporting theme nesting
Closes #6130 as I don't think it's needed in the core, we can write HOC for that
Closes #6821 as having interoperability with react-jss and
JssProvider
Closes #7310 as making the name optional and use the
displayName
when the name is not provided.Wins
Some features this upgrade is unlocking:
MuiThemeProvider
, hence, less onboarding frictioncreateStyleSheet
API with an optional namereact-jss