GeraldWodni / forth-standard.org

Official website of the Forth 2012 Standard, and the Forth200x committee.
9 stars 3 forks source link

anchor to local fragment is displayed incorrectly due to fixed top block #13

Closed ruv closed 2 years ago

ruv commented 6 years ago

forth-standard.org web-site is affected by the bug described in "HTML position:fixed page header and in-page anchors" stackoverflow question, see the picture there.

To fix this issue you can adjust either :target::before pseudo-elements, or html and body elements on 50px (to scroll the body only, and the fixed block be outside the body). But since the fixed block's height can vary, the flawless pure CSS solution (without JavaScript) is to use flexible boxes (display: flex;) and scroll the main-content only, see an example on jsfiddle.

GeraldWodni commented 4 years ago

I played around with this for over an hour and only found partial solutions.

I think the real problem here is bootstrap, when I get around to it I would like to remove bootstrap totally and write a handcrafted solution. Bootstrap was chosen because I thought more people would want to directly interact with the code which is not the case. Personally I am not a big fan of bootstrap as is clutters up the html and hinders your own classes to some extend.

Having said that: If you or somebody else can come up with a workable solution which provides the following bullet points, it would be appreciated:

I will add a label if somebody wants to do this, just a small note: This repo is not my working repo, so the code can be a bit outdated (I pushed the configuration into the working repo in error, so I cannot sync easily).

GeraldWodni commented 4 years ago

I just added the folloiwing snippet to css/index.less

:target::before {
    height: @navbar-height;
}

this is quite ugly but gets the job done. If anybody comes up with a better solution, it is appreciated ;)

ruv commented 4 years ago

This repo is not my working repo, so the code can be a bit outdated (I pushed the configuration into the working repo in error, so I cannot sync easily).

The configuration can be removed from the working repo by means of git-filter-repo.

I wanted to contribute to this repo, but there isn't much sense if the repo is outdated.

GeraldWodni commented 4 years ago

@ruv will look into that after EuroForth 2020. I also want the repos in GitHub to be synchronized. BTW are you attending EuroForth? It would really be cool to finally meet you albeit online only ;)

ruv commented 3 years ago

I also want the repos in GitHub to be synchronized.

@GeraldWodni, how about synchronizing the repos? ) I would want to fix some bugs/issues.

GeraldWodni commented 3 years ago

@ruv Thanks for your patience, it took me quite a while to get this done. I removed all user data with bfg. Should you encounter any remaints, please let me know, I really want to protect users' privacy as good as possible.

PS: hope to see you at EuroForth 2021

ruv commented 2 years ago

I have created a pull request #36, probably it can close this issue with scrolling to a local fragment.

GeraldWodni commented 2 years ago

PR merged, thank you @ruv for the CSS snippet!