ente/web/packages/shared/themes/index.ts

27 lines
812 B
TypeScript
Raw Normal View History

import { APPS } from "@ente/shared/apps/constants";
import { createTheme } from "@mui/material";
import { getColors } from "./colors";
import { getComponents } from "./components";
import { THEME_COLOR } from "./constants";
import { getPallette } from "./palette";
import { typography } from "./typography";
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;
};