-
-
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
[material-ui][Grid2] styleOverride does not work for container, only root #44411
Comments
Thank you for reporting this issue. I investigated the problem, and it seems like there might be a discrepancy between the intended functionality of Analysis
Suggested Solution
This approach helps bypass the current limitation of the styleOverrides for "container" while maintaining the same functionality.Update Documentation:It would be helpful to update the documentation to either clarify that "container" overrides are not supported in MuiGrid2, or to include an example of how the component should be used to style containers effectively. Possible Fix in the Codebase:If "container" is meant to be supported in MuiGrid2 style overrides, then it might be a bug in the current implementation. The root cause seems to be the absence of "container" from the utility classes applied internally by Grid2. Next StepsIf this difference between Grid and Grid2 was intentional, adding a note to the documentation would be extremely helpful to avoid confusion. Thanks again for bringing this up, and I hope the above suggestions help. I'm happy to assist further if needed. |
Thank you so much for your extended feedback! I'm glad this is an already know issue and will be resolved soon :) |
Steps to reproduce
Steps:
Current behavior
The only style overrides that work for Grid2 are for "root", "container" is not working anymore.
Expected behavior
See the Grid2 documentation. It states: You can use MuiGrid2 to change the default props of this component with the theme.
But does not show the properties listed, like for the old Grid (see here)
Context
I upgraded from Grid to Grid2 and suddenly my styleOverrides for MuiGrid2-container do not work anymore, only MuiGrid2-root. But as far as I can see there has been no mention of changes in the theme api. Even the documentation states, that you can access the theme props like allways. Is this difference between Grid and Grid2 on purpose or a bug?
Your environment
npx @mui/envinfo
Search keywords: Grid Grid2 Override StyleOverride Theme Root Container
The text was updated successfully, but these errors were encountered: