aboutsummaryrefslogtreecommitdiff
path: root/modern/src/common/theme/palette.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/common/theme/palette.js')
-rw-r--r--modern/src/common/theme/palette.js25
1 files changed, 9 insertions, 16 deletions
diff --git a/modern/src/common/theme/palette.js b/modern/src/common/theme/palette.js
index 99288aee..7bd63dac 100644
--- a/modern/src/common/theme/palette.js
+++ b/modern/src/common/theme/palette.js
@@ -1,7 +1,5 @@
import { useMediaQuery } from '@mui/material';
-import {
- amber, grey, green, indigo, red,
-} from '@mui/material/colors';
+import { grey, green, indigo } from '@mui/material/colors';
const validatedColor = (color) => (/^#([0-9A-Fa-f]{3}){1,2}$/.test(color) ? color : null);
@@ -10,27 +8,22 @@ export default (server) => {
const serverDarkMode = server?.attributes?.darkMode;
const darkMode = serverDarkMode !== undefined ? serverDarkMode : preferDarkMode;
- const colors = {
- primary: validatedColor(server?.attributes?.colorPrimary) || (darkMode ? indigo[200] : indigo[900]),
- secondary: validatedColor(server?.attributes?.colorSecondary) || (darkMode ? green[200] : green[800]),
- positive: green[500],
- medium: amber[700],
- negative: red[500],
- neutral: grey[500],
- geometry: '#3bb2d0',
- };
-
return {
mode: darkMode ? 'dark' : 'light',
background: {
default: darkMode ? grey[900] : grey[50],
},
primary: {
- main: colors.primary,
+ main: validatedColor(server?.attributes?.colorPrimary) || (darkMode ? indigo[200] : indigo[900]),
},
secondary: {
- main: colors.secondary,
+ main: validatedColor(server?.attributes?.colorSecondary) || (darkMode ? green[200] : green[800]),
+ },
+ neutral: {
+ main: grey[500],
+ },
+ geometry: {
+ main: '#3bb2d0',
},
- colors,
};
};