[material-ui] v6 changed the injection order <GlobalStyles/> #44597
Labels
bug 🐛
Something doesn't work
component: CssBaseline
The React component
component: GlobalStyles
The React component.
package: material-ui
Specific to @mui/material
Steps to reproduce
Steps:
As a note, although the v6 codesandbox uses the latest v6 version, I also tested with 6.0.0 which has the same behaviour.
As far as I can tell, the behaviour change comes from
<StyledEngineProvider injectFirst>
, which seems to have changed the injection order between CssBaseline and GlobalStylesCurrent behavior
GlobalStyles defined are injected before CssBaseline
Expected behavior
GlobalStyles should be injected after CssBaseline so that they can take precedence over baseline, and we can avoid having to use
!important
, as was the behaviour in v5Context
I need some specific pages in my application to be able to override the defined default body background
Your environment
as provided in the codesandboxes above
Search keywords: globalstyles body cssbaseline
The text was updated successfully, but these errors were encountered: