Skip to content

Commit bad96eb

Browse files
committed
Fix colour scheme
1 parent dd1234c commit bad96eb

File tree

2 files changed

+42
-52
lines changed

2 files changed

+42
-52
lines changed

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function App() {
102102
]}
103103
>
104104
<FixedTargetPanels />
105-
<Footer color={theme.palette.primary.main}>
105+
<Footer logo={theme.logos?.short} color={theme.palette.primary.main}>
106106
{/* <Footer logo={theme.logos.normal} color={theme.palette.primary.main}> */}
107107
<FooterLinks>
108108
<ColourSchemeButton sx={{ marginLeft: "1px", marginTop: "2px" }} />

src/CustomTheme.tsx

Lines changed: 41 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import logo from "./assets/logo.svg";
2-
3-
import { DiamondTheme } from "@diamondlightsource/sci-react-ui";
1+
import {
2+
mergeThemeOptions,
3+
DiamondThemeOptions,
4+
} from "@diamondlightsource/sci-react-ui";
45
import { createTheme, Theme } from "@mui/material";
56

67
// Augment the palette to include a custom color
@@ -21,57 +22,46 @@ declare module "@mui/material/Button" {
2122
}
2223
}
2324

24-
export const I24DiamondTheme: Theme = createTheme({
25-
...DiamondTheme,
26-
logos: {
27-
normal: {
28-
src: logo,
29-
srcDark: logo,
30-
alt: "DLS logo",
31-
},
32-
},
33-
colorSchemes: {
34-
dark: {
35-
palette: {
36-
primary: {
37-
main: "#202740",
38-
light: "#4C5266",
39-
dark: "#161B2C",
40-
},
41-
secondary: {
42-
main: "#facf07",
43-
light: "#FBD838", // light yellow
44-
dark: "#AF9004", // dark yellow
25+
const I24DiamondThemeOptions = mergeThemeOptions(
26+
{
27+
colorSchemes: {
28+
light: {
29+
palette: {
30+
custom: {
31+
main: "#1976d2",
32+
light: "#68a0e2",
33+
dark: "#10569b",
34+
contrastText: "#ffffff", // white
35+
},
4536
},
46-
custom: {
47-
main: "#1976d2",
48-
light: "#68a0e2",
49-
dark: "#10569b",
50-
contrastText: "#ffffff", // white
51-
},
52-
background: {
53-
default: "#050505",
54-
paper: "#121212",
37+
},
38+
dark: {
39+
palette: {
40+
primary: {
41+
main: "#202740",
42+
light: "#4C5266",
43+
dark: "#161B2C",
44+
},
45+
secondary: {
46+
main: "#facf07",
47+
light: "#FBD838", // light yellow
48+
dark: "#AF9004", // dark yellow
49+
},
50+
custom: {
51+
main: "#1976d2",
52+
light: "#68a0e2",
53+
dark: "#10569b",
54+
contrastText: "#ffffff", // white
55+
},
56+
background: {
57+
default: "#050505",
58+
paper: "#121212",
59+
},
5560
},
5661
},
5762
},
5863
},
59-
});
60-
61-
// To be improved and extended to light mode once
62-
// https://github.com/DiamondLightSource/sci-react-ui/pull/70
63-
// is merged and released (v0.2.0)
64+
DiamondThemeOptions
65+
);
6466

65-
/** Set up a customisable theme derived from the common DiamondTheme
66-
* This way it should be possible to easily add settings if required
67-
* eg. to add colorescheme options
68-
* colorSchemes: {
69-
* dark: {
70-
* palette: {
71-
* background: {
72-
* default: "121212",
73-
* paper: "121212",
74-
* },
75-
* },
76-
* },
77-
* }, */
67+
export const I24DiamondTheme: Theme = createTheme(I24DiamondThemeOptions);

0 commit comments

Comments
 (0)