From 0eaa4b133eaf3bc6467c2153959bd95e5e02cb26 Mon Sep 17 00:00:00 2001 From: Matthew Wilcoxson Date: Tue, 2 Dec 2025 17:15:18 +0000 Subject: [PATCH] Old selectable theme --- src/index.ts | 1 + src/themes/DiamondOldTheme.ts | 37 +++++++++++++ src/themes/DiamondTheme.old | 101 ---------------------------------- 3 files changed, 38 insertions(+), 101 deletions(-) create mode 100644 src/themes/DiamondOldTheme.ts delete mode 100644 src/themes/DiamondTheme.old diff --git a/src/index.ts b/src/index.ts index 8277145..927ede8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -22,6 +22,7 @@ export * from "./components/helpers/jsonforms"; // themes export * from "./themes/BaseTheme"; export * from "./themes/DiamondTheme"; +export * from "./themes/DiamondOldTheme"; export * from "./themes/GenericTheme"; export * from "./themes/ThemeProvider"; export * from "./themes/ThemeManager"; diff --git a/src/themes/DiamondOldTheme.ts b/src/themes/DiamondOldTheme.ts new file mode 100644 index 0000000..5cfbf38 --- /dev/null +++ b/src/themes/DiamondOldTheme.ts @@ -0,0 +1,37 @@ +import { createTheme, Theme } from "@mui/material/styles"; + +import { mergeThemeOptions } from "./ThemeManager"; +import { DiamondThemeOptions } from "./DiamondTheme"; + +import logoImageDark from "../public/diamond/logo-dark.svg"; +import logoImageLight from "../public/diamond/logo-light.svg"; + +const DiamondOldThemeOptions = mergeThemeOptions( + { + logos: { + normal: { + src: logoImageDark, // Use the dark image for light backgrounds + srcDark: logoImageLight, // Use the light image for dark backgrounds + alt: "Diamond Light Source Logo", + width: "100", + }, + }, + colorSchemes: { + dark: { + palette: { + primary: { + main: "#6175bd", //lightened version of {dlsLogoBlue} + light: "#8090CA", // lighter blue + dark: "#435184", // mid blue + contrastText: "#ffffff", // white + }, + }, + }, + }, + }, + DiamondThemeOptions, +); + +const DiamondOldTheme: Theme = createTheme(DiamondOldThemeOptions); + +export { DiamondOldTheme, DiamondOldThemeOptions }; diff --git a/src/themes/DiamondTheme.old b/src/themes/DiamondTheme.old deleted file mode 100644 index 0969f5d..0000000 --- a/src/themes/DiamondTheme.old +++ /dev/null @@ -1,101 +0,0 @@ -import { createTheme, Theme } from "@mui/material/styles"; - -import { mergeThemeOptions } from "./ThemeManager"; - -import logoImageDark from "../public/diamond/logo-dark.svg"; -import logoImageLight from "../public/diamond/logo-light.svg"; -import logoShort from "../public/diamond/logo-short.svg"; - -const dlsLogoBlue = "#202740"; -const dlsLogoYellow = "#facf07"; - -const DiamondThemeOptions = mergeThemeOptions({ - logos: { - normal: { - src: logoImageDark, // Use the dark image for light backgrounds - srcDark: logoImageLight, // Use the light image for dark backgrounds - alt: "Diamond Light Source Logo", - width: "100", - }, - short: { - src: logoShort, - alt: "Diamond Light Source Logo", - width: "35", - }, - }, - colorSchemes: { - // https://zenoo.github.io/mui-theme-creator/ - light: { - palette: { - primary: { - main: dlsLogoBlue, - light: "#4C5266", // dark grey - dark: "#161B2C", // dark blue - contrastText: "#ffffff", // white - }, - secondary: { - main: dlsLogoYellow, - light: "#FBD838", // light yellow - dark: "#AF9004", // dark yellow - contrastText: "#000000", // black - }, - text: { - secondary: "#161B2C", - }, - }, - }, - dark: { - palette: { - primary: { - main: "#6175bd", //lightened version of {dlsLogoBlue} - light: "#8090CA", // lighter blue - dark: "#435184", // mid blue - contrastText: "#ffffff", // white - }, - secondary: { - main: dlsLogoYellow, - light: "#FBD838", // light yellow - dark: "#AF9004", // dark yellow - contrastText: "#000000", // black - }, - text: { - secondary: "#8090CA", - }, - }, - }, - }, - components: { - MuiButton: { - styleOverrides: { - root: ({ theme }: { theme: Theme }) => ({ - textTransform: "none", - "&.MuiButton-contained": {}, - "&.default": { - color: theme.palette.primary.contrastText, - backgroundColor: theme.palette.primary.dark, - "&:hover": { - backgroundImage: "linear-gradient(rgb(0 0 0/30%) 0 0)", - "&:disabled": { - backgroundColor: theme.palette.primary.light, - }, - }, - }, - "&.onBlue": { - color: theme.palette.secondary.light, - borderColor: theme.palette.secondary.light, - border: "1px solid", - fontSize: "0.875rem", - "&:hover": { - color: theme.palette.primary.dark, - backgroundColor: theme.palette.secondary.light, - }, - }, - }), - }, - }, - }, -}); - -const DiamondTheme: Theme = createTheme(DiamondThemeOptions); - -export { DiamondTheme, DiamondThemeOptions };