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

Hiding heading anchors breaks sidebar navigation #339

Closed
n1313 opened this issue Mar 2, 2017 · 7 comments
Closed

Hiding heading anchors breaks sidebar navigation #339

n1313 opened this issue Mar 2, 2017 · 7 comments
Labels
Milestone

Comments

@n1313
Copy link
Collaborator

n1313 commented Mar 2, 2017

I don't like the way new heading anchors look like so I have hidden them by modifying styles in the config:

    Heading: {
      anchor: {
        display: 'none'
      }
    }

and now the sidebar navigation is broken (because it expects the anchors to be present and visible on the page. This is beta 13.

/cc @okonet

@okonet
Copy link
Member

okonet commented Mar 2, 2017

Can you elaborate on what is broken and how it expects it to be present?

@n1313
Copy link
Collaborator Author

n1313 commented Mar 2, 2017

Anchor navigation works by scrolling the viewport to the location of the referenced element. If the referenced element is not displayed on the page (because it has display: none) then its location is not defined and there is nowhere to scroll to. Thus, hiding the anchor elements breaks the sidebar navigation: clicking on the menu items does nothing because there is no element to scroll to.

@okonet
Copy link
Member

okonet commented Mar 2, 2017

Makes sense. We should move id to the header or section element to fix this. Mind doing this?

@sapegin sapegin added the bug label Mar 2, 2017
@sapegin sapegin added this to the 5.0.0 milestone Mar 2, 2017
@n1313
Copy link
Collaborator Author

n1313 commented Mar 2, 2017

Ok, no problem. By the way, the anchors themselves don't look too good on narrow screens, they are a little bit off-screen, but I'm not going to fix that since I don't know what would be a good solution.

@sapegin
Copy link
Member

sapegin commented Mar 2, 2017

Also position is a bit strange on my style guide. Haven’t have time to investigate why:

image 2017-03-02 at 3 55 18 pm

@okonet
Copy link
Member

okonet commented Mar 2, 2017

We could move anchors to the end of the headings — Button #. Right now they are positioned absolutely.

@sapegin this is "by design" — tried to align them to the baseline but it seems a bit off in your case indeed.

@sapegin
Copy link
Member

sapegin commented Mar 2, 2017

Probably because we use corporate font in style guide.

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

No branches or pull requests

3 participants