From 614bfe2852965dc5d281b958de640a96edda238a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=81=E5=86=9C=E9=98=BF=E6=A5=A0?= Date: Wed, 9 Sep 2026 12:09:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(web):=20=E5=90=8E=E5=8F=B0=E4=BE=A7?= =?UTF-8?q?=E6=A0=8F=E9=80=89=E4=B8=AD=E9=A1=B9=E6=94=B9=E9=BB=91=E5=BA=95?= =?UTF-8?q?=E5=8F=8D=E7=99=BD=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=98=8E=E6=9A=97?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8B=E9=80=89=E4=B8=AD=E6=80=81=E7=9C=8B?= =?UTF-8?q?=E4=B8=8D=E6=B8=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 自定义主题 colorPrimary 为近黑/近白,antd Menu 选中项默认的 primary 淡色底与侧栏底色对比不足;选中/hover 态改用 sidebar token(黑底反白/浅灰底),并覆盖此前对未选中文字色的误覆盖。 --- web/src/index.css | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/web/src/index.css b/web/src/index.css index 10b7e49..a638fd6 100644 --- a/web/src/index.css +++ b/web/src/index.css @@ -1314,6 +1314,19 @@ button.pn-note-back:hover { width: 15px; height: 15px; } +/* 选中项沿用侧栏 token 的黑底反白(colorPrimary 近黑/近白,antd 默认的 + primary 淡色底在明暗模式下都与侧栏底色拉不开) */ +.pn-admin-menu li.ant-menu-item-selected { + background: var(--sidebar-primary); + color: var(--sidebar-primary-foreground); +} +.pn-admin-menu li.ant-menu-item-selected svg { + color: var(--sidebar-primary-foreground); +} +.pn-admin-menu li.ant-menu-item:hover:not(.ant-menu-item-selected) { + background: var(--sidebar-accent); + color: var(--sidebar-accent-foreground); +} .pn-admin-foot { display: flex; flex-direction: column;