diff options
Diffstat (limited to 'packages/theme/src/index.ts')
-rw-r--r-- | packages/theme/src/index.ts | 20 |
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 @@ | |||
1 | import * as darkThemeConfig from './themes/dark'; | 1 | import makeDarkThemeConfig from './themes/dark'; |
2 | import * as defaultThemeConfig from './themes/default'; | 2 | import makeDefaultThemeConfig from './themes/default'; |
3 | import * as legacyStyles from './themes/legacy'; | 3 | import * as legacyStyles from './themes/legacy'; |
4 | 4 | ||
5 | export enum ThemeType { | 5 | export enum ThemeType { |
@@ -7,12 +7,16 @@ export enum ThemeType { | |||
7 | dark = 'dark', | 7 | dark = 'dark', |
8 | } | 8 | } |
9 | 9 | ||
10 | export function theme(themeId: ThemeType) { | 10 | export 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 }); | 12 | export 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 | ||
18 | export type Theme = typeof defaultThemeConfig; | 19 | const defaultThemeConfigWithDefaultAccentColor = |
20 | makeDefaultThemeConfig(DEFAULT_ACCENT_COLOR); | ||
21 | |||
22 | export type Theme = typeof defaultThemeConfigWithDefaultAccentColor; | ||