aboutsummaryrefslogtreecommitdiffstats
path: root/packages/theme/src/index.ts
blob: 5ba225e518f51494ec20972cf568e2b1b72a6807 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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;