暗黑模式调整

This commit is contained in:
fofolee 2020-07-20 19:06:33 +08:00
parent bb3888d8dc
commit ccb9fb0f5e

View File

@ -1,6 +1,13 @@
!function () {
if (utools.isDarkColors()) {
!$('#darkmode').length && $('head').append(`
<link id="darkmode" rel="stylesheet" href="assets/style/darkmode.css">
<link id="darkswal" rel="stylesheet" href="assets/plugins/sweetalert2/dark.min.css">`)
} else {
$('#darkmode').length && $('#darkmode, #darkswal').remove()
}
utools.onPluginEnter(async ({ code, type, payload }) => {
adaptDarkMode()
// oldVersionFix()
var handleEnter
utools.onPluginOut(() => {
@ -224,15 +231,4 @@
putDB(x, customFts[x], 'customFts');
})
}
// 兼容暗黑模式
let adaptDarkMode = () => {
if (utools.isDarkColors()) {
!$('#darkmode').length && $('head').append(`
<link id="darkmode" rel="stylesheet" href="assets/style/darkmode.css">
<link id="darkswal" rel="stylesheet" href="assets/plugins/sweetalert2/dark.min.css">`)
} else {
$('#darkmode').length && $('#darkmode, #darkswal').remove()
}
}
}()