Open harsssh opened 2 weeks ago
When a site has no sidebar, the local navigation dropdown is incorrectly positioned. It appears to be offset to the right by the sidebar width, even though there is no sidebar present.
https://github.com/vuejs/vitepress/blob/d200f4e12543016e30c51661fb46d4185ed6be95/src/client/theme-default/components/VPLocalNavOutlineDropdown.vue#L161-L167
https://stackblitz.com/edit/vite-dxfigx?file=docs%2F.vitepress%2Fconfig.ts
When there is no sidebar, the dropdown should still appear directly below the "On this page" text, aligned as shown in the image.
System: OS: macOS 14.2.1 CPU: (8) arm64 Apple M2 Memory: 140.70 MB / 8.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.11.0 - ~/.asdf/installs/nodejs/22.11.0/bin/node Yarn: 1.22.22 - ~/.asdf/installs/nodejs/22.11.0/bin/yarn npm: 10.9.0 - ~/.asdf/plugins/nodejs/shims/npm bun: 1.1.33 - ~/.bun/bin/bun Browsers: Chrome: 130.0.6723.117 Safari: 17.2.1 npmPackages: vitepress: ^1.5.0 => 1.5.0
No response
--vp-sidebar-width should be 0 when there is no sidebar
--vp-sidebar-width
I'd like to work on fixing this bug. May I take this on?
Yeah sure! Thanks.
Describe the bug
When a site has no sidebar, the local navigation dropdown is incorrectly positioned. It appears to be offset to the right by the sidebar width, even though there is no sidebar present.
https://github.com/vuejs/vitepress/blob/d200f4e12543016e30c51661fb46d4185ed6be95/src/client/theme-default/components/VPLocalNavOutlineDropdown.vue#L161-L167
Reproduction
https://stackblitz.com/edit/vite-dxfigx?file=docs%2F.vitepress%2Fconfig.ts
Expected behavior
When there is no sidebar, the dropdown should still appear directly below the "On this page" text, aligned as shown in the image.
System Info
Additional context
No response
Validations