Skip to content

Resizable sidebar #1522

Closed
Closed

Description

@Soneji

Feature request

What problem does this feature solve?

Sometimes I have long headings which can get cut off on my sidebar. A resizable sizebar would be handy to solve this issue

What does the proposed API look like?

window.$docsify = {
    //...
    loadSidebar: true,
    resizeSidebar: true, // <- new
    //...
}

How should this be implemented in your opinion?

You can click on the sidebar and drag it to resize it.

It should be disabled on mobile.

Are you willing to work on this yourself?

Yes, but I would like some suggestions on the best way to implement this feature, and where in the codebase I should work.

Activity

  1. yanbutan commented on Dec 28, 2021

    @yanbutan

    Hi any update on this? Or any hacky way to achieve this you've explored?

  2. Soneji commented on Dec 28, 2021

    @Soneji
    Author

    Sorry @yanbutan I have not touched this since opening the issue. I would still love to see this feature if you or any of the 7 peopple who thumbs up'd this post want to work on it...

  3. trusktr commented on Dec 31, 2021

    @trusktr
    Member

    This would be an interesting feature. You can see in this screenshot, there are three elements:

    Screenshot from 2021-12-31 11-19-40

    They each have 300px width. Someone would need to add an invisible element along the edge of the sidebar for dragging, then adjust the 300px value of the elements.

    Here's how the CSS adjustment would work:

    Peek.2021-12-31.11-23.mp4

    Should be fairly easy to enable this with an option!

  4. yanbutan commented on Jan 12, 2022

    @yanbutan

    I managed to do it by adjusting their root css through some js events. I tried to change the css properties for that aside tag with .sidebar, but I rmbr it dint work as expected. I will try to find some time and upload snippets of my code when, maybe it can help some people. Also, it may not be the best way to do it so feel free to suggest ways to improve.

  5. added this to the 6.x milestone on Jun 16, 2024
  6. linked a pull request that will close this issuefeat: v5 style overhaul #2469on Jul 19, 2024
  7. jhildenbiddle commented on Jul 19, 2024

    @jhildenbiddle
    Member

    This issue has been addressed by PR #2469. The changes will be available when Docsify v5 is released.

    1. Sidebar links now wrap by default.
    2. Site administrators have the option of clamping sidebar links to a single line with ellipses if preferred
    3. Site administrators have the option to customize the sidebar width:
      :root {
        --sidebar-width: 280px;
      }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions