Skip to content

Commit

Permalink
render GlobalStyles last to be injected first
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp committed Sep 16, 2024
1 parent 29093e0 commit 1945364
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/mui-system/src/cssVars/createCssVarsProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,13 @@ export default function createCssVarsProvider(options) {

const element = (
<React.Fragment>
{shouldGenerateStyleSheet && <GlobalStyles styles={theme.generateStyleSheets?.() || []} />}
<ThemeProvider
themeId={scopedTheme ? themeId : undefined}
theme={resolveTheme ? resolveTheme(theme) : theme}
>
{children}
</ThemeProvider>
{shouldGenerateStyleSheet && <GlobalStyles styles={theme.generateStyleSheets?.() || []} />}
</React.Fragment>
);

Expand Down

0 comments on commit 1945364

Please sign in to comment.