Hello, I would like to have my sidebar to auto hide, like Anytype or Notion.
Hellooo. Any suggestions ??
I would like to have the sidebar show up automatically when I put the cursor on the side.
- Don’t post the same thing multiple times.
- Feature requests are not questions, they are suggestions.
- What you want is possible with custom CSS.
- For the left sidebar:
#main-container.is-left-sidebar-open #left-sidebar { left: calc((var(--ls-left-sidebar-width) * -1) + 3px); } #main-container.is-left-sidebar-open:has(.left-sidebar-inner:hover) #left-sidebar , #main-container.is-left-sidebar-open:has(.left-sidebar-resizer:hover) #left-sidebar { left: 0px; } #main-container.is-left-sidebar-open { padding-left: 0px; }
- If you prefer to push the main content instead of covering it, add also these lines:
#main-container.is-left-sidebar-open:has(.left-sidebar-inner:hover) , #main-container.is-left-sidebar-open:has(.left-sidebar-resizer:hover) { padding-left: var(--ls-left-sidebar-width); }
- For simple entry animation, under line
left: 0px;
add the following lines:transition: left 1s; @starting-style { left: calc((var(--ls-left-sidebar-width) * -1) + 3px); }
- If you prefer to push the main content instead of covering it, add also these lines:
- For the right sidebar, read lower.
- For the left sidebar:
2 Likes
Thank you so much thats exactly what i want.
- One last question, can i add an animation when the side bar shows up ?
So not exactly. I have updated my answer with a simple animation.
Thank you so much this is awesome
2 questions
-
How can I tweak your code to make it work for right sidebar?
I replace all “left” words into “right” and it didn’t work, obviously. -
How can I make normal toggle right sidebar into covering mode?
(rather than default push mode)
- Right sidebar has a different implementation.
- Try this:
#right-sidebar { width: 3px !important; } #right-sidebar.open:hover { width: unset !important; }
- You may prefer some percentage, e.g.:
width: 40% !important;
- If you prefer covering the main content instead of pushing it, add also these lines:
position: fixed; right: 0px; top: 48px;
- You may prefer some percentage, e.g.:
1 Like
Thank you for your help.
A small issue. Buttons on the top right became overlapped.
Only minimize, maximize and close window can be clicked.
Either:
- Enable the Native title bar in Settings.
- Add this rule:
main.ls-right-sidebar-open div.r.flex.drag-region { position: relative; right: 144px; }
1 Like
Thank you. It works perfectly.