aboutsummaryrefslogtreecommitdiffstats
path: root/packages/theme/src/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/theme/src/index.ts')
-rw-r--r--packages/theme/src/index.ts20
1 files changed, 12 insertions, 8 deletions
diff --git a/packages/theme/src/index.ts b/packages/theme/src/index.ts
index 524a9edf1..78d1dcbb9 100644
--- a/packages/theme/src/index.ts
+++ b/packages/theme/src/index.ts
@@ -1,5 +1,5 @@
1import * as darkThemeConfig from './themes/dark'; 1import makeDarkThemeConfig from './themes/dark';
2import * as defaultThemeConfig from './themes/default'; 2import makeDefaultThemeConfig from './themes/default';
3import * as legacyStyles from './themes/legacy'; 3import * as legacyStyles from './themes/legacy';
4 4
5export enum ThemeType { 5export enum ThemeType {
@@ -7,12 +7,16 @@ export enum ThemeType {
7 dark = 'dark', 7 dark = 'dark',
8} 8}
9 9
10export function theme(themeId: ThemeType) { 10export const DEFAULT_ACCENT_COLOR = legacyStyles.themeBrandPrimary;
11 if (themeId === ThemeType.dark) {
12 return Object.assign({}, defaultThemeConfig, darkThemeConfig, { legacyStyles });
13 }
14 11
15 return Object.assign({}, defaultThemeConfig, { legacyStyles }); 12export function theme(themeId: ThemeType,
13 brandColor: string = DEFAULT_ACCENT_COLOR) {
14 return themeId === ThemeType.dark ?
15 makeDarkThemeConfig(brandColor) :
16 makeDefaultThemeConfig(brandColor);
16} 17}
17 18
18export type Theme = typeof defaultThemeConfig; 19const defaultThemeConfigWithDefaultAccentColor =
20 makeDefaultThemeConfig(DEFAULT_ACCENT_COLOR);
21
22export type Theme = typeof defaultThemeConfigWithDefaultAccentColor;