Skip to content

Conversation

armsnyder
Copy link
Contributor

Hi. Thanks for this beautiful theme. I however noticed something odd, which is that this adjustForScrollbar function does not seem to be doing anything under regular usage, but it is getting in my way when I try to customize my home page. I'll explain.

The code adds a ~15px margin to the right navigation arrow then the #body-inner height is near the same height as #body. The intent appears to be to detect when the scrollbar is present on-screen, but because #body is a div that contains #body-inner, and therefore content added to #body-inner affects the height of both divs, this condition will continue to always evaluate to false. I checked this on pages that required scrolling, and sure enough the margin of the right-nav was still 0.

So for the above reason I believe the code can be removed, since it doesn't seem to be serving its intended purpose. Please let me know if I misevaluated the purpose.

The reason I came across this is that I am trying to customize my home page in a way that it creates a banner that is flush with the top of the page. In doing so I have removed the 83px margin, which is now triggering this code to add a margin to the left nav, and it looks wrong.

Screen Shot 2020-07-21 at 12 27 40 PM

@matalo33 matalo33 added the enhancement Improvements to existing features label Sep 10, 2020
@matalo33 matalo33 added this to the v2.6.0 milestone Sep 10, 2020
@matalo33
Copy link
Contributor

I agree, this doesn't seem to be providing much benefit. I think it can come out too.

Thanks for your submission.

@matalo33 matalo33 merged commit 21a3f77 into matcornic:master Sep 10, 2020
@armsnyder armsnyder deleted the no-scrollbar-margin branch September 10, 2020 19:49
@McShelby
Copy link

With the last patch there are no more references to getScrollBarWidth() left in the code. So codewise this function could be removed, too.

The only thing that speaks against it is the fact that this function wasn't wrapped in an IIFE and therefore could be accessed by any user. In this case, the function should be deprecated and been removed in 3.0.

maxatome pushed a commit to maxatome/hugo-theme-learn that referenced this pull request Jan 23, 2024
maxatome pushed a commit to maxatome/hugo-theme-learn that referenced this pull request Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements to existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants