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

Fixed blog post header hiding part of section when navigating using table of contents #329

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

CappeSun
Copy link

Resolves #263

Changes:

public/assets/css/blogpost.css:199-208

@media screen and (min-width: 901px) {
	.blog-card h1,
	.blog-card h2,
	.blog-card h3,
	.blog-card h4,
	.blog-card h5,
	.blog-card h6 {
		scroll-margin-top: 110px;
	}
}

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.

blog post no longer scrolls to far when using table of contents to navigate, previously the header would hide part of selected section (when viewport wider than 900px), forcing user to scroll back up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant