feat(style): 超级菜单展开期间 header 保持不透明,关闭后才恢复透明(含防抖期)

This commit is contained in:
TermiNexus committed 2026-08-18 21:37:22 +08:00
1 parent 0193510bcb
commit 1ba7a1f048
1 file changed
+13 -3
+13 -3
View File
@@ -4,11 +4,12 @@
<header
id="header"
class="fixed top-0 left-0 right-0 z-50 transition-all duration-300 ease-in-out bg-white shadow-sm border-b border-gray-100 dark:bg-gray-900 dark:border-gray-800"
:class="
:class="[
navTheme === 'light'
? '!bg-transparent !shadow-none !border-transparent hover:!bg-white hover:!shadow-sm hover:!border-gray-100'
: ''
"
: '',
{ 'menu-open': navTheme === 'light' && activeMega !== null },
]"
:data-nav-theme="navTheme"
>
<div class="flex items-center justify-between h-16 px-6">
@@ -505,4 +506,13 @@ watch(
#header[data-nav-theme='light']:hover::before {
opacity: 1;
}
/* 超级菜单展开期间:header 保持正常背景(不透明),菜单关闭后恢复透明 */
#header[data-nav-theme='light'].menu-open {
background-color: #ffffff !important;
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important;
border-bottom-color: rgb(229 231 235) !important;
}
#header[data-nav-theme='light'].menu-open::before {
opacity: 1;
}
</style>