Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deep nested side bar title isn't indented. #563

Closed
3 tasks done
soumi-akira opened this issue Mar 3, 2022 · 3 comments
Closed
3 tasks done

Deep nested side bar title isn't indented. #563

soumi-akira opened this issue Mar 3, 2022 · 3 comments
Labels
enhancement New feature or request theme Related to the theme

Comments

@soumi-akira
Copy link

Describe the bug

When side bar has more than 4 depth nested title, indent is broken.

Reproduction

.vitepress/config.ts

import { defineConfig, DefaultTheme } from "vitepress";

export default defineConfig({
  title: "Some document",
  description: "Just playing around.",
  themeConfig: {
    sidebar: {
      "/": [
        {
          text: "1",
          children: [
            {
              text: "2",
              children: [
                {
                  text: "3",
                  children: [
                    {
                      text: "4",
                      children: [
                        {
                          text: "5",
                          children: [
                            {
                              text: "6",
                              children: [],
                            },
                          ],
                        },
                      ],
                    },
                  ],
                },
              ],
            },
          ],
        },
      ],
    },
  },
});

this produce side bar like bellow.

image

Expected behavior

Produce correct indent.

image

The image above is made by changing sub title padding to 0.3rem 1.5rem 0.3rem 5rem for 5 and 0.3rem 1.5rem 0.3rem 6rem for 6 with Chrome dev tool.

System Info

System:
    OS: Windows 10 10.0.22000
    CPU: (8) x64 Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
    Memory: 16.17 GB / 31.59 GB
  Binaries:
    Node: 16.12.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.1.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 99.0.4844.51
    Edge: Spartan (44.22000.120.0), Chromium (98.0.1108.62)
    Internet Explorer: 11.0.22000.120
  npmPackages:
    vitepress: ^0.22.3 => 0.22.3

Additional context

I know if we use deep nested sub title, the layout is broken in many case, but at least it should be able to choice whether we use it or not I think.
Even if it's not supported officially, if we get it work by adding some script or something, it's welcome😀

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@soumi-akira soumi-akira added the bug: pending triage Maybe a bug, waiting for confirmation label Mar 3, 2022
soumi-akira pushed a commit to soumi-akira/vitepress that referenced this issue Mar 4, 2022
@kiaking
Copy link
Member

kiaking commented May 23, 2022

Thanks for the feedback! But closing it due to sidebar has no more nested structure in theme-next 🙇‍♂️

@kiaking kiaking closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2022
@kiaking kiaking added enhancement New feature or request theme Related to the theme and removed bug: pending triage Maybe a bug, waiting for confirmation labels May 23, 2022
@adam-tylr
Copy link

Is a nested sidebar intentionally not supported or is it something that could be implemented in the future?

@brc-dd
Copy link
Member

brc-dd commented Sep 2, 2022

@adam-tylr It's already implemented (#851) though we haven't documented it yet.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request theme Related to the theme
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants