-
-
Notifications
You must be signed in to change notification settings - Fork 355
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] Replace CssVarsProvider
with ThemeProvider
#3872
Conversation
532ea85
to
a26fd24
Compare
Having Since CSS vars themes are becoming standard I wouldn't even support an object with |
Yes, if that's the case the |
@siriwatknp I updated the implementation a bit to make sure Verified that the implementation works against v5 |
@@ -60,8 +60,8 @@ | |||
"prop-types": "15.8.1" | |||
}, | |||
"devDependencies": { | |||
"@mui/icons-material": "6.0.0-beta.2", | |||
"@mui/material": "6.0.0-beta.2", | |||
"@mui/icons-material": "next", |
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.
Everything labeled as "next" will eventually get a stable v6 specifier
CssVarsProvider
with ThemeProvider
CssVarsProvider
with ThemeProvider
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.
This looks great, thanks!
const demoTheme = extendTheme({ | ||
const demoTheme = createTheme({ | ||
cssVariables: { | ||
colorSchemeSelector: 'data-toolpad-color-scheme', |
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.
If this selector needs to be added every time I guess we could override it ourselves, or make it fully configurable. As right now I guess the AppProvider
theming wouldn't work with any other selector.
To test mui/material-ui#43115 and get feedback from Toolpad team.
Context
The core team is merging the
CssVarsProvider
andextendTheme
intoThemeProvider
andcreateTheme
to prevent the confusion of using the APIs. The detail is in this issue.Changes
colorSchemes
node.{ light: Theme, dark: Theme }
structure so this is untouched.{ allColorSchemes } = useColorScheme()
ifallColorSchemes.length > 1
.For more detail of the implementation, see the Material UI PR: mui/material-ui#43115