fix: prevent sidebar collapse from blocking mobile hamburger menu
The `.ev-sidebar-collapsed .VPSidebar { display: none }` rule was not
wrapped in a media query, causing it to hide the sidebar at all viewport
widths. When a user collapsed the sidebar on desktop, the state persisted
in localStorage; resizing below 960px then caused VitePress's native
hamburger menu to open an immediately-hidden sidebar. Wrapping the rule
in `@media (min-width: 960px)` limits the override to desktop only.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -673,9 +673,11 @@ watch(sidebarCollapsed, (collapsed) => {
|
||||
|
||||
/* ---- 收起状态下的 CSS 覆盖 ---- */
|
||||
|
||||
/* 隐藏侧边栏 */
|
||||
.ev-sidebar-collapsed .VPSidebar {
|
||||
display: none !important;
|
||||
/* 隐藏侧边栏 — 仅桌面端,避免覆盖移动端的汉堡菜单 */
|
||||
@media (min-width: 960px) {
|
||||
.ev-sidebar-collapsed .VPSidebar {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* 内容区域填满页面 */
|
||||
|
||||
Reference in New Issue
Block a user