From 024a3eb760800dc67414e3ad037c5697fee4f243 Mon Sep 17 00:00:00 2001 From: bietiaop <1527109126@qq.com> Date: Sun, 9 Feb 2025 00:18:14 +0800 Subject: [PATCH] fix --- src/webui/index.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/webui/index.ts b/src/webui/index.ts index a2e5c415..a4eae968 100644 --- a/src/webui/index.ts +++ b/src/webui/index.ts @@ -84,17 +84,17 @@ export async function InitWebUi(logger: LogWrapper, pathWrapper: NapCatPathWrapp // 如果是自定义色彩,构建一个css文件 app.use('/files/theme.css', async (_req, res) => { const colors = await WebUiConfig.GetTheme(); - // 生成css(分为亮色和暗色,靠class和[data-theme="light"]) - let css = '.dark, [data-theme="dark"] {'; - for (const key in colors.dark) { - css += `${key}: ${colors.dark[key]};`; - } - css += '}'; - css += '.light, [data-theme="light"] {'; + + let css = ':root, .light, [data-theme="light"] {'; for (const key in colors.light) { css += `${key}: ${colors.light[key]};`; } css += '}'; + css += '.dark, [data-theme="dark"] {'; + for (const key in colors.dark) { + css += `${key}: ${colors.dark[key]};`; + } + css += '}'; res.send(css); });