Skip to content

Commit 8616f2c

Browse files
authored
Merge branch 'youlaitech:master' into master
2 parents 35d2274 + 6e828e0 commit 8616f2c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/settings.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { LanguageEnum } from "./enums/LanguageEnum";
55

66
const { pkg } = __APP_INFO__;
77

8+
const mediaQueryList = window.matchMedia("(prefers-color-scheme: dark)");
9+
810
const defaultSettings: AppSettings = {
911
title: pkg.name,
1012
version: pkg.version,
@@ -13,7 +15,7 @@ const defaultSettings: AppSettings = {
1315
fixedHeader: true,
1416
sidebarLogo: true,
1517
layout: LayoutEnum.LEFT,
16-
theme: ThemeEnum.LIGHT,
18+
theme: mediaQueryList.matches ? ThemeEnum.DARK : ThemeEnum.LIGHT,
1719
size: SizeEnum.DEFAULT,
1820
language: LanguageEnum.ZH_CN,
1921
themeColor: "#409EFF",

0 commit comments

Comments
 (0)