我个人不太喜欢主题切换功能,于是想要将主题切换关闭掉,于是将_config.arknights.yml中的color修改为dark-only
但修改完网页直接没有背景图了,这就说明这个设置有问题
我们打开meta-data.pug文件,找到以下代码,发现根本没有only的设置(这作者怎么这么坏阿)对此进行修改:
1 2 3 4 5 6 7 8 9 10 11
| script |if (window.localStorage.getItem('theme-mode') === 'light' if theme.color === 'auto' | || window.matchMedia('(prefers-color-scheme:light)').matches |) | document.documentElement.setAttribute('theme-mode', 'light') |if (window.localStorage.getItem('theme-mode') === 'dark' if theme.color === 'auto' | || window.matchMedia('(prefers-color-scheme:dark)').matches |) | document.documentElement.setAttribute('theme-mode', 'dark')
|
修改代码如下(其实就是将这个模式添加进去了):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| script if theme.color === 'dark-only' |document.documentElement.setAttribute('theme-mode', 'dark') else if theme.color === 'light-only' |document.documentElement.setAttribute('theme-mode', 'light') else |if (window.localStorage.getItem('theme-mode') === 'light' if theme.color === 'auto' | || window.matchMedia('(prefers-color-scheme:light)').matches |) | document.documentElement.setAttribute('theme-mode', 'light') |if (window.localStorage.getItem('theme-mode') === 'dark' if theme.color === 'auto' | || window.matchMedia('(prefers-color-scheme:dark)').matches |) | document.documentElement.setAttribute('theme-mode', 'dark')
|
这样我们就可以将主题背景图切换功能去掉了,如果想要修改背景图,只需要去_config.arknights.yml下的background_image对你所设置的dark/light进行修改就行
我设置的图片是uigradients中随机的一张渐变的图片