pydata-sphinx-theme icon indicating copy to clipboard operation
pydata-sphinx-theme copied to clipboard

There is always a scrollbar shown in the primary sidebar

Open FranzRoters opened this issue 2 years ago • 16 comments

No matter how short the primary sidebar content is, I always get a scrollbar, even though it seems to be set to auto, as far as I understand the css code. Tested with 0.13.0 and 0.12.0.

FranzRoters avatar Mar 08 '23 15:03 FranzRoters

I've noticed this as well. For me, it only shows up in Chrome, but looks fine in Firefox. It seems to me to be caused by the sidebar end section, because this custom css fixes it for me (I have no content in that section).

.sidebar-primary-items__end {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

vkbo avatar Mar 10 '23 08:03 vkbo

I get that behaviour in both Firefox and Edge on Windows.

The custom.css works for me with 0.13.0. Thanks vkbo. I did not think about the sidebar end section as it is empty for me as well.

FranzRoters avatar Mar 10 '23 09:03 FranzRoters

is it a "y" scrollbar or a "x" scrollbar ?

12rambau avatar Mar 11 '23 20:03 12rambau

It's vertical. At least it was in my case. Seemingly caused by the top and bottom margins of the __end box.

vkbo avatar Mar 11 '23 21:03 vkbo

I was also referring to a y-scrollbar (vertical).

FranzRoters avatar Mar 12 '23 16:03 FranzRoters

ok perfect because we had another "x" scrollbar issue and I was sure it was solved with 0.13

12rambau avatar Mar 12 '23 22:03 12rambau

I have the same issue with Chrome and Safari (on macOS). Chrome renders a vertical sidebar, whereas Safari renders both vertical and horizontal scrollbars, even though the content easily fits into the available space. If it helps, I can post screenshots and/or margins/paddings for both browsers.

cbrnr avatar Jun 28 '23 11:06 cbrnr

Safari (showing mne.tools):

https://github.com/pydata/pydata-sphinx-theme/assets/4377312/747ed4ce-18d0-4f01-b295-2fc4a9e2f233

Chrome looks the same, but only shows the vertical scrollbar.

cbrnr avatar Jun 28 '23 11:06 cbrnr

Could you try it again with the main branch, we actually removed the custom scrollbar which may have solve this issue as a side effect.

12rambau avatar Jun 28 '23 18:06 12rambau

Nope, this didn't change anything: https://output.circle-artifacts.com/output/job/f85ea057-af56-418e-9d53-abd191e8c936/artifacts/0/html/index.html

cbrnr avatar Jun 29 '23 08:06 cbrnr

I use version 0.13.3 and have the same observation in Chrome and Brave. The workaround from https://github.com/pydata/pydata-sphinx-theme/issues/1238#issuecomment-1463465620 worked for me and the scrollbars disappear. Thanks.

Waiting for a new release so I can drop the workaround :wink:

ngulden avatar Sep 14 '23 14:09 ngulden

Linking sphinx-book-theme #732 to this issue as sphinx-book-theme appears affected downstream by pydata-sphinx-theme.

adam-grant-hendry avatar Sep 20 '23 22:09 adam-grant-hendry

I still experience this issue on sphinx-book-theme==1.0.1.

adam-grant-hendry avatar Sep 20 '23 22:09 adam-grant-hendry

#1238 (comment) also worked for me (i.e. completely removed the scrollbar).

Follow-up: I don't mind the narrow scrollbar quite so much, but mine renders with an ugly large scrollbar like in sphinx-book-theme #732.

  1. Is anyone else suffering from this?
  2. Does anyone know how to make the scrollbar slim and dark until hovered like this?

adam-grant-hendry avatar Sep 20 '23 22:09 adam-grant-hendry

I agree that https://github.com/pydata/pydata-sphinx-theme/issues/1238#issuecomment-1463465620 is a good workaround. The problem is here:

image

jamesdbrock avatar Aug 26 '24 00:08 jamesdbrock