Fixed blog post header hiding part of section when navigating using table of contents #329
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #263
Changes:
public/assets/css/blogpost.css:199-208
To prevent the header from eclipsing part of selected section when navigating using the table of contents, I have added
scroll-margin-top: 110px;
to every heading within.blog-card
to have the blog post page scroll appropriately. As different posts use different heading tags, I opted to include every heading tag in case one otherwise not included would be used in the future.Previously, the heading and part of the text would be hidden behind the header when navigating using table of contents, forcing the user to scroll up again. This was only a problem when the header would be following the viewport (at viewport width > 900px), therefore I used
@media screen and (min-width: 901px)
to keep scrolling with table of contents as usual when the header wouldn't be in the way.