summaryrefslogtreecommitdiff
path: root/packages/client/src/scripts/theme.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/client/src/scripts/theme.ts')
-rw-r--r--packages/client/src/scripts/theme.ts38
1 files changed, 19 insertions, 19 deletions
diff --git a/packages/client/src/scripts/theme.ts b/packages/client/src/scripts/theme.ts
index 2cb78fae5c..b61b1684a8 100644
--- a/packages/client/src/scripts/theme.ts
+++ b/packages/client/src/scripts/theme.ts
@@ -1,5 +1,5 @@
import { globalEvents } from '@/events';
-import * as tinycolor from 'tinycolor2';
+import tinycolor from 'tinycolor2';
export type Theme = {
id: string;
@@ -10,29 +10,29 @@ export type Theme = {
props: Record<string, string>;
};
-export const lightTheme: Theme = require('@/themes/_light.json5');
-export const darkTheme: Theme = require('@/themes/_dark.json5');
+export const lightTheme: Theme = await import('@/themes/_light.json5');
+export const darkTheme: Theme = await import('@/themes/_dark.json5');
export const themeProps = Object.keys(lightTheme.props).filter(key => !key.startsWith('X'));
export const builtinThemes = [
- require('@/themes/l-light.json5'),
- require('@/themes/l-coffee.json5'),
- require('@/themes/l-apricot.json5'),
- require('@/themes/l-rainy.json5'),
- require('@/themes/l-vivid.json5'),
- require('@/themes/l-cherry.json5'),
- require('@/themes/l-sushi.json5'),
+ await import('@/themes/l-light.json5'),
+ await import('@/themes/l-coffee.json5'),
+ await import('@/themes/l-apricot.json5'),
+ await import('@/themes/l-rainy.json5'),
+ await import('@/themes/l-vivid.json5'),
+ await import('@/themes/l-cherry.json5'),
+ await import('@/themes/l-sushi.json5'),
- require('@/themes/d-dark.json5'),
- require('@/themes/d-persimmon.json5'),
- require('@/themes/d-astro.json5'),
- require('@/themes/d-future.json5'),
- require('@/themes/d-botanical.json5'),
- require('@/themes/d-cherry.json5'),
- require('@/themes/d-ice.json5'),
- require('@/themes/d-pumpkin.json5'),
- require('@/themes/d-black.json5'),
+ await import('@/themes/d-dark.json5'),
+ await import('@/themes/d-persimmon.json5'),
+ await import('@/themes/d-astro.json5'),
+ await import('@/themes/d-future.json5'),
+ await import('@/themes/d-botanical.json5'),
+ await import('@/themes/d-cherry.json5'),
+ await import('@/themes/d-ice.json5'),
+ await import('@/themes/d-pumpkin.json5'),
+ await import('@/themes/d-black.json5'),
] as Theme[];
let timeout = null;