We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 35d2274 + 6e828e0 commit 8616f2cCopy full SHA for 8616f2c
src/settings.ts
@@ -5,6 +5,8 @@ import { LanguageEnum } from "./enums/LanguageEnum";
5
6
const { pkg } = __APP_INFO__;
7
8
+const mediaQueryList = window.matchMedia("(prefers-color-scheme: dark)");
9
+
10
const defaultSettings: AppSettings = {
11
title: pkg.name,
12
version: pkg.version,
@@ -13,7 +15,7 @@ const defaultSettings: AppSettings = {
13
15
fixedHeader: true,
14
16
sidebarLogo: true,
17
layout: LayoutEnum.LEFT,
- theme: ThemeEnum.LIGHT,
18
+ theme: mediaQueryList.matches ? ThemeEnum.DARK : ThemeEnum.LIGHT,
19
size: SizeEnum.DEFAULT,
20
language: LanguageEnum.ZH_CN,
21
themeColor: "#409EFF",
0 commit comments