[Solved] Hover display all scrollbars

I just know hover display editor’s scrollbar.

.CodeMirror-vscrollbar {
    opacity: 0;
}

.CodeMirror-vscrollbar:hover {
    opacity: 1;
}

But I don’t know how to hover display preview mode 's scrollbar, and file pane 's vertical scrollbar and horizontal scrollbar.

image

and outline’s scrollbar .

I tried this code ,but doesn’t work. Please help .

::-webkit-scrollbar{
  background-color: transparent;
  width: 8px;
  opacity: 0;  
}

::-webkit-scrollbar:hover{
  opacity: 1;  
}

Thank you !

1 Like

Posted this on discord. Will post here if anyone is looking for the answer as well. Instead of opacity, use the visibility: hidden and visibility: initial to toggle items on hover. Visibility:hidden will hide the item, but it will still take up space so you can still hover/select it. Here’s a snippet example:

4 Likes

Thank you so much !

my version:

::-webkit-scrollbar {
    visibility: hidden;
    background-color: transparent;
    width: 10px;
}

::-webkit-scrollbar-thumb {
    visibility: hidden;
}

::-webkit-scrollbar:hover {
    visibility: initial;
}

::-webkit-scrollbar-thumb:hover {
    visibility: initial;
}