-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
99 additions
and
135 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,56 @@ | ||
import { ThemeProvider as EmotionThemeProvider, Global } from "@emotion/react"; | ||
import CssBaseline from "@mui/material/CssBaseline"; | ||
import { Experimental_CssVarsProvider as CssVarsProvider } from "@mui/material/styles/CssVarsProvider"; | ||
|
||
import { useTheme, type CustomTheme } from "./useTheme"; | ||
|
||
import type { ReactNode } from "react"; | ||
|
||
import type {} from "@mui/material/themeCssVarsAugmentation"; | ||
|
||
import { FONT_FAMILY } from "@/components/markdown/constants"; | ||
|
||
declare module "@emotion/react" { | ||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
export interface Theme extends CustomTheme {} | ||
} | ||
|
||
interface CustomThemeProviderProps { | ||
children: ReactNode; | ||
} | ||
|
||
export const CustomThemeProvider = ({ | ||
children, | ||
}: CustomThemeProviderProps): JSX.Element => { | ||
const theme = useTheme(); | ||
|
||
return ( | ||
<EmotionThemeProvider theme={theme}> | ||
<CssVarsProvider defaultMode="system" theme={theme}> | ||
<Global | ||
styles={{ | ||
html: { | ||
height: "100%", | ||
}, | ||
body: { | ||
height: "100%", | ||
cursor: "default", | ||
fontFamily: FONT_FAMILY, | ||
overflowWrap: "break-word", | ||
}, | ||
"#___gatsby": { | ||
height: "100%", | ||
}, | ||
"#gatsby-focus-wrapper": { | ||
display: "flex", | ||
flexDirection: "column", | ||
height: "100%", | ||
}, | ||
}} | ||
/> | ||
<CssBaseline enableColorScheme /> | ||
{children} | ||
</CssVarsProvider> | ||
</EmotionThemeProvider> | ||
); | ||
}; |
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 @@ | ||
export * from "./CustomThemeProvider"; |
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 was deleted.
Oops, something went wrong.