index.ts 812 B

1234567891011121314151617181920212223242526
  1. import { APPS } from "@ente/shared/apps/constants";
  2. import { createTheme } from "@mui/material";
  3. import { getColors } from "./colors";
  4. import { getComponents } from "./components";
  5. import { THEME_COLOR } from "./constants";
  6. import { getPallette } from "./palette";
  7. import { typography } from "./typography";
  8. export const getTheme = (themeColor: THEME_COLOR, appName: APPS) => {
  9. const colors = getColors(themeColor, appName);
  10. const palette = getPallette(themeColor, colors);
  11. const components = getComponents(colors, typography);
  12. const theme = createTheme({
  13. colors,
  14. palette,
  15. typography,
  16. components,
  17. shape: {
  18. borderRadius: 8,
  19. },
  20. transitions: {
  21. duration: { leavingScreen: 300 },
  22. },
  23. });
  24. return theme;
  25. };