Skip to content

Commit

Permalink
MUI palette --> colorSchemes upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
TyHil committed Nov 25, 2024
1 parent 4fb20ee commit 8299411
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import '@/styles/globals.css';

import { useMediaQuery } from '@mui/material';
import { createTheme, ThemeProvider } from '@mui/material/styles';
import { GoogleAnalytics } from '@next/third-parties/google';
import { SpeedInsights } from '@vercel/speed-insights/react';
Expand Down Expand Up @@ -76,10 +75,8 @@ const kallisto = localFont({
});

function MyApp({ Component, pageProps }: AppProps) {
const prefersDarkMode = useMediaQuery('(prefers-color-scheme: dark)');
const muiTheme = createTheme({
const palette = {
palette: {
mode: prefersDarkMode ? 'dark' : 'light',
//copied from tailwind.config.js
primary: {
main: tailwindConfig.theme.extend.colors.royal,
Expand All @@ -92,6 +89,13 @@ function MyApp({ Component, pageProps }: AppProps) {
main: tailwindConfig.theme.extend.colors.persimmon['500'],
},
},
};
const muiTheme = createTheme({
cssVariables: true,
colorSchemes: {
light: palette,
dark: palette,
},
typography: {
fontFamily: 'inherit',
},
Expand Down

0 comments on commit 8299411

Please sign in to comment.