aboutsummaryrefslogtreecommitdiffstats
path: root/packages/theme/src/index.ts
blob: 94df5afd1090392e2fe2dfa2cc795a06c0cc2e98 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import makeDarkThemeConfig from './themes/dark';
import makeDefaultThemeConfig from './themes/default';
import { themeBrandPrimary } from './themes/legacy';

export enum ThemeType {
  default = 'default',
  dark = 'dark',
}

export const DEFAULT_ACCENT_COLOR = themeBrandPrimary;

export function theme(themeId: ThemeType,
                      brandColor: string = DEFAULT_ACCENT_COLOR) {
  return themeId === ThemeType.dark ?
    makeDarkThemeConfig(brandColor) :
    makeDefaultThemeConfig(brandColor);
}

const defaultThemeConfigWithDefaultAccentColor =
  makeDefaultThemeConfig(DEFAULT_ACCENT_COLOR);

export type Theme = typeof defaultThemeConfigWithDefaultAccentColor;