|
| 1 | +import { createTheme, Theme } from "@mui/material/styles"; |
| 2 | + |
| 3 | +import { mergeThemeOptions } from "./ThemeManager"; |
| 4 | + |
| 5 | +import logoImageDark from "../public/diamond/logo-dark.svg"; |
| 6 | +import logoImageLight from "../public/diamond/logo-light.svg"; |
| 7 | +import logoShort from "../public/diamond/logo-short.svg"; |
| 8 | + |
| 9 | +const dlsLogoBlue = "#202740"; |
| 10 | +const dlsLogoYellow = "#facf07"; |
| 11 | + |
| 12 | +const DiamondThemeOptions = mergeThemeOptions({ |
| 13 | + logos: { |
| 14 | + normal: { |
| 15 | + src: logoImageDark, // Use the dark image for light backgrounds |
| 16 | + srcDark: logoImageLight, // Use the light image for dark backgrounds |
| 17 | + alt: "Diamond Light Source Logo", |
| 18 | + width: "100", |
| 19 | + }, |
| 20 | + short: { |
| 21 | + src: logoShort, |
| 22 | + alt: "Diamond Light Source Logo", |
| 23 | + width: "35", |
| 24 | + }, |
| 25 | + }, |
| 26 | + colorSchemes: { |
| 27 | + // https://zenoo.github.io/mui-theme-creator/ |
| 28 | + light: { |
| 29 | + palette: { |
| 30 | + primary: { |
| 31 | + main: dlsLogoBlue, |
| 32 | + light: "#4C5266", // dark grey |
| 33 | + dark: "#161B2C", // dark blue |
| 34 | + contrastText: "#ffffff", // white |
| 35 | + }, |
| 36 | + secondary: { |
| 37 | + main: dlsLogoYellow, |
| 38 | + light: "#FBD838", // light yellow |
| 39 | + dark: "#AF9004", // dark yellow |
| 40 | + contrastText: "#000000", // black |
| 41 | + }, |
| 42 | + text: { |
| 43 | + secondary: "#161B2C", |
| 44 | + }, |
| 45 | + }, |
| 46 | + }, |
| 47 | + dark: { |
| 48 | + palette: { |
| 49 | + primary: { |
| 50 | + main: "#6175bd", //lightened version of {dlsLogoBlue} |
| 51 | + light: "#8090CA", // lighter blue |
| 52 | + dark: "#435184", // mid blue |
| 53 | + contrastText: "#ffffff", // white |
| 54 | + }, |
| 55 | + secondary: { |
| 56 | + main: dlsLogoYellow, |
| 57 | + light: "#FBD838", // light yellow |
| 58 | + dark: "#AF9004", // dark yellow |
| 59 | + contrastText: "#000000", // black |
| 60 | + }, |
| 61 | + text: { |
| 62 | + secondary: "#8090CA", |
| 63 | + }, |
| 64 | + }, |
| 65 | + }, |
| 66 | + }, |
| 67 | + components: { |
| 68 | + MuiButton: { |
| 69 | + styleOverrides: { |
| 70 | + root: ({ theme }: { theme: Theme }) => ({ |
| 71 | + textTransform: "none", |
| 72 | + "&.MuiButton-contained": {}, |
| 73 | + "&.default": { |
| 74 | + color: theme.palette.primary.contrastText, |
| 75 | + backgroundColor: theme.palette.primary.dark, |
| 76 | + "&:hover": { |
| 77 | + backgroundImage: "linear-gradient(rgb(0 0 0/30%) 0 0)", |
| 78 | + "&:disabled": { |
| 79 | + backgroundColor: theme.palette.primary.light, |
| 80 | + }, |
| 81 | + }, |
| 82 | + }, |
| 83 | + "&.onBlue": { |
| 84 | + color: theme.palette.secondary.light, |
| 85 | + borderColor: theme.palette.secondary.light, |
| 86 | + border: "1px solid", |
| 87 | + fontSize: "0.875rem", |
| 88 | + "&:hover": { |
| 89 | + color: theme.palette.primary.dark, |
| 90 | + backgroundColor: theme.palette.secondary.light, |
| 91 | + }, |
| 92 | + }, |
| 93 | + }), |
| 94 | + }, |
| 95 | + }, |
| 96 | + }, |
| 97 | +}); |
| 98 | + |
| 99 | +const DiamondTheme: Theme = createTheme(DiamondThemeOptions); |
| 100 | + |
| 101 | +export { DiamondTheme, DiamondThemeOptions }; |
0 commit comments