Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix collapsed sidebar padding. #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

seanfisk
Copy link
Contributor

Hi Alex,

We were encountering some strange behaviors with the collapsed sidebar. First, let me explain the desired sidebar behavior back to you and see if I understand it correctly:

There are two body classes of importance when dealing with the collapsed sidebar:

  • collapse-sidebar: Indicates that the sidebar is currently collapsed, meaning that it is now shown in the footer and not on the right side. This can happen when the page is sized or resized to a smaller width, by clicking the sidebar toggler, or by setting sidebar: collapse in the config file.
  • sidebar-footer: Indicates that the sidebar should be permanently shown in the footer. The sidebar toggler does not appear.

Now here are the behaviors that I was seeing:

  • Width ≥ 992px
    • If the sidebar is collapsed by the toggler or resizing, the collapsed sidebar padding matches the content and looks great.
    • If the sidebar is collapsed by sidebar: collapse in the config file (which sets sidebar-footer on the body), the collapsed sidebar has no padding.
  • Width < 992px
    • Whatever way it is collapsed, the sidebar shows no padding.

There are two problems that I see:

  • The collapsed sidebar's behavior is not consistent across different ways to set it (toggler, resizing, config file). This seems to me a bug for sure.
  • The collapsed sidebar's padding does not match the content. Personally, I like the sidebar's padding to match the content, but styles are subjective and I'm not exactly sure what was intended.

This PR fixes both. Let me know if that is not your preference. By the way, I tested this with a default Octopress master branch, not just with our site.

Sorry this got a little long. Took me a while to figure out and I wanted to explain it clearly.

@alexharris
Copy link
Owner

Hi Sean,

Works for me! Thinking back, I suspect the original issues stemmed from me never using the "collapse button" nor the config option, I think I always just relied on screen-resizing to determine if there was a sidebar or not.

Do you have this patch applied to the gvtools site right now? I'm not seeing the sidebar anywhere except the footer, but maybe my laptop monitor just isn't wide enough to reach the css mediaquery breakpoint?

Your diff looks fine to me, and I'll merge once I can see it on my larger monitor at home.

thanks for another improvement!

alex

@alexharris
Copy link
Owner

Sean, even on my larger monitor, I am not seeing the sidebar leave the bottom of the site. Is this just something to do with the configuration of your site right now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants