diff options
Diffstat (limited to 'packages/theme/src/index.ts')
-rw-r--r-- | packages/theme/src/index.ts | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/packages/theme/src/index.ts b/packages/theme/src/index.ts index 78d1dcbb9..5ba225e51 100644 --- a/packages/theme/src/index.ts +++ b/packages/theme/src/index.ts | |||
@@ -1,19 +1,21 @@ | |||
1 | import makeDarkThemeConfig from './themes/dark'; | 1 | import makeDarkThemeConfig from './themes/dark'; |
2 | import makeDefaultThemeConfig from './themes/default'; | 2 | import makeDefaultThemeConfig from './themes/default'; |
3 | import * as legacyStyles from './themes/legacy'; | 3 | import { themeBrandPrimary } from './themes/legacy'; |
4 | 4 | ||
5 | export enum ThemeType { | 5 | export enum ThemeType { |
6 | default = 'default', | 6 | default = 'default', |
7 | dark = 'dark', | 7 | dark = 'dark', |
8 | } | 8 | } |
9 | 9 | ||
10 | export const DEFAULT_ACCENT_COLOR = legacyStyles.themeBrandPrimary; | 10 | export const DEFAULT_ACCENT_COLOR = themeBrandPrimary; |
11 | 11 | ||
12 | export function theme(themeId: ThemeType, | 12 | export function theme( |
13 | brandColor: string = DEFAULT_ACCENT_COLOR) { | 13 | themeId: ThemeType, |
14 | return themeId === ThemeType.dark ? | 14 | brandColor: string = DEFAULT_ACCENT_COLOR, |
15 | makeDarkThemeConfig(brandColor) : | 15 | ) { |
16 | makeDefaultThemeConfig(brandColor); | 16 | return themeId === ThemeType.dark |
17 | ? makeDarkThemeConfig(brandColor) | ||
18 | : makeDefaultThemeConfig(brandColor); | ||
17 | } | 19 | } |
18 | 20 | ||
19 | const defaultThemeConfigWithDefaultAccentColor = | 21 | const defaultThemeConfigWithDefaultAccentColor = |