Reactjs.org: Anchors are hidden underneath the navbar when navigating to them

Created on 16 Jul 2020  路  13Comments  路  Source: reactjs/reactjs.org

I noticed that anchor links slide under the navbar. This is similar to https://github.com/facebook/docusaurus/issues/2907 and likely caused by the increase of the height of the navbar caused by the BLM banner.

Steps to reproduce

  1. Create an anchor and a link to the anchor in React docs
  2. Publish the website
  3. Tap the anchor link

Expected result

The anchor appears in view at the top of the page

Actual result

The anchor appears at the top of the page hidden under the navbar

Screen Shot 2020-07-16 at 9 39 25 PM

confirmed beginner good first issue

Most helpful comment

Nevermind... I managed to do it. Will make a pr in few mins

All 13 comments

The padding of anchors appears to be set in the Gatsby theme here:

https://github.com/reactjs/reactjs.org/blob/master/src/theme.js#L286-L292

Confirmed, thanks for filing this @claudiopro. Do you want to submit a PR to fix it?

@rickhanlonii @claudiopro Can I try this?

@harshilparmar yeah! Let me know if you need any help getting set up.

Hey, I hope it's ok but I took the liberty of looking into this issue and made a PR with a potential fix.

I have a fix for this. Can I do this?

@claudiopro @rikhanlonii ^

@rickhanlonii

@kavin25 Go for it :+1:

I am not able to find this component and css for this. I have been able to implement it with inspect element, in chrome though. I found that there is a markdownremark being passed to markdownpage. The markdownremark comes from a data object, which is passed as props. But I am not able to find where the docs.js component is being called.

This is my first time, so will be very helpful if someone can help

Nevermind... I managed to do it. Will make a pr in few mins

Have created a PR

Thanks for the fix!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaredp picture jaredp  路  4Comments

gajomon picture gajomon  路  4Comments

andresmatasuarez picture andresmatasuarez  路  5Comments

tajo picture tajo  路  4Comments

gaearon picture gaearon  路  4Comments