2022-11-26 13:51:56 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) Contributors to the Suwayomi project
|
|
|
|
|
*
|
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
|
|
|
*/
|
|
|
|
|
|
2023-06-04 20:58:44 +02:00
|
|
|
import { createTheme as createMuiTheme } from '@mui/material/styles';
|
2022-11-26 13:51:56 +01:00
|
|
|
|
|
|
|
|
declare module '@mui/material/styles' {
|
|
|
|
|
interface PaletteOptions {
|
|
|
|
|
custom?: PaletteOptions['primary'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const createTheme = (dark?: boolean) => {
|
|
|
|
|
const baseTheme = createMuiTheme({
|
|
|
|
|
palette: {
|
|
|
|
|
mode: dark ? 'dark' : 'light',
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2023-02-06 10:06:33 +01:00
|
|
|
const tachideskTheme = createMuiTheme(
|
|
|
|
|
{
|
|
|
|
|
palette: {
|
|
|
|
|
custom: {
|
|
|
|
|
main: dark ? baseTheme.palette.common.black : baseTheme.palette.common.white,
|
|
|
|
|
light: dark ? baseTheme.palette.grey[900] : baseTheme.palette.grey[100],
|
|
|
|
|
},
|
2022-11-26 13:51:56 +01:00
|
|
|
},
|
2023-02-06 10:06:33 +01:00
|
|
|
components: {
|
|
|
|
|
MuiCssBaseline: {
|
|
|
|
|
styleOverrides: `
|
2022-11-26 13:51:56 +01:00
|
|
|
*::-webkit-scrollbar {
|
|
|
|
|
width: 10px;
|
|
|
|
|
background: ${dark ? '#222' : '#e1e1e1'};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*::-webkit-scrollbar-thumb {
|
|
|
|
|
background: ${dark ? '#111' : '#aaa'};
|
|
|
|
|
border-radius: 5px;
|
|
|
|
|
}
|
|
|
|
|
`,
|
2023-02-06 10:06:33 +01:00
|
|
|
},
|
2022-11-26 13:51:56 +01:00
|
|
|
},
|
|
|
|
|
},
|
2023-02-06 10:06:33 +01:00
|
|
|
baseTheme,
|
|
|
|
|
);
|
2022-11-26 13:51:56 +01:00
|
|
|
|
|
|
|
|
return tachideskTheme;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default createTheme;
|