aksakalli / jekyll-doc-theme

Jekyll theme for creating project documentation websites
https://aksakalli.github.io/jekyll-doc-theme/
MIT License
290 stars 264 forks source link

header tag oddities #13

Closed covener closed 6 years ago

covener commented 6 years ago

Hi. I liked your theme and have been tinkering with a derivative of it on and off. I've painted myself into a bit of corner though and it relates to this block:

*[id]:before {
    display: block;
    content: " ";
    margin-top: -75px;
    height: 75px;
    visibility: hidden;
}

Leaving it in causes some weird background-color highlighting of h2/h3/h4 that I have -- in the same way that a developers tool extension will highlight a large block around a simple h2 in your docs/ sample. For example, changing an h2 element on your pages site in dev tools:

image

Taking it out causes skipping to an anchor/id in the URL bar to overshoot, so it has scrolled off the top. Presumably this is related to the navbar? But to be honest I couldn't really grok the original purpose or find any correlation. Thanks again for the theme!

Any hints appreciated!

covener commented 6 years ago

I see, it is explicitly there for the scroll to target as in https://stackoverflow.com/questions/4086107/fixed-page-header-overlaps-in-page-anchors