Skip to content

Commit 5e31bef

Browse files
committed
perf: supports configuring initial theme mode (#327)
1 parent 0ada7b9 commit 5e31bef

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

source/js/toggle-theme.js

+12
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ KEEP.initModeToggle = () => {
2626
},
2727

2828
initModeStatus() {
29+
const configMode = KEEP.theme_config?.base_info?.mode
30+
31+
if (configMode === 'dark') {
32+
this.enableDarkMode()
33+
return
34+
}
35+
36+
if (configMode === 'light') {
37+
this.enableLightMode()
38+
return
39+
}
40+
2941
const styleStatus = KEEP.getStyleStatus()
3042

3143
if (styleStatus) {

0 commit comments

Comments
 (0)