Skip to content

Commit 3c9707e

Browse files
fix(sidebar): prevent duplicate sidebar components on tablet in grid mode
In tablet grid layout, the flat flex-row styles for sidebar components were applying 'display: contents' to ALL .sidebar-content containers, including the desktop-only ones (hidden lg:flex). This caused both the tablet-specific and desktop-specific sidebar containers to be flattened into the bottom bar simultaneously, resulting in duplicate components. The fix narrows the CSS selector to only target tablet-specific containers by adding the .lg\:hidden class, which is present on tablet containers but absent from desktop containers.
1 parent 227719d commit 3c9707e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/styles/banner.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,8 @@ body.wallpaper-transparent #toc-inner-wrapper:has(table-of-contents[data-loaded=
553553

554554
#main-grid[data-layout-mode="grid"] #sidebar > div,
555555
#main-grid[data-layout-mode="grid"] #sidebar #sidebar-sticky,
556-
#main-grid[data-layout-mode="grid"] #sidebar .sidebar-content {
556+
/* 仅扁平化平板专用的 .sidebar-content(带 lg:hidden 的容器),避免桌面容器在平板端被强制显示 */
557+
#main-grid[data-layout-mode="grid"] #sidebar .sidebar-content.lg\:hidden {
557558
display: contents !important;
558559
margin: 0 !important;
559560
padding: 0 !important;

0 commit comments

Comments
 (0)