-
Tore.Brede authoredTore.Brede authored
import { createTheme } from '@mui/material/styles'
import { deepmerge } from '@mui/utils'
import uibTheme from 'themes/uib'
import uioTheme from 'themes/uio'
import mainTheme from 'themes/main'
import { appTheme } from 'appConfig'
declare module '@mui/material/styles' {
interface Theme {
greg: {
appMinWidth: string
appMaxWidth: string
headerBackgroundColor: string
h1TextColor: string
h2TextColor: string
footerBackgroundColor: string
footerTextColor: string
deactivatedColor: string
}
}
// allow configuration using `createTheme`
interface ThemeOptions {
greg?: {
appMinWidth?: string
appMaxWidth?: string
headerBackgroundColor?: string
h1TextColor?: string
h2TextColor?: string
footerBackgroundColor?: string
footerTextColor?: string,
deactivatedColor?: string
}
}
}
export const defaultTheme = createTheme(mainTheme)
function getTheme() {
switch (appTheme) {
case 'uib':
return createTheme(deepmerge(defaultTheme, uibTheme))
case 'uio':
return createTheme(deepmerge(defaultTheme, uioTheme))
case 'default':
return defaultTheme
default:
return defaultTheme
}
}
export default getTheme