-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[system] set
before
directly without using prepend for global styles (
- Loading branch information
1 parent
0ea1ef5
commit e16f0f5
Showing
2 changed files
with
44 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import * as React from 'react'; | ||
import { StyledEngineProvider } from '@mui/material/styles'; | ||
import CssBaseline from '@mui/material/CssBaseline'; | ||
import GlobalStyles from '@mui/material/GlobalStyles'; | ||
import Typography from '@mui/material/Typography'; | ||
|
||
export default function InjectFirst() { | ||
return ( | ||
<StyledEngineProvider injectFirst> | ||
<CssBaseline /> | ||
<Typography variant="h1">Hello MUI v6</Typography> | ||
<Typography>The color should be red</Typography> | ||
<GlobalStyles styles={() => ({ body: { color: 'red' } })} /> | ||
</StyledEngineProvider> | ||
); | ||
} |