ente/packages/shared/themes/index.ts

27 lines
812 B
TypeScript
Raw Normal View History

2023-03-29 17:58:23 +00:00
import { createTheme } from '@mui/material';
2023-11-09 04:10:43 +00:00
import { THEME_COLOR } from './constants';
2023-03-30 07:15:34 +00:00
import { getColors } from './colors';
2023-03-29 17:58:23 +00:00
import { getComponents } from './components';
import { getPallette } from './palette';
import { typography } from './typography';
2023-11-09 04:10:43 +00:00
import { APPS } from '@ente/shared/apps/constants';
2023-03-29 17:58:23 +00:00
export const getTheme = (themeColor: THEME_COLOR, appName: APPS) => {
const colors = getColors(themeColor, appName);
const palette = getPallette(themeColor, colors);
2023-03-30 07:15:34 +00:00
const components = getComponents(colors, typography);
2023-03-29 17:58:23 +00:00
const theme = createTheme({
2023-03-30 07:15:34 +00:00
colors,
2023-03-29 17:58:23 +00:00
palette,
typography,
components,
2023-03-30 07:15:34 +00:00
shape: {
borderRadius: 8,
},
transitions: {
duration: { leavingScreen: 300 },
},
2023-03-29 17:58:23 +00:00
});
return theme;
};