-
-
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
[system][material-ui] Stabilize CssVarsProvider #41070
Comments
@mnajdova @siriwatknp @brijeshb42 what do you think about this one? We could also plan to make the CssVarsProvider the only provider in v7. If we wish to do that, we would have to stabilize it in v6 as well as deprecate the ThemeProvider, marking it for removal in v7. |
Involved discussion: #42887 |
I agree to stabilize the API. The big task left is to handle the performance. The best way I found to optimize this (for MUI system) is that the |
In that case, a user friendly way to do this would be to have a bundler plugin to inject the themes. It would be similar to a subset of what the zero runtime plugin does. |
I added an overview of the steps to the description. I also added it to the v6 milestone. It doesn't require breaking changes, but we have to deprecate |
@siriwatknp, May I assign this one to you? You seem to have better context for it right now, having worked on the CssVarsProvider and the zero-runtime side. |
Yes, please assign it to me. |
I dove into the logic in: #41223.
const { mode, systemMode } = useColorScheme(); is probably not right. I would expect these two should be undefined/null on the first render, unless
Are we sure about this? It doesn't sound compatible with keeping emotion running on the side. |
I don't think we need to deprecate |
Why? The current CssVarsProvider works with Emotion.
The purpose of deprecating it would be to be able to eventually remove it, to avoid confusing users about which one they should use, and to avoid duplicating work on maintaining and supporting two different theme providers. |
Hey @siriwatknp! I'm looking to organize the missing work to close this issue, on the weekly meeting we discussed with the team the following tasks:
The last two are to avoid users becoming confused with two providers. We want them to use CssVarsProvider. Do you agree with these remaining tasks? Did I miss something? If you agree we can go ahead and create separate issues for them. |
Pigment CSS fixes this at build time, so I think we can close the issue.
Do you mean all of the places in the demos?
Got it. Sounds good to me. |
Yes
Should we create separate issues for these? |
@siriwatknp should we go ahead with these:
If so, may I ask you to create issues for it? |
Got it. |
As we will rely heavily on component tokens with Material Design 3 implemented through CSS variables, we should stabilize the CssVarsProvider API and remove the "Experimental" flag.
Steps
v6
extendTheme
: [system][material-ui] Stabilize CssVarsProvider #41070 (comment)ThemeProvider
in favor ofCssVarsProvider
ThemeProvider
withCssVarsProvider
v7
ThemeProvider
Search keywords: CssVarsProvider experimental stable
The text was updated successfully, but these errors were encountered: